I would like to know if I need to multiply the result of PWELCH by "norm(w)^2/sum(w)^2", where w is the window vector? Also, I would like to know if the old function PSD can be used together with "norm(w)^2/sum(w)^2" to get the unbiased estimation of the power spectral density.
Kshitij Singh answered .
2025-11-20
pxx = pwelch(x) returns the power spectral density (PSD) estimate, pxx, of the input signal, x, found using Welch's overlapped segment averaging estimator. When x is a vector, it is treated as a single channel. When x is a matrix, the PSD is computed independently for each column and stored in the corresponding column of pxx. If x is real-valued, pxx is a one-sided PSD estimate. If x is complex-valued, pxx is a two-sided PSD estimate. By default, x is divided into the longest possible segments to obtain as close to but not exceed 8 segments with 50% overlap. Each segment is windowed with a Hamming window. The modified periodograms are averaged to obtain the PSD estimate. If you cannot divide the length of x exactly into an integer number of segments with 50% overlap, x is truncated accordingly.Obtain the Welch PSD estimate of an input signal consisting of a discrete-time sinusoid with an angular frequency of π/4 rad/sample with additive N(0,1) white noise.
Create a sine wave with an angular frequency of π/4 rad/sample with additive N(0,1) white noise. Reset the random number generator for reproducible results. The signal has a length Nx=320 samples.
rng default n = 0:319; x = cos(pi/4*n)+randn(size(n));
Obtain the Welch PSD estimate using the default Hamming window and DFT length. The default segment length is 71 samples and the DFT length is the 256 points yielding a frequency resolution of 2π/256 rad/sample. Because the signal is real-valued, the periodogram is one-sided and there are 256/2+1 points. Plot the Welch PSD estimate.
pxx = pwelch(x); pwelch(x)