retrieve phase information using 'pspectrum'
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sören Gevaert
el 2 de Ag. de 2020
Respondida: Star Strider
el 2 de Ag. de 2020
Hi
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!
kind regards
0 comentarios
Respuesta aceptada
Star Strider
el 2 de Ag. de 2020
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.
0 comentarios
Más respuestas (1)
Thiago Henrique Gomes Lobato
el 2 de Ag. de 2020
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.
1 comentario
Ver también
Categorías
Más información sobre Detection en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!