> This is probably a stupid question but, well, I'm not all that smart...
>=20
> Instead of going through all the trouble of designing complicated digital
> filters, why don't we just pick the frequencies that we want to supress a=

>
>"bmh161" <bmh161@yahoo.com> a �crit dans le message de
>news: -9CdnboVQ4Mya0DUnZ2dnUVZ_vednZ2d@giganews.com...
>> This is probably a stupid question but, well, I'm not all that smart...
>>
>> Instead of going through all the trouble of designing complicated digital
>> filters, why don't we just pick the frequencies that we want to supress
>> and
>> replace those bins in the FFT with zeros?
>>
>
>Doing what you propose (FFT of the signal, multiplying with a frequency
>mask, IFFT) gives EXACTLY the same result mathematically speaking than a FIR
>filter, its just another way to calculate it. In a nutshell :

[snipped by Lyons]
Hi Robert,
are you sure about that? Let's say I have a
1024-sample time sequence on which I perform a 1024-pt
FFT. Next, I zero-out the FFT bins (samples) for the
freqs I want to attenuate. Finally I perform a 1024-pt
inverse FFT. My resultant "filtered" time sequence
is 1024 samples in length (just as was the original
time sequence).
Now ...what kind of time-domain digital filtering can
I perform on the original 1024-sample time sequence
where the filter output sequence is EXACTLY the same
1024 samples as the above freq-domain filtering output?
I believe the answer is: "There *IS* no such time-domain
digital filter."
As far as I know, the freq-domain filtering I discussed in
my first paragraph above is equivalent to time-domain circular
convolution, and time-domain filtering does
not perform circular convolution.
Robert, if I'm mistaken, then I'd sure like to
know about it.
See Ya',
[-Rick-]

>On 10 Apr, 02:17, Rick Lyons <R.Lyons@_BOGUS_ieee.org> wrote:
>> On Thu, 09 Apr 2009 08:22:55 -0500, "bmh161" <bmh...@yahoo.com> wrote:
>
>> >Instead of going through all the trouble of designing complicated digital
>> >filters, why don't we just pick the frequencies that we want to supress and
>> >replace those bins in the FFT with zeros?
>...
>> �I just wanted to say that
>> your question is sensible and that we, the DSP guys here,
>> should investigate the process of freq-domain filtering
>> in detail
>
>Rick, did we read the same post? The question is not why
>frequency domain filtering is a bad idea, but why one doesn't
>use the naive, 'obvious' specs for the filters. I commented on
>a similar question not too long ago:
>
>http://groups.google.no/group/comp.dsp/msg/2d4bd5dfb25b5a23
>
>Such questions are covered in most DSP texts - I wouldn't be
>surprised if you touched on the subject already. If not, the issue
>might be worth half a page's comments in your 3rd edition, as
>your book is the first entry point into DSP for lots of users.
>
>Teachning students how to think 'right' is an admirable (and
>difficult!) task; warning against how to think 'wrong' can only
>help the effort.
>
>Rune

Hi Rune,
Oh shoot. Maybe I misunderstood the poster's
question. For whatever reason, I thought he was
asking: "Can we perform an N-point FFT on an N-point
time sequence, zero-out the spectral components
that we wish to attenuate, and then perform an
N-point inverse FFT to obtain a "filtered"
time-domain sequence.
If the original poster was asking about ways to
design a time-domain digital filter, then I
completely missed the point of his question.
(That wouldn't be the first time for me.)
[-Rick-]
PS. Rune, I wish you "calm seas."

Reply by Vladimir Vassilevsky●April 19, 20092009-04-19

glen herrmannsfeldt wrote:

> Well, say you FFT one track on a CD, maybe five minutes.
> (So not a Mahler symphony, for example.)
>
> Five minutes is 5*60*44100 samples, or 13230000 samples.
> FFT is O(N logN), so it shouldn't take all that long on most
> current machines. The bin spacing is then 1/(5 minutes) or
> about 0.00333 Hz.

FFT with the size of up to ~100M points is no problem as it takes
~minutes on PC. However beware of the numeric artifacts.

> In FFT terms, the signal is periodic. Even if you don't believe
> that, the quantization noise will be enough that you can't
> detect frequencies closer than 0.00333Hz, anyway, in a 5 minute
> signal.

This is not so obvious to me. Can you justify that.

> Interesting question for those building 60Hz notch filters,
> how accurate is the power line frequency over short time scales?
> Is it better than 0.00333Hz?

According to my measurements, the short term accuracy of AC frequency is
about 1e-4. But the fluctiation of the waveform sets the limit to the
usefulness of the comb filters before the frequency instability comes
into play.
Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com

Reply by glen herrmannsfeldt●April 19, 20092009-04-19

a@b.com wrote:
(snip, I wrote)

>>If you take the FFT on a signal that is at least as long as
>>the source, there are no in between bins. However, FFT

> Could you give a practical numerical example, or more detail about
> what you mean here? I guess that's different then when all
> frequencies of the sampled signal are an integer multiple of the bin
> size (so fall exactly on an FFT bin).

Well, say you FFT one track on a CD, maybe five minutes.
(So not a Mahler symphony, for example.)
Five minutes is 5*60*44100 samples, or 13230000 samples.
FFT is O(N logN), so it shouldn't take all that long on most
current machines. The bin spacing is then 1/(5 minutes) or
about 0.00333 Hz.
In FFT terms, the signal is periodic. Even if you don't believe
that, the quantization noise will be enough that you can't
detect frequencies closer than 0.00333Hz, anyway, in a 5 minute
signal.
Interesting question for those building 60Hz notch filters,
how accurate is the power line frequency over short time scales?
Is it better than 0.00333Hz?
-- glen

>Greg Berchin <gberchin@comicast.net.invalid> wrote:
>(snip on filtering using FFT)
>
>> 1. You're falling into the classic "if I just zero the appropriate FFT
>> bins, I'll have a perfect lowpass/bandpass/highpass/whateverpass
>> filter" trap. Consider what happens in-between FFT bins -- you have
>> no control over frequencies that do not correspond to FFT bins, and
>> they will not automatically be zero just because the adjacent FFT bins
>> are zero. If you FFT longer and longer time signals in order to be
>> able to explicitly zero more and more of those in-between frequencies,
>> eventually you will realize that you have to FFT an infinitely long
>> time signal in order to actually accomplish what you desire.
>
>If you take the FFT on a signal that is at least as long as
>the source, there are no in between bins. However, FFT

Could you give a practical numerical example, or more detail about
what you mean here? I guess that's different then when all
frequencies of the sampled signal are an integer multiple of the bin
size (so fall exactly on an FFT bin).

Reply by zzbu...@netscape.net●April 17, 20092009-04-17

On Apr 9, 9:22�am, "bmh161" <bmh...@yahoo.com> wrote:

> This is probably a stupid question but, well, I'm not all that smart...
>
> Instead of going through all the trouble of designing complicated digital
> filters, why don't we just pick the frequencies that we want to supress and
> replace those bins in the FFT with zeros?

Well, that's just a particular type of filter called a notch.
It's not that it doesn't work, it just has so many overused strange
side effects,
it's one of the reasons Optical Computers, Fiber Optics
Signalling,
Holograms, HDTV, CD, and DVD were invented.

Reply by Randy Yates●April 14, 20092009-04-14

"hariharan.gk" <hariharan1983@yahoo.com> writes:

> I believe MIPS is also a concern when you do FFT/IFFT just for

> filtering.
MIPS are less than time-domain convolution - that's really the
reason we use it.
--
% Randy Yates % "With time with what you've learned,
%% Fuquay-Varina, NC % they'll kiss the ground you walk
%%% 919-577-9882 % upon."
%%%% <yates@ieee.org> % '21st Century Man', *Time*, ELO
http://www.digitalsignallabs.com

Reply by hariharan.gk●April 14, 20092009-04-14

I believe MIPS is also a concern when you do FFT/IFFT just for filtering.

Reply by foxcob●April 13, 20092009-04-13

>>This is probably a stupid question but, well, I'm not all that smart...
>>
>>Instead of going through all the trouble of designing complicated
>digital
>>filters, 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.
>

Others have already mentioned some of the problems with the method you
describe. One approach to implementing a filter this way is to use the
window method of FIR design without ever working in the time domain. With
the window method, the desired frequency response is plugged into the
appropriate FFT bins. A brick wall filter would be typical (zeroing many
FFT bins). The iFFT is then taken to create the impulse response of the
desired length and the result is then multiplied by a window function (see
Kaiser, Von Hann, Hamming, etc). This impulse response is the coefficients
for your FIR filter.
However, since multiplication in the time domain is synonymous with
convolution in the frequency domain, you can take your original FFT bin
values, and convolve them with the frequency response of the desired window
function. You should be able to adapt this to a overlap-add implementation
.
I'm pretty sure this works correctly, but you should investigate and work
it out for yourself. This is just coming off the top of my head and may
have oversights or just plain gross errors...
Jacob