MATLAB: Gap in spectral analysis (Filter applied)

filterhighpass filterspectral analysis

The figure shows two plots using spectral analysis, the upper one is using original data and lower one is after applying highpass filter. Can anyone explains why there's gaps in the plot and what does it mean.

Best Answer

  • I suspect you are actually using a lowpass filter, then using fftshift on the fft output, although not adjusting the frequency axis to match it.
    The ’gaps’ are areas in the frequency domain where your signal is significantly attenuated, as it should be if the filter is operating correctly.
    Your Nyquist frequency appears to be 50, so the frequency axis should go from -50 to +50, not 0 to 100.