I’m giving a timeseries vector with 14600 data points as an input to the “pwelch” function and getting 2049 data points as an output. I’m not sure how to assign these output points to specific frequencies, I need more info on how the averaging/binning works with this function?
John Williams answered .
2025-11-20
The pwelch function in MATLAB or Python's SciPy library is used to compute the Power Spectral Density (PSD) of a signal using the Welch method. This involves segmenting the signal into overlapping segments, windowing them, and then averaging their periodograms. The frequency bins assigned by pwelch are determined by the following factors:
pwelch uses the segment length as the FFT length unless otherwise specified.Here's how the frequency bins are determined in Python:
Here's how the frequency bins are determined in MATLAB:
Each frequency bin corresponds to a center frequency, and the bins are uniformly spaced over the range of 0 to fs/2f_s/2.