How to plot actual amplitude on the colorbar using STFT (spectrogram)
Mostrar comentarios más antiguos
I am using built in spectrogram function and it automatically plots the power/frequency (dB/Hz) values on the colorbar on the right.
Does anyone know how to plot actual amplitude/magnitude of a signal (A or V) on the colorbar using STFT (spectrogram)?
Thanks in advance,
3 comentarios
Asvin Kumar
el 11 de Mayo de 2021
I'm not really sure why you want to do that. Could you clarify your use case? That will help you get a better answer from the community.
The colorbar in the spectrogram corresponds to the values in the plot. And the values in the plot are derived from applying STFT on the time domain signal. So, these values are in the frequency domain. They're no longer in the time domain. It only makes sense for the colorbar to show power/frequency values.
Jan Ali
el 11 de Mayo de 2021
Asvin Kumar
el 12 de Mayo de 2021
I'm not sure if that's possible but I can say that replacing the colorbar range with Amplitude values would not be meaningful. That would be like comparing apples with oranges. This is because the plot that you get from spectrogram is actually information about the same signal in the frequency domain.
Power/frequency shows the amount of energy per unit time for each frequency. You might recall from Parseval's theorem that energy in time domain is equal to the energy in frequency domain. I would recommend reading more about Power Spectral Density (PSD) if that's confusing. Here's a wikipedia article to get you started: Spectral Density
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Multirate Signal Processing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!