Noise Analysis Tools
These tools analyze output from LTspice .noise simulations. Run a noise simulation first with a directive like .noise V(out) V1 dec 100 1 1meg, then pass the resulting .raw file to any of the tools below.
analyze_noise
Section titled “analyze_noise”Comprehensive noise analysis from a .noise simulation. Parses the .raw file and returns spectral density across all simulated frequencies, spot noise at five standard frequencies (10 Hz, 100 Hz, 1 kHz, 10 kHz, 100 kHz), total integrated RMS noise over the full bandwidth, noise figure relative to the source resistance, and an estimate of the 1/f (flicker) corner frequency.
The noise figure calculation uses the formula NF(f) = 10 log10(|noise(f)|^2 / (4 k T R)), referenced to the IEEE standard temperature of 290 K.
| Parameter | Type | Default | Description |
|---|---|---|---|
| raw_file_path | str | --- | Path to .raw file from a .noise simulation. |
| noise_signal | str | "onoise" | Which noise variable to analyze. "onoise" for output-referred, "inoise" for input-referred. |
| source_resistance | float | 50.0 | Source impedance in ohms, used for noise figure calculation. |
Returns: A dict with five top-level keys:
spectral_density— arrays offrequency_hz,noise_density_v_per_sqrt_hz, andnoise_density_db.spot_noise— a dict keyed by frequency label ("10Hz","100Hz","1kHz","10kHz","100kHz"), each containingspot_noise_v_per_sqrt_hz,spot_noise_db, andactual_freq_hz. Only includes frequencies within the simulation range.total_noise—total_rms_v,integration_range_hz(two-element array), andequivalent_noise_bandwidth_hz.noise_figure— arrays ofnoise_figure_dbandfrequency_hz, plusmin_nf_dbandnf_at_1khz.flicker_corner_hz— estimated 1/f corner frequency in Hz, ornullif not detectable.
Example
{ "spectral_density": { "frequency_hz": [1.0, 1.26, 1.58, "..."], "noise_density_v_per_sqrt_hz": [4.2e-7, 3.9e-7, 3.5e-7, "..."], "noise_density_db": [-127.5, -128.2, -129.1, "..."] }, "spot_noise": { "10Hz": { "spot_noise_v_per_sqrt_hz": 3.1e-7, "spot_noise_db": -130.2, "actual_freq_hz": 10.0 }, "1kHz": { "spot_noise_v_per_sqrt_hz": 1.2e-7, "spot_noise_db": -138.4, "actual_freq_hz": 1000.0 } }, "total_noise": { "total_rms_v": 4.7e-5, "integration_range_hz": [1.0, 1000000.0], "equivalent_noise_bandwidth_hz": 156000.0 }, "noise_figure": { "noise_figure_db": [12.3, 11.8, "..."], "frequency_hz": [1.0, 1.26, "..."], "min_nf_db": 3.2, "nf_at_1khz": 5.1 }, "flicker_corner_hz": 850.0}get_spot_noise
Section titled “get_spot_noise”Get noise spectral density at a specific frequency. Interpolates linearly between adjacent simulation data points. If the target frequency falls outside the simulated range, the nearest boundary value is returned.
| Parameter | Type | Default | Description |
|---|---|---|---|
| raw_file_path | str | --- | Path to .raw file from a .noise simulation. |
| target_freq | float | --- | Frequency in Hz at which to measure noise density. |
| noise_signal | str | "onoise" | "onoise" for output-referred or "inoise" for input-referred. |
Returns: A dict with spot_noise_v_per_sqrt_hz (noise density in V/sqrt(Hz)), spot_noise_db (20 log10 of the density), and actual_freq_hz (the frequency actually used --- equals target_freq when interpolation succeeds, or the clamped boundary frequency otherwise).
Example
{ "spot_noise_v_per_sqrt_hz": 1.2e-7, "spot_noise_db": -138.4, "actual_freq_hz": 1000.0}get_total_noise
Section titled “get_total_noise”Integrate noise spectral density over a frequency band to get total RMS noise. Computes total_rms = sqrt(integral(|noise|^2 * df)) using trapezoidal integration. This is the value you would read on an RMS voltmeter with a bandwidth equal to the integration range.
| Parameter | Type | Default | Description |
|---|---|---|---|
| raw_file_path | str | --- | Path to .raw file from a .noise simulation. |
| noise_signal | str | "onoise" | "onoise" or "inoise". |
| f_low | float | None | None | Lower integration bound in Hz. Defaults to the minimum frequency in the simulation data. |
| f_high | float | None | None | Upper integration bound in Hz. Defaults to the maximum frequency in the simulation data. |
Returns: A dict with total_rms_v (integrated RMS noise in volts), integration_range_hz (two-element array [f_low, f_high]), and equivalent_noise_bandwidth_hz (the bandwidth of a brick-wall filter with the same peak density that would pass the same total noise power).
Example
{ "total_rms_v": 4.7e-5, "integration_range_hz": [100.0, 100000.0], "equivalent_noise_bandwidth_hz": 42000.0}