Could someone tell me where it is that I might be going wrong with the following problem?
Ok, so I'm computing a spectrogram, and, trying to return the PDS of the signal (to show where the signal has the most energies) which I will then use in plotting the decibels.
In my approach, I multiply each of the frames by the Hanning window, perform FFT of the resulting blocks and then only take the first half of the result (resulting vector).
Finally, I take each of the blocks (computed by the STFT) and perform PSD.
The problem that I'm having is this:
The chart below illustrates the results that I'm getting using my own C++
code:
Whereas in Python
, using matplotlib
if I replicate this, then I get the following:
I can't understand where the "noise" is coming from. I can only think that it could be some periodic noise which could be due to little discontinuities at the start and at the end of each frame. But I don't know where I have gone wrong.
The NFFT = 256
hop size = 128
Thanks