FFT Spectrum or Welch Spectrum
Show older comments
Hello everybody, I wrote a windowing function with an average of FFt's and calculated the same with the Matlab function pwelch. The welch algorithm and the FFT spectra resulting in a marked different spectral plot. I could narrow down the problem: The single spectra calculated with the fft are the same for both versions, but then the welch algorithm (Line 132: [Pxx,w,units] = computepsd(Sxx,w,options.range,options.nfft,options.Fs,esttype);) calculates the power densitiy, which results in a different spectral appearance. Along with this spectral shift, I get also a small shift in the highest frequency peak (from 30.0 Hz to 29.5 Hz; both calucated with a resolution of 0.1 Hz). Any common eplanation for that? Due to the fact, that I'm looking for the main period of oscillation in my data, I'm puzzled which on will be the right one? I'm gratefull for any hlep. Thanks a lot!
Accepted Answer
More Answers (1)
Wayne King
on 17 Oct 2011
0 votes
The periodogram does not have to use next power of 2. Look at my example, I specified the length to be the length of the input vector. You can specify NFFT as an input argument.
Also, the Welch estimate does not discard the overlapping data points. You may lose some data at the end, but you can control that by adjusting the segment length and overlap.
For example, in my example I had an input of length 1000.
By specifying a window length of 200 and using the default noverlap of 50. The overlapped spectra were computed for
- 1:200
- 151:350
- 451:650
- 601:800
- 751:950
I could have easily adjusted the window length and overlap to utilize every single data point (but I don't think that buys you anything here)
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!