1
$\begingroup$

I have a simple $0-40 \texttt{Hz}$ IIR bandpass filter. With pure sine inputs I see $60 \,\texttt{Hz}$ is completely gone in the output FFT as expected by looking at the filter frequency response.

However I fed it with non sine signal+noise (i.e real world recorded signal), and I see the FFT shows a peak at $60 \,\texttt{Hz}$ . PSD though doesn't show any component at $60 \,\texttt{Hz}$ and it's flat zero.

I'm not sure how to interpret the FFT result. Why does the FFT have a peak where the PSD doesn't? enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

This is not a definitive answer because I think your question needs a little more detail (see last paragraph), but since this is too long to write as a "comment", I'll leave this here for now and edit if need be.


Welch's method to compute the PSD uses frequency averaging. It basically computes FFTs on successive overlapping segments, and average them all together to give an estimate of the input signal's frequency content.

With that in mind, I'm going to guess the following:

  • That your input signal has a strong $60\,\texttt{Hz}$ component locally (in time), but not throughout the whole signal. Because of that, the FFT, which looks at the signal in its entirety, picks up a small correlation with that component, but because the component only happens for a fraction of the whole signal, averaging all the FFTs results in that time-localized component to disappear in the PSD estimate.
  • As @DanBoschen pointed out in the comment, it's worth mentioning that the PSD is shown in linear scale, which increases its visual range dramatically. Convert to a log scale for better comparison with the FFT result.

I suggest looking at a time-frequency representation of your input signal (such as a spectrogram) to confirm this, and I'll edit this answer accordingly.

$\endgroup$
7
  • $\begingroup$ Thank you. Stop band attenuation is in excess of 60dB. That's why I'm puzzled. $\endgroup$
    – doubleE
    Commented Mar 13, 2023 at 17:53
  • 1
    $\begingroup$ That's good. Now what about my other guesses? How strong is the component before filtering, and is it localized in time? $\endgroup$
    – Jdip
    Commented Mar 13, 2023 at 17:58
  • $\begingroup$ Unfortunately I don't have that data. I can imagine it's very strong but I can't imagine it's only localized in a small window of time. $\endgroup$
    – doubleE
    Commented Mar 13, 2023 at 18:04
  • $\begingroup$ What do you mean you don't have that data? Can't you just disable the filter ? $\endgroup$
    – Jdip
    Commented Mar 13, 2023 at 18:05
  • $\begingroup$ I wonder if the Welch PSD as shown is in linear magnitude while the FFT is given in dB? That isn't clear from the plot. $\endgroup$ Commented Mar 14, 2023 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.