On this page
Periodogram vs Welch PSD and variance reduction
For a discrete time series sampled uniformly at rate (), the unaveraged modified periodogram computes one discrete Fourier transform across all samples after multiplying by a normalized window . While its frequency spacing is as narrow as the record allows, every frequency bin retains roughly 100% standard deviation relative to the true spectrum because adding more samples increases frequency resolution rather than averaging independent realizations.
Welch's method (1967) solves that variance floor by partitioning the series into overlapping segments of length nperseg (step size nperseg ), applying the window to each segment, and averaging the resulting periodograms:
Because overlapping tapers de-correlate adjacent windows, dividing a long trace into segments cuts spectral variance roughly proportionally to while capping frequency resolution at . An equally critical precondition is uniform sampling: interpolating or re-gridding jittered timestamps must come first when time steps vary by more than roughly 1%, or phase shifts distort every harmonic. Note also how discrete DC () behaves: on a plot, zero frequency cannot appear on the horizontal axis, so tracking dcPower separately keeps any unremoved offset from corrupting the low-frequency slope.
Choosing windows, detrending, and Density vs Spectrum
Three estimator settings decide whether two power spectra share units, baseline, and leakage behavior (Harris, 1978):
| Setting | Choice | What it measures | Watch out for |
|---|---|---|---|
Window | Hann or Blackman | Low-leakage broadband continuum and slopes | Boxcar (rectangular) spills strong-tone power into broad sidelobes across decades |
Window | Flat-Top | Accurate peak power for pure sine waves off bin centers | Very wide main lobe blurs nearby tones; poor choice for steep broadband slopes |
Detrend | Constant vs Linear | Removes mean DC offset or slow linear drift per segment | None leaks large DC bias into low-frequency bins right where fits begin |
Scaling | Density () | Power per unit frequency; invariant to nperseg on white/colored noise | Spectrum () scales peak height cleanly for single tones but shifts broadband continuum height whenever nperseg changes |
When comparing an oscillator spectrum collected at fs = 1000 Hz against one collected at fs = 2000 Hz, or switching nperseg from 512 to 2048, always inspect Density scaling rather than raw Spectrum power so bin width divides out consistently.
Why 1/fᵅ slopes need log-binned fitting
Broadband noise processes—from self-organized critical fluctuations (Bak, Tang, and Wiesenfeld, 1987) to electronic flicker noise, biological time series, and turbulent cascades—follow a spectral power law (Timmer and König, 1995):
Taking base-10 logarithms yields a line of slope and intercept :
A subtle trap happens if you run ordinary least squares directly on all raw FFT frequencies inside . Because FFT bins are linearly spaced (), the decade from 100 to 1000 Hz contains ten times as many frequency points as 10 to 100 Hz, and a hundred times as many as 1 to 10 Hz. Unweighted regression on linear bins almost ignores the low-frequency decade and lets high-frequency scatter or Nyquist rolloff dictate . Enabling geometric Log-bin fit aggregates across uniform bins first—just like the conditional averaging explained in power-law scaling relations and log binning—so every decade carries comparable weight.
Restrict away from coherent spikes and thermal noise floors before accepting . In the synthetic 8,192-sample example below ( colored background generated after Timmer and König, 1995, plus a coherent 65 Hz peak), bounding the Log-bin fit window to 2.93 – 39.06 Hz ( from 0.467 to 1.59, 22 fit points) excludes the narrow 65 Hz tone at and recovers ().
Autoplot vs Igor Pro, MATLAB, and SciPy for PSD
Choose the environment that matches your sampling geometry and downstream signal-processing requirements:
| Capability | Autoplot (PSD & Fit) | Igor Pro | MATLAB / SciPy |
|---|---|---|---|
| Mac execution | Native Apple silicon (macOS 15+) | 9.05 Intel under Rosetta 2; 10 is Windows-only | Native macOS binaries and Python environments |
| Spectral estimators | Welch and Periodogram; Hann, Hamming, Blackman, Flat-Top, Boxcar | DSPPeriodogram, FFT, built-in window tapers | pwelch, multi-taper (pmtm), lombscargle, cross-PSD, coherence |
| slope fit | Built-in Log-bin fit (5–200 bins) and bounds in GUI | Scripted in Igor procedures after computing spectrum | Scripted in NumPy / SciPy (polyfit, curve_fit) |
| Best role | Interactive exploratory and figure-ready 1D time-series spectra | Legacy .pxp/.ibw experiments and 2D/complex FFTs | Unevenly sampled Lomb–Scargle, custom tapers, batch DSP |
For uniform 1D recordings imported from CSV or delimited text—especially when moving everyday plotting and spectral checks off Intel-only Igor Pro on Apple silicon—Autoplot turns window selection, detrending, log-binned slope fitting, and vector export into one interactive workspace. Keep Igor Pro for .pxp/.ibw legacy experiments or 2D transforms, and use MATLAB or custom SciPy scripts when your analysis requires uneven-time Lomb–Scargle spectra, cross-spectral coherence, or multi-taper estimators.
PSD & 1/fᵅ Fit in Autoplot
Autoplot's PSD & Fit analysis (Run Analysis → PSD & 1/fᵅ Fit inside any X&Y Plot, Plus — free for 30 days) runs Welch or Periodogram spectral estimation and log–log power-law regression locally on your Mac:
- Inputs (
Source): select numericSignaland optional uniformTime (opt.)(verified uniform within to infer automatically), or enterRate (Hz)directly whenTime (opt.)is omitted. - Estimator & fit controls (
Spectrum & fit): switchMethod(Welch/Periodogram),Window(Hann,Hamming,Blackman,Flat-Top,Boxcar),nperseg,Overlap(0%–90%),Detrend(Constant,Linear,None),Scaling(DensityorSpectrum),Coordinates( orLinear), (or linear ), andLog-bin fit(5–200bins). - Results & exports (
Mark & stroke,Figure Inspector → Results): stylePSD line,Markers,Fit line, andY offset, inspect , , ,fitRange,bins, anddcPower, then export the fitted curve viaExport 1/fᵅ Functionor frequency/PSD arrays viaExport PSD Variables. - Where it stops: PSD & Fit requires uniform 1D sampling ( step variation); unevenly sampled time series (Lomb–Scargle), cross-spectral phase/coherence between two channels, and multi-taper spectra require a separate script in Python or MATLAB—for general nonlinear fits on exported spectra, see how to fit a curve to data.
Frequently asked questions
| Should I use Density or Spectrum scaling when comparing two signals? | Use Density whenever two signals have different segment lengths (nperseg) or different window equivalent noise bandwidths, because dividing by bandwidth aligns broadband noise floors in . Switch to Spectrum () with a Flat-Top window only when measuring the peak amplitude of isolated discrete sine tones. |
|---|---|
| Why does Log-bin fit change my estimated 1/fᵅ slope? | Linear FFT spacing puts ten times as many points into each higher frequency decade, so unbinned regression fits mainly the high-frequency band. Turning on Log-bin fit averages inside equal intervals first so low and high decades contribute evenly across the chosen fit window. |
| What happens if my time axis is not uniformly sampled? | FFT-based Welch and periodogram estimators assume fixed . If timestamps vary by more than 1%, resample or interpolate onto a regular time grid first, or compute a Lomb–Scargle periodogram outside Autoplot. |
| Can Autoplot compute cross-spectral coherence or multi-taper spectra? | No: Autoplot's PSD & Fit layer handles single-channel uniform-grid Welch and single-window Periodogram estimation across Hann, Hamming, Blackman, Flat-Top, and Boxcar tapers. Export arrays or run scipy.signal.coherence or scipy.signal.windows.dpss in Python when multi-channel coherence or Slepian multi-taper estimation is required. |
Sources
Algorithm details (compute_psd_and_power_law, uniform time-step validation, Welch/Periodogram routing, bin-averaged OLS slope and error propagation, and dcPower isolation) and UI labels (PSD & 1/fᵅ Fit, nperseg, Log-bin fit, Density, Spectrum, Export 1/fᵅ Function, Export PSD Variables) were verified directly against Autoplot 2.5.2 source (math_logic.py, FigureCardEditors.swift, and Autoplot's PSD documentation) on 27 November 2026. Underlying estimators wrap SciPy's scipy.signal.welch, scipy.signal.periodogram, and NumPy's numpy.polyfit. Spectral averaging draws on P. D. Welch, "The use of fast Fourier transform for the estimation of power spectra: A method based on time averaging over short, modified periodograms," IEEE Transactions on Audio and Electroacoustics 15(2), 70–73 (1967), DOI 10.1109/TAU.1967.1161901; window leakage and amplitude accuracy draw on F. J. Harris, "On the use of windows for harmonic analysis with the discrete Fourier transform," Proceedings of the IEEE 66(1), 51–83 (1978), DOI 10.1109/PROC.1978.10837; self-organized critical spectra draw on P. Bak, C. Tang, and K. Wiesenfeld, "Self-organized criticality: An explanation of the noise," Physical Review Letters 59(4), 381–384 (1987), DOI 10.1103/PhysRevLett.59.381; and synthetic noise generation draws on J. Timmer and M. König, "On generating power law noise," Astronomy & Astrophysics 300, 707–710 (1995), ADS 1995A&A...300..707T.