retrieve phase information using 'pspectrum'
17 次查看（过去 30 天）
Sören Gevaert ，2020-8-2
回答： Star Strider ，2020-8-2
Similar to the pwelch function, the function pspectrum divides the signal into overlapping components, windows each segment and averages the periodograms of the segments. This is very handy for signals with much noise(wich i have) and to suppress spurious components. As you can see below, left a normal fft and right using pspectrum. Pspectrum suppresses the spurious components a lot more than a normal fft.
The only problem is that: when calculating the fft you get a complex number wich you can calculate the amplitude and phase from with abs() and angle(). Using the pspectrum plot only gives you real values so you can only plot the amplitude. Is there a way so i can retrieve the complex numbers to also calculate the phase, or maybe alter the code from this psepctrum function? I really need the phase plot and because a normal fft gives bad results i need to use the pspectrum function. I also tried the pwelch function but without results. Any tips are welcome!
Star Strider 2020-8-2
If you use the bandpass filter approach in digital signal related question(fft,pspectrum) you can easily recover the phase information from the fft of the output.
Thiago Henrique Gomes Lobato 2020-8-2
Why you need the phase? The pspectrum function calculates the power spectrum, which depends on the absolute square of the fft, so it is not possible to get the phase back. An alternative to get a complex number would be to perform a similar algorithm averaging not the periodograms but rather the complex fft result for each block. With this, however, you probably won't have a so strong noise reduction.
Still, in your left plot the amplitudes are not in log scale, the fft resolution seems way higher, I can't exactly see a correspondence of peaks between both pictures and it is not clear what the different plots mean (different channels? Different blocks?), so, even though one may be more noisy, it is also possible that the main difference between the results is only aesthetics in relation to your goal, so before saying that one is better than other a clear definition of your goal is needed.
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!