PSD - Spectrum analysis 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 &quot;noise&quot; 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
I'm a little confused by this statement given the previous one indicates you've already taken the FFT.


  Finally, I take each of the blocks (computed by the STFT) and perform PSD.


Generally the following is used; Seperate into frames (overlap if desired) -> apply window -> fft -> transform and scale into dB (if desired).

The scaling for a power spectrum or power spectral density can be a bit tricky at first, but this paper goes into some great detail about how to set it up.