"Spectrogram" - does it produce spectral amplitudes, or can it ONLY produce power spectral densities/amplitudes?

13 Ansichten (letzte 30 Tage)
Hello, and thank you in advance to anyone who can answer this -
I'm running "spectrogram" to try to obtain spectral amplitudes (NOT power spectral densities). The help page implies that the [S,F,T] = ... version of the function produces spectral amplitudes (by taking the STFT); however, one MATLAB answer that I came across (from 2016) says that the [S,F,T] = ...version produces power spectral densities instead. (I have read the help page and realize that different calls to the function do produce PSDs or power spectra estimates; I don't want those.) So, am I obtaining amplitude or power spectral values?
Thank you!
-Kathryn Dorn

Akzeptierte Antwort

Bjorn Gustavsson
Bjorn Gustavsson am 10 Mai 2019
In my version of matlab I have to go down halfway through the help text - which is very goog to read - to find_:
[S,F,T,P] = spectrogram(...) P is a matrix representing the Power
Spectral Density (PSD) of each segment.
So, in order to get the power spectral density you need to ask for the fourth output argument. Another way to find out is to look at what S is:
whos S
If that returns information that S is complex then it cannot be a PSD, which has to be real. Maybe it is possible to get a purely real S, but that seems difficult to achieve.
HTH
  1 Kommentar
Kathryn Dorn
Kathryn Dorn am 10 Mai 2019
Thank you! I did read that part of the help page, yes, and was fairly sure that the [S, F, T] option should only take the STFT (I don't want a PSD for this application), but then I ran into this -
- and have been wondering if the person who answered that question was just wrong, or if the function was doing something it wasn't supposed to. I'll try the "whos" function to doublecheck - thank you for that!
-Kathryn Dorn

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by