Post by bmh161Post by bmh161This is probably a stupid question but, well, I'm not all that smart...
Instead of going through all the trouble of designing complicated
digital
Post by bmh161filters, why don't we just pick the frequencies that we want to
supress and replace those bins in the FFT with zeros?
Then, with the undesirable frequencies zeroed out, take the inverse
FFT to get back to the time domain.
You might want to consider both the resulting overall frequency response and
the signal to be processed. All of the general answers deal with the
overall frequency response - and that's a very good start. But, the signal
to be processed can make a difference as well.
Here are some observations, some repeated and others new to the thread:
1) You can see the frequency response you'll get by doing this:
a) put those zeros in, just as you'd suggested. I guess then you might be
putting 1's everywhere else or some such thing, eh?
b) IFFT the result (I don't think you have to append this sequence with
zeros before you IFFT - but I could be wrong here).
c) append the time sequence from the IFFT with a bunch of zeros.
d) FFT the result. This will be an interpolated version of the frequency
response. The zeros you put in there will still be there but now you'll be
able to see in between them and in between all of the original samples in
frequency. If it's a lowpass filter it will look like it's been convolved
with a sinc - which corresponds to a gate which has a width the same as the
non-zero length of the time sequence.
OK. So much for frequency response.
Now, let's say that you could create a filter with "brick wall" transitions
(yes, limited by the distance between frequency samples). Assume that you
apply such a filter to a signal. Assume that the signal:
Case 1) Has lots of energy at the transition points.
OR
Case 2) Has very little engergy at the transition points.
Now we have the opposite situation where the sharp transitions are in
frequency. The gate is in frequency. Accordingly, there will be sinc-like
convolution in the time domain. The shape of the filter transitions
controls this. Since you didn't control the shape of the frequency
transitions and made them as sharp as possible, there will be spreading or
leakage in the time domain sequence. Well, at least for Case 1.
For Case 2 there are no sharp transitions in the "output signal" in the
frequency domain just because there's no energy there. So, there's much
less spreading or leakage in the time domain sequence.
Example of the latter:
We want to interpolate in time.
We decide to do this by appending zeros in frequency (around the original
fs/2).
There are two ways to do it:
1) Repeat the spectral sequence so it's doubled in length and creates a new
fs that's 2X the old fs. So far, so good except there's a big hump of
energy at the new fs/2.
If we IFFT this now, with the input to the IFFT being periodic, every other
output sample will be zero and there will be no effective interpolation. To
get past this, we need to suppress all the energy around fs/2. We might
choose to use a half-band filter to do this.
2) Another approach is to mash all the energy around fs/2 with zeros -
effectively multiplying by a gate function. This is the approach you're
asking about. Here the transitions are at fs/4 and 3fs/4 which used to be
at fs/2 and -fs/2. Presumably the original signal was reasonably filtered
before sampling so that there's no (er... little) energy around those
points. So, there are no sharp transitions in the frequency sequence
introduced - thus no added leakage/spreading in time.
If we're really being picky and want to interpolate more than 2X then we
might use a half-band filter one time and then append zeros (same as
doubling the length and mashing with zeros) around current fs/2 up to the
desired interpolation factor of sample points. In doing this, less and less
energy is "forced" and much less and less sharp transitions occur.
Fred