Spectral Density Calculator

Analyze signal power across frequencies with advanced controls. Set sampling rate, window type, and averaging. Export tables instantly for clear reports and comparisons today.

Inputs

Paste values separated by commas, spaces, or new lines.
Fs controls the frequency axis scaling.
Outputs are squared-per-Hz units.
Removing mean reduces DC dominance.
Welch reduces variance by averaging segments.
Windows control leakage and resolution tradeoffs.
One-sided doubles non-DC bins for real signals.
Used only for Welch averaging.
Typical values are 25–75% overlap.
Filters the output table and exports.
Leave blank for the full computed range.
White theme

Formula used

This tool estimates the power spectral density using a discrete Fourier transform (DFT). For a windowed sequence \(x_w[n] = x[n]w[n]\) of length \(N\), the DFT is \(X[k] = \sum_{n=0}^{N-1} x_w[n] e^{-j2\pi kn/N}\).

The periodogram PSD estimate is scaled as \(P_{xx}[k] = \frac{|X[k]|^2}{F_s\,N\,U}\), where \(F_s\) is the sampling frequency and \(U = \frac{1}{N}\sum_{n=0}^{N-1} w^2[n]\) normalizes window power.

Welch averaging splits the data into overlapping segments, applies the same window, computes a periodogram per segment, and then averages those periodograms to reduce estimator variance.

How to use this calculator

  1. Paste your sampled values into the time-series box.
  2. Set the sampling frequency to match your acquisition settings.
  3. Choose Welch averaging for smoother PSD estimates, or Periodogram for a single-shot estimate.
  4. Select a window to control leakage and resolution tradeoffs.
  5. Optionally set min and max frequency to focus the output.
  6. Press Calculate. The result appears above the form.
  7. Use Download CSV or Download PDF for reporting.

Example data table

Example series is a noisy sine-like signal sampled at 1000 Hz.
Sample index Value
00.12
10.58
20.95
30.66
40.05
5-0.61
6-0.92
7-0.49
Spectral density article

1) What spectral density represents

Spectral density shows how a signal's mean-square value is distributed across frequency. If your input is volts, the output is V^2/Hz; for acceleration it becomes (m/s^2)^2/Hz. Integrating the density over a band estimates band-limited power for noise, vibration, and communications work.

2) Periodogram vs Welch averaging

A periodogram uses one transform of the full record and provides the finest frequency spacing, but it can be noisy because the variance is high. Welch averaging divides the record into overlapping segments and averages their periodograms. In practice, Welch produces a smoother estimate and more stable peaks for real-world measurements.

3) Sampling rate and frequency resolution

The sampling rate Fs sets the frequency axis and the Nyquist limit at Fs/2 for one-sided results. The bin spacing is approximately df = Fs/N for a periodogram and df = Fs/L for Welch segments of length L. Larger N or L improves resolution but requires longer records.

4) Window choice and leakage control

Windowing reduces spectral leakage when the record does not contain an integer number of cycles. Hann and Hamming are common defaults that suppress sidelobes while keeping reasonable resolution. Blackman increases sidelobe suppression further, at the cost of wider mainlobes. Rectangular offers maximum resolution but the most leakage.

5) Detrending, DC components, and drift

Removing the mean is often essential because a nonzero DC level can dominate the first bins and mask nearby low frequency features. For sensors that drift, mean removal is a quick first step. If the trend is stronger, consider preprocessing with a higher-order detrend outside the calculator.

6) Segment length, overlap, and variance

In Welch estimation, segment length controls the tradeoff between frequency resolution and averaging. Shorter segments give more averages (lower variance) but coarser bins. Overlap improves efficiency; 50% overlap is a widely used default.

7) Interpreting peak bins and bandwidth

The reported peak frequency is the bin where the density is maximal within your selected range. For narrowband tones, the true frequency may lie between bins, and leakage can spread energy into neighbors. For noise bands, integrate or average bins across the bandwidth rather than relying on a single peak.

8) Reporting, exports, and reproducibility

Consistent reporting requires documenting Fs, window type, spectrum sides, detrending, and Welch settings. Use min and max frequency filters to focus the table on the band of interest. Export CSV for plotting and audits, or export PDF for quick sharing.

FAQs

1) What is the difference between power spectrum and power spectral density?

A power spectrum reports power per frequency bin, while a spectral density reports power per hertz. Density is more comparable across different record lengths and frequency resolutions.

2) Why do one-sided results appear larger?

For real signals, negative-frequency content mirrors positive frequencies. One-sided output folds the spectrum and doubles non-DC bins so that total power remains consistent.

3) Which window should I start with?

Hann is a strong general-purpose default. Use Hamming for slightly different sidelobe behavior, or Blackman when leakage suppression matters more than sharp frequency separation.

4) How should I pick Welch segment length?

Choose a segment length that gives the resolution you need: df = Fs/L. If peaks are unstable, shorten L to increase averaging, then check whether the coarser df is acceptable.

5) What overlap percentage is typical?

Around 50% overlap is commonly used. Higher overlap can smooth estimates further but increases computation. Keep overlap below 100% so segments still advance.

6) Why does removing the mean change my low-frequency bins?

A DC offset concentrates energy at 0 Hz and leaks into nearby bins through windowing and finite record length. Mean removal reduces that dominance and reveals genuine low-frequency structure.

7) Can I compare PSDs from different recordings?

Yes, if you use consistent settings and units. Keep Fs correct, use the same sides and window, and document Welch parameters. Density units per hertz make cross-record comparisons meaningful.

Related Calculators

Optical bench alignmentLaser beam profilerM squared estimatorLens focal lengthThin lens equationThick lens solverRefractive index finderEtalon finesse calculatorMichelson path differenceSpectrometer wavelength calibration

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.