Why do results differ between pwelch and dsp.SpectrumEstimator?

2 views (last 30 days)
Why does the results differ when I obtain the welch spectrum using function pwelch and dsp.SpectrumEstimator object using a window?
 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Apr 2017
The 'window' property in 'pwelch' function specifies the length of segments which the signal gets divided into. Power spectrum is then calculated by taking the spectral averages of these segments. 
The 'dsp.SpectrumEstimator' object has a property 'Spectral Averages' which determines the number of spectral averages to be taken for the segmented signal. However, the object itself does not divide the signal into segments. Although, the underlying implementation of this object is through Welch Spectrum Estimate algorithm which requires the signal to be segmented, we have to manually implement the segmentation part of the signal and step these segments through the object.  
Please refer to the attached script which shows an example of correct usage of 'dsp.SpectrumEstimator' for computing the Welch Spectrum of a sinusoid signal. Please note, the parameters such as sampling frequency, length of fft, etc. are defined in the script.  

More Answers (0)

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!