What is the interpretation of this STFT diagram?

8 views (last 30 days)
This is a STFT diagram, I have got from my signal. I have used these command below:
figure(1)
stft(signals,500000,'Window',kaiser(256,5),'OverlapLength',220,'FFTLength',512);
My confusion arises because on the STFT diagram, I am seeing negetive magnitude -20DB. Usually on the examples of matlab central I have found all with positive magnitude and made senses to me. However, with my sample signal, I have go confused. the sampling frequency is 500000.
I have added the samplesignal.mat file for usage.
I will be really helpful if some one can guide me to understand what is going on over here.

Accepted Answer

Tanisha Gosain
Tanisha Gosain on 18 Jun 2020
The negative value is in dB scale. Linear to dB scale conversion is as follows:
-20dB in dB scale is in linear scale. I checked the maximum magnitude of your output after performing stft:
s = stft(signals,500000,'Window',kaiser(256,5),'OverlapLength',220,'FFTLength',512);
magnitude = abs(s);
maxVal = max(max(magnitude))
Stft on your sample data gives outputs with values less than 1 which converts to a negative value in dB scale.
In my opinion, you will get a positive value in dB only if output from stft contains magnitudes greater than 1.
You may refer to the screenshot attached for more details.
Here is the link to the documentation of the MATLAB stft function: https://in.mathworks.com/help/signal/ref/stft.html#mw_e8026896-e240-4a16-ac1f-24417c3722fe
  2 Comments
I'yaaz Kala
I'yaaz Kala on 26 Jun 2022
Edited: I'yaaz Kala on 26 Jun 2022
Hi,
According to example 4 and 5 within the 'stft.m' function-script - the function 'mag2db' is used to scale the 'pcolor' plot, which I assume is what happens when no output arguments are used when envoking the 'stft' function.
The relationship given in the help document for 'mag2db' is different from the one mentioned above, refer to the snip below:

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!