Saturday, August 3, 2019

discrete signals - Removing values from FFT result same as filtering?



I don't quite understand why the textbooks say it is impossible to implement an ideal low pass filter.


If I was to take the FFT of a discrete signal x[n], with Matlab's fft function I'd be returned with a complex sequence X[n] which represents the magnitude of each frequency from 0 to n/2 and is repeated. If I was to then say simply make all the lower frequency bins equal to zero and keep the remaining the same aren't I applying an ideal low pass filter. I am excluding all the frequencies I don't want and keeping the ones I do.


For example say I have the signal belowenter image description here


This is the fft, with the lower frequencies towards the ends.


enter image description hereenter image description here


I selectively remove the bins I do not want and keep the ones I do, note I don't actually have Matlab all the images are from a html page.



Answer



If you only have a finite number of samples and are using a finite length FFT, then you will end up with a finite number of FFT frequency result bins. Each bin has a one-to-one relationship ONLY with frequencies that are exactly integer periodic in the FFT length. Any other spectrum frequencies that are not exactly periodic in the FFT aperture will not have that one-to-one relationship, but instead will have their energy spattered across the entire FFT result (a sampled periodic Sinc or Dirichlet function). Thus, zero-ing just the nearest neighbor frequency bin will not have the effect you think.


Zero-ing a bin is the same as adding an exactly periodic sinusoid of the same magnitude but of the opposite phase. If what you are trying to filter out is spectrum of a very slightly different frequency from that of the bin center, then instead of zero-ing it out by exact cancellation, the result will be an added beat pattern. Which is not the same as (FIR, IIR) filtering.


ADDED (in regards to ideal filtering) :



The basis vectors of a DFT are all orthogonal to one another. Any other sinusoid (non-periodic-in-aperture) will be orthogonal to none of the basis vectors. Which means it that that sinusoid will be represented, or have some energy end up in every DFT bin (because of not being orthogonal to any bin).


Therefore no subset of all the bins (a sequence of lower FFT/DFT bins for example) can exactly represent that signal. Therefore zero-ing only a sequence of lower bins in an attempt to create a canceling signal will be imperfect, or non-ideal for that signal. Thus a filter created by such a method cannot be ideal.


One might be able to get close for a signal near the center of a large sequence of filter bins. But not for a signal near the edges of any sequence of bins, as a large portion of the signal's energy will be represented by those bins just outside the sharp edge of the filter rectangle.


No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...