DSPRelated.com
Forums

FIR Filter limitation (or not?)

Started by rover8898 November 25, 2005
Hello,

I am quite new to the field of digital FIR filters (I always worked
with the old-fashionned analog ones, but I digress).
There is an important aspect to FIR filters that eludes me:
   A low pass digital FIR filter filters out all frequencies in the
stopband (to the set attenuation). This is quite obvious. Now what
remains unclear to me is that if the digital filter can only recover
sucessfully frequencies up to Fs/2 (Fs=sampling frequency), in order to
either filter them if they lie in the stopband or let them pass if they
lie in the passband, does it (the digital FIR filter) also filter out
frequencies above Fs/2 (since they lie in the stopband)? Or, are the
frequency components of above Fs/2 of the input signal not filtered,
but rather emulate something akin to "noise". Basically, if a digital
FIR lowpass filter can only filter out frequencies up to Fs/2, it would
imply that an a simple [20dB/dec lowpass analog filter] would be able
to filter frequencies that a [-100dB FIR lowpass filter with Fs/Fc=1.1]
would not be able to. This seems quite odd as all litterature indicates
that digital FIR filters far out-perform analog filters. Also, if
digital filters (lp, hp, bp, bs) have a severe limitation to their
upper-frequency-of-proper-operation, it would mean that all digital
filters require an analog lowpass filter at their input that can be
tunned on the fly w.r.t Fs, as to remove the frequency components above
Fs/2 prior to the digital filtering. This seems highly unlikely.
What am I not undestanding properly?

Thanks in advance,
-Roger

rover8898 wrote:
> Hello, > > I am quite new to the field of digital FIR filters (I always worked > with the old-fashionned analog ones, but I digress). > There is an important aspect to FIR filters that eludes me: > A low pass digital FIR filter filters out all frequencies in the > stopband (to the set attenuation). This is quite obvious. Now what > remains unclear to me is that if the digital filter can only recover > sucessfully frequencies up to Fs/2 (Fs=sampling frequency), in order to > either filter them if they lie in the stopband or let them pass if they > lie in the passband, does it (the digital FIR filter) also filter out > frequencies above Fs/2 (since they lie in the stopband)? Or, are the > frequency components of above Fs/2 of the input signal not filtered, > but rather emulate something akin to "noise". Basically, if a digital > FIR lowpass filter can only filter out frequencies up to Fs/2, it would > imply that an a simple [20dB/dec lowpass analog filter] would be able > to filter frequencies that a [-100dB FIR lowpass filter with Fs/Fc=1.1] > would not be able to. This seems quite odd as all litterature indicates > that digital FIR filters far out-perform analog filters. Also, if > digital filters (lp, hp, bp, bs) have a severe limitation to their > upper-frequency-of-proper-operation, it would mean that all digital > filters require an analog lowpass filter at their input that can be > tunned on the fly w.r.t Fs, as to remove the frequency components above > Fs/2 prior to the digital filtering. This seems highly unlikely. > What am I not undestanding properly?
There are no frequencies above Fs/2. Any in the original signal should have been filtered out (with the analog filters that you're familiar with) before sampling took place, and any that remain will be aliased (folded back) around Fs/2. As far as the math describing filter operation (and sampled signals in general) goes, the frequency universe is closed and finite. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
rover8898 wrote:
> Hello, > > I am quite new to the field of digital FIR filters (I always worked > with the old-fashionned analog ones, but I digress). > There is an important aspect to FIR filters that eludes me: > A low pass digital FIR filter filters out all frequencies in the > stopband (to the set attenuation). This is quite obvious. Now what > remains unclear to me is that if the digital filter can only recover > sucessfully frequencies up to Fs/2 (Fs=sampling frequency), in order to > either filter them if they lie in the stopband or let them pass if they > lie in the passband, does it (the digital FIR filter) also filter out > frequencies above Fs/2 (since they lie in the stopband)?
No, it doesn't. They have been already filtered out. A *digital signal* has only components in the range -Fs/2 to +Fs/2, or rather, in the angular frequency range -pi to +pi. The above is independent of anything else -- samples at a rate of Fs represents one (and only one) signal with bandlimited spectrum; if you sample a signal with wider bandwidth, then you obtain *a different* signal (or, a digital signal that represents a different continuous-time signal) Or, are the
> frequency components of above Fs/2 of the input signal not filtered, > but rather emulate something akin to "noise". Basically, if a digital > FIR lowpass filter can only filter out frequencies up to Fs/2, it would > imply that an a simple [20dB/dec lowpass analog filter]
Digital filters don't really work on a 20dB/dec basis -- it's completely different with digital filters (well, not completely)
> to filter frequencies that a [-100dB FIR lowpass filter with Fs/Fc=1.1] > would not be able to. This seems quite odd as all litterature indicates > that digital FIR filters far out-perform analog filters.
Well they do (arguably, at least) -- they do give you a better control, much better precision, as you don't rely on the precision of physical properties that are affected by the environment (such as temperature), and that have a *huge* variance. Digital filters work with numbers and high-precision clock signals -- the result is a "virtually absolute* precision in the filtering itself. But as everything in engineering/technology: there is no magic silver bullet that is perfect in every regard. Digital filters do suffer from certain "limitations" when compared to analog filters; one could safely argue that the advantages of digital filters *far* outweight the disadvantages.
> digital filters (lp, hp, bp, bs) have a severe limitation to their > upper-frequency-of-proper-operation, it would mean that all digital > filters require an analog lowpass filter at their input that can be > tunned on the fly w.r.t Fs, as to remove the frequency components above > Fs/2 prior to the digital filtering. This seems highly unlikely.
It's not the digital filters -- it's the digitizing process of an analog signal what requires this filtering; it's not always done with analog signals; some times it's easier to sample the signal at a far higher rate, then apply a digital low-pass filter, and then "sample" the resulting signal (since it is already in the digital domain, we're talking simply about keeping one every N samples, or "downsample" by a factor of N)
> What am I not undestanding properly?
Perhaps you need to better visualize how *discrete-time signals* work; how does the spectral repersentation works with these signals, and how that relates to the spectral representation of analog signals. It seems like your difficulties all lead back to these issues. HTH, Carlos --
"rover8898" <rover8898@hotmail.com> wrote in message 
news:1132944801.814391.106900@g43g2000cwa.googlegroups.com...
> Hello, > > I am quite new to the field of digital FIR filters (I always worked > with the old-fashionned analog ones, but I digress). > There is an important aspect to FIR filters that eludes me: > A low pass digital FIR filter filters out all frequencies in the > stopband (to the set attenuation). This is quite obvious. Now what > remains unclear to me is that if the digital filter can only recover > sucessfully frequencies up to Fs/2 (Fs=sampling frequency), in order to > either filter them if they lie in the stopband or let them pass if they > lie in the passband, does it (the digital FIR filter) also filter out > frequencies above Fs/2 (since they lie in the stopband)? Or, are the > frequency components of above Fs/2 of the input signal not filtered, > but rather emulate something akin to "noise". Basically, if a digital > FIR lowpass filter can only filter out frequencies up to Fs/2, it would > imply that an a simple [20dB/dec lowpass analog filter] would be able > to filter frequencies that a [-100dB FIR lowpass filter with Fs/Fc=1.1] > would not be able to. This seems quite odd as all litterature indicates > that digital FIR filters far out-perform analog filters. Also, if > digital filters (lp, hp, bp, bs) have a severe limitation to their > upper-frequency-of-proper-operation, it would mean that all digital > filters require an analog lowpass filter at their input that can be > tunned on the fly w.r.t Fs, as to remove the frequency components above > Fs/2 prior to the digital filtering. This seems highly unlikely. > What am I not undestanding properly? > > Thanks in advance, > -Roger
Roger, When a signal is sampled, its Fourier Transform becomes periodic at the sampling frequency. Start with a continuous signal with bandwidth practically less than B. The signal will have a Fourier Transform with the following properties: The even part of the signal will have a transform that is real and even. The odd part of the signal will have a transform that is odd and imaginary. Both parts will be effectively zero at outside the range -B to +B. The real part mirrors at zero because it's even. The imaginary part mirrors and reverses sign at zero because it's odd. Now, sample this signal: When it's sampled, the Fourier Transform above repeats at fs, -fs, 2fs, -2fs, ..... That is, it becomes periodic with period fs. So, you can see if B is greater than fs/2 that sampling (and the periodicity in frequency it causes) will cause the repeating spectra to overlap and superimpose - which creates ambiguity or aliasing. Note that I although the time sequence is sampled, I have not sampled the Fourier Transform here - it is not a Discrete Fourier Transform. I've kept it continuous for purposes of discussion and because that seems in order with the questions you're asking. Because of the periodicity in the Fourier Transform of any signal, it gives the appearance that the underlying signal has a bandwidth that is limited to fs/2. Taking the inverse (continuous) transform can be done with an inverse computation of a Fourier Series - yielding an infinite set of discrete coefficients. Doing an infinite summation type of Fourier Transform will yield the same result. Accordingly, there are no apparent components that exist outside the interval -fs/2 to fs/2 because the frequency information just repeats ... and repeats. We treat the frequency response of a FIR filter in pretty much the same way. The frequency response is periodic, repeating at intervals of 1/T, the reciprocal of the unit delay of the filter - which is very often also taken as fs. Accordingly, the stop band is *not defined* outside -fs/2 to fs/2. In fact, it repeats so the response at fs/2 - delta is the same as the response at -fs/2 - delta and the magnitude response at fs/2 - delta is the same as the magnitude response at fs/2 + delta (where delta < fs/2). You can't have a lowpass filter with Fs/Fc=1.1. Fc has to be less than fs/2 and probably not much beyond 0.4fs to make reasonable sense. So fs/fc > 2.x
>it would mean that all digital > filters require an analog lowpass filter at their input that can be > tunned on the fly w.r.t Fs, as to remove the frequency components above > Fs/2 prior to the digital filtering.
Not exactly. Samplers require the application of an effective analog lowpass filter ahead of the sampler to avoid aliasing / ambiguity in the Fourier Transform. Most samplers are at a fixed frequency so there isn't generally an "on the fly" requirement. After the sampling takes place, there are samples which can be put into a digital filter without further concern for antialiasing filtering - unless one is engaged in sample rate changes / multirate dsp. To answer your practical question about frequency content above fs/2: Yes, in the real world the pre-sampler filter won't be perfect and there will be some components of the signal that alias into [-fs/2 to fs/2] from above fs/2. You may consider these to be "noise" or have some other treatment for them..... The job of the pre-sampler filter is to make them acceptably small. Fred
1) Frequencies above Fs/2 will appear, aliased to other frequencies.

Uusally an antialias filter is used - this MUST be analog, and should
filter out all frequencies above Fs/2 so that they are not a problem.
But in undersampling, you can have a high frequency signal (ie above
Fs/2) that aliases, to a known alias) frequency, and can work on that
quite comfortably. Provided only that the signal has no two frequencies
whose aliases are the same, and that your sample/hold is fast enough to
not itself act as a lowpass filter.

2) I find it unhelpful when people say that 'digital filters are
superior' etc. It depends on your criteria. FIR filters can guarantee
linear phase. Certain types of FIR filter can guarantee to be (almost,
probably) the closest match to what you desire by some meaure (eg LMS).
But sometimes you don't want that.

Try the RIEE analog filters (for gramophones) implemented with a
digital filter - analog ones are often specified with extremely sharp
rolloffs that are really hard to get with digital.

3) Yes, all digital filters that work on signals that come from the
analog world do requir an analog filter at their front end, that
antialiases. You can sometimes sample very much faster than you really
need to, so relaxing the requirements on that analog filter, but you
can't do away with it. And yes, if the digital filter changes its
sample rate then the analog filter should do too. Unless you were
sampling very fast, in which case you amy not care.

Chris
=========================
Chris Bore
BORES Signal Processing
www.bores.com

chris_bore@yahoo.co.uk wrote:

   ...

> Try the RIEE analog filters (for gramophones) implemented with a > digital filter - analog ones are often specified with extremely sharp > rolloffs that are really hard to get with digital.
What is RIEE? I know what RIAA is, and the recording compensation curve specified in its name is intended to be minimum phase, best implemented by two R-C time constants. .... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Hello,

>It's not the digital filters -- it's the digitizing process of an >analog signal what requires this filtering; it's not always done >with analog signals; some times it's easier to sample the signal >at a far higher rate, then apply a digital low-pass filter, and >then "sample" the resulting signal (since it is already in the >digital domain, we're talking simply about keeping one every N >samples, or "downsample" by a factor of N)
The filtering can be done with a [oversampling at higher sample rate] + [digital low pass filter] +[downsampling] scheme, I guess. But if the input signal (prior to A/D) has frequency components beyond the [oversampling rate/2] threshold, then there will aliasing, digital lowpass filter or not. Is there a reason why a precautionary ~broad analog filter cannot be placed ahead of the A/D (aside from cost and maybe gadget size) ? -Roger
rover8898 wrote:
> Hello, > > >>It's not the digital filters -- it's the digitizing process of an >>analog signal what requires this filtering; it's not always done >>with analog signals; some times it's easier to sample the signal >>at a far higher rate, then apply a digital low-pass filter, and >>then "sample" the resulting signal (since it is already in the >>digital domain, we're talking simply about keeping one every N >>samples, or "downsample" by a factor of N) > > > The filtering can be done with a [oversampling at higher sample rate] + > [digital low pass filter] +[downsampling] scheme, I guess. But if the > input signal (prior to A/D) has frequency components beyond the > [oversampling rate/2] threshold, then there will aliasing, digital > lowpass filter or not. Is there a reason why a precautionary ~broad > analog filter cannot be placed ahead of the A/D (aside from cost and > maybe gadget size) ?
Aliasing from frequencies above the [oversampling rate/2] threshold won't hurt if the aliases are above the downsampled Fs/2, as those will be removed by the digital downsampling (decimation) filter. A "precautionary ~broad analog filter" should be placed ahead of the A.D in most cases. In Servo work, delay is often more harmful than aliasing, so the antialias filter is omitted. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Hello everyone,

OK. So I got the point that the response of a digital filter just
repeats itself at a period of Fs. Also it seems that a digital signal
has only frequency components from -Fs/2 to +Fs/2. If I undestood
correctly, this is because all signals when digitized, are, in the
frequency domain a series of the frequency spectrum of the undigitized
signal interspaced at intervals of Fs. Depending on the bandwidth of
the undigitized signal and the Fs, absence or presence of aliasing will
be determined.

So basically, if aliasing occurs, the *digital signal* (-Fs/2 to +Fs/2)
 will have frequency components of the original signal that are above
Fs/2. That is where those unwanted "high frequencies" end up; they
double back in the relevant [-Fs/2 to +Fs/2] frequency range if there
is aliasing .If there isn't any aliasing, it implies that the input
signal was already properly cleaned up. And if the input signal
contains frequencies components up to Fbw, and we decide to sample the
input signal  at Fbw/10  because 95% of the relevant signal lies under
Fbw/30, we would be commiting a huge no-no for the frequency components
from [Fbw/20 to Fbw] will fold back and corrupt the retrieved data,
despite these components being quite weak in strength.Rigth ?

A low pass digital FIR filter whose [Fpassband=0.45*Fs and
Fstopband=0.47*Fs] serves no practical purpose if its purpose for being
is to attenuate high frequencies. Right?
It will supress only 6-10% of the input frequencies (depending on the
transitions bands). In other words:
the [0-0.45 0.55-1.45 1.55-2.45 2.55-3.45....]*Fs frequencies of the
undigitized input signal will pass unhindered through the digital
lowpass FIR filter. It certaintly not a viable antialiasing filter.
Rigth? 

-Roger

"rover8898" <rover8898@hotmail.com> wrote in message 
news:1133216698.967625.187630@g47g2000cwa.googlegroups.com...
> Hello everyone, > > OK. So I got the point that the response of a digital filter just > repeats itself at a period of Fs. Also it seems that a digital signal > has only frequency components from -Fs/2 to +Fs/2. If I undestood > correctly, this is because all signals when digitized, are, in the > frequency domain a series of the frequency spectrum of the undigitized > signal interspaced at intervals of Fs. Depending on the bandwidth of > the undigitized signal and the Fs, absence or presence of aliasing will > be determined. > > So basically, if aliasing occurs, the *digital signal* (-Fs/2 to +Fs/2) > will have frequency components of the original signal that are above > Fs/2. That is where those unwanted "high frequencies" end up; they > double back in the relevant [-Fs/2 to +Fs/2] frequency range if there > is aliasing .If there isn't any aliasing, it implies that the input > signal was already properly cleaned up. And if the input signal > contains frequencies components up to Fbw, and we decide to sample the > input signal at Fbw/10 because 95% of the relevant signal lies under > Fbw/30, we would be commiting a huge no-no for the frequency components > from [Fbw/20 to Fbw] will fold back and corrupt the retrieved data, > despite these components being quite weak in strength.Rigth ? > > A low pass digital FIR filter whose [Fpassband=0.45*Fs and > Fstopband=0.47*Fs] serves no practical purpose if its purpose for being > is to attenuate high frequencies. Right? > It will supress only 6-10% of the input frequencies (depending on the > transitions bands). In other words: > the [0-0.45 0.55-1.45 1.55-2.45 2.55-3.45....]*Fs frequencies of the > undigitized input signal will pass unhindered through the digital > lowpass FIR filter. It certaintly not a viable antialiasing filter. > Rigth? > > -Roger
Right. Good study. The antialiasing filtering needs to be done pre-sampling. If you're doing sample rate conversion, then you could well *also* need to do antialiasing filtering in the discrete time world - and *there* you use digital filters. Fred