Re: Getting started
- From: "Rune Allnor" <allnor@xxxxxxxxxxxx>
- Date: 30 Aug 2005 19:03:11 -0700
Gert Baars wrote:
> Hello,
>
> In order to start with DSP I want to learn how to design FIR filters.
> I have read that the procedure includes an inverse Fourier
> transformation from H(w) to h(n) of a filter. (I seem to remember the
> h(n) coefficients could be found by summing of terms but forgot the
> details) Can I find documents about such methods without having to buy
> expensive books.
You might, althouh I don't know of any such documents on the web.
If you are serious about learning DSP, check out
Lyons: "Understanding Digital Signal Processing"
Prentice-Hall, 2004.
> I already have made a moving-average FIR filter which works fine so also
> my platform works fine. Now I would like to know the methods of how to
> transform an H(w) (frequency domain) response of LPF,BPF and LPF to the
> coefficients (h0,h1....hn).
>
> Please let me know if you know how to obtain this information.
Hmmmm... I don't remember if Rick Lyons did include the window
method for FIR filter design in his book; if not, I can only
point to some higher-level textbook, so I don't.
You don't mention what method you use to design your filters.
I assume you have not implemented your own Remez exchange routine,
so here goes the method of windows that needs no IFFT:
The filter specification for a Low-Pass (LP) filter consists of
a number of parmeters:
- The pass-band cut-off frequenct fp
- The stop-band cut-off frequency fs
- The allowed ripple in the pass band
- The allowed gain in the stop-band
Note that for the window method, you have little control of
the latter two parameters. It is basically a matter of trial
and error to see which filters meet the spec.
Now, the transition band is the frequency interval <fp,fs>
where the frequency response is undefined. The rule of thumb
is that you need to be able to "squeeze" the main lobe of the
window function into this bandwidth. Since the width of the
main lobe is a function of the length of the window, you
compute the number of coefficents from the width of the transition
band. The actual formula for doing this, is empirical and varies
from window to window. Again, I have only seen these formulas
in the higher-level textbooks.
Now that you have decided on a filter length, you define the
"ideal filter" as
H(f) = 1 0 <= f < (fp+fs)/2
0 (fp+fs) < f <= 1/2
where the frequency f is normalized with respect to the sampling
frequency. This frequency-domain transfer function has a time-
domain impulse response that can be computed analytically, hence
you do not need to compute the IFFT.
Once you know the analytical expression for the time-domain
impulse response (it is of the type sin(2pi f)/(2pi f))
you just compute as many coefficients you need (as you found
from the transition band) and multiply each coefficient by the
corresponding window coefficient.
And voila, there's your filter.
Next, how to find HP and BP FIR filters from an LP prototype.
The easiest way to find a HP filter, is to design an LP
prototype of the same bandwidth, and do a frequency shift so
it is centered around f=1/2 instead of f=0. This is basically
a matter of switching the sign of every other coefficient,
but where you need to pay attention to preserving certain
symmetries.
You could do something similar for BP filters, where you
design the LP prototype with half the bandwidth of your
BP filter, and shifts the filter to be centered around some
center frequency fc by means of a mixer.
A somewhat more general approach is to first design a "wideband
LP" prototype, that covers the band [0, fpu], and then subtract
the band [0,fpl], where fpu and fpl are the upper and lower
cut-off frequencies for the pass band.
Rune
.
- Follow-Ups:
- Re: Getting started
- From: Gert Baars
- Re: Getting started
- References:
- Getting started
- From: Gert Baars
- Getting started
- Prev by Date: Re: filter design
- Next by Date: Re: What is the lowest power dsp ?
- Previous by thread: Re: Getting started
- Next by thread: Re: Getting started
- Index(es):
Relevant Pages
|