Beruflich Dokumente
Kultur Dokumente
0165 1684 (88) 90090 4
0165 1684 (88) 90090 4
North-Holland
A S I M P L E A P P R O A C H T O T H E D E S I G N O F L I N E A R P H A S E FIR D I G I T A L
FILTERS W I T H V A R I A B L E C H A R A C T E R I S T I C S *
Abstract. A class of linear phase digital filters is discussed for which the filter coefficients are simple functions of the parameters
determining the desired frequency response. In the case of lowpass or highpass flters, the 6 dB cutoff frequency is the
parameter considered here. Bandpass and bandstop filters are characterized by the center frequency and the bandwidth
measured from the 6 dB cutoff frequencies. Notch filters with a first-order zero at the notch frequency are also discussed.
The filters are variable over nearly the whole frequency range from zero to half the sampling frequency. Due to direct control
of filter coefficients, the length of the filter does not change when it is made variable.
Zusammenfassung. Eine Klasse linearphasiger Filter wird behandelt, deren Koeffizienten in einfacher Weise von den Para-
metern des Wunschfrequenzgangs abh~ingen. Im Falle von Tief- und Hochpal3filtern ist die 6 dB-Grenzfrequenz der betretIende
Parameter. Bandpaf3- und Bandsperr-Filter werden durch die Mittenfrequenz und die Breite des Bandes zwischen den
6 dB-Eckfrequenzen beschrieben. Kerbfilter mit einer einfachen Nullstelle bei der Kerbfrequenz werden ebenfalls diskutiert.
Die Filter k5nnen nahezu im gesamten Frequenzbereich zwischen 0 und der halben Abtastfrequenz eingestellt werden.
Aufgrund der unmittelbaren Steuerung der Filterkoeffizienten/indert sich der Filtergrad nicht dadurch, dab die Filter einstellbar
gemacht werden.
R6sum6. On 6tudie une classe des filtres fl phase lin6aire pour laquelle les coefficients du filtre sont des fonctions simples
des param~tres d6terminant la r6ponse fr6quentielle d6sir6e. Dans le cas des filtres passe-bas ou passe-haut, le param~tre
consid6r6 iciest la fr6quence de coupure fi 6 dB. Les filtres coupe-bande ou passe-hande sont caract6ris6s par les fr6quences
centrales et les largeurs de bandes mesur6es fi partir des fr6quences de coupure/~ 6 dB. Les filtres coupe-bande fi bande tr~s
6troite ('notch') avec un z6ro d'orde un /t la fr6quence de coupure sont 6galement discut6s. Les filtres sont variables sur
presque toute la bande de fr6quence de z6ro ~ la moiti6 de la fr6quence d'6chantillonnage. A cause du contr61e direct des
coefficients du filtre, la Iongueur du filtre ne change pas quand il est rendu variable.
frequency axis, while preserving the frequency Any linear phase causal FIR filter of length
characteristics. This approach has been further 2 N + 1 can be expressed as
developed [2, 3] and extended to bandpass filters
h ( n ) = ho(n - N ) , (1)
[ 1, 5]. Transformation methods generally increase
the filter length, except in the case of the first-order where h ( n ) is the impulse response of the causal
transformation. Furthermore, these methods lead filter and ho(n) is the impulse response of a zero
to special filter structures which are, of course, phase FIR filter which is symmetric with respect
acceptable in some applications. There are situ- to n = 0. The transfer function of the linear phase
ations where a direct form implementation is filter can be expressed in the form [14]
desired. Although it is possible to represent the
H ( z ) = z NHo(z), (2)
transformed filter in the direct form, it is generally
a difficult task. where Ho(z) is the transfer function of the zero
In this paper, we take another approach which phase filter and the frequency response Ho(e j'°) is
is also mentioned in the introduction of [13]. a real-valued function.
Oppenheim et al. state that one possible approach If HLPo(ej~°) is the frequency response of a zero
is to vary all of the filter coefficients in such a way phase lowpass filter, a symmetric bandpass
that the frequency characteristics vary in the response can be obtained, using the well-known
desired manner. They also point out that the filter modulation scheme [15], as
coefficients are generally a complicated function
of the filter cutoff frequency. This is true, generally. HBpo(ej'°) = Hcpo(eJ¢'°-'%~)
However, for a certain restricted but useful class + Hcpo(eJ('°+'%)). (3)
of linear phase digital filters, the coefficients are
The impulse response of the bandpass filter can
actually a very simple function of the cutoff
be expressed as [15]
frequency. Consequently, the approach of con-
trolling the filter coefficients directly is practical hBpo(n) = (e j°~°"+ e-J'%")hLpo(n)
for these filters also in real time applications.
= 2 cos(won ) hLPo(n ), (4)
In the next section, we review some simple
methods with which different response types (high- where Wo is the desired center frequency of the
pass, bandpass, notch, etc.) can be obtained from bandpass filter. Assuming that the center frequency
a lowpass prototype. In Section 3, we first consider w0 is chosen larger than the stopband edge ws of
window-based design methods from the point of the lowpass filter and less than 7r - w~, the resulting
view of variable filter design. The properties of bandpass filter has the worst case maximum error
optimal lowpass filters are then studied, and a 6p+6s in the passband and 26s in the stopband,
design method is proposed for approximately where 6p and 6s are the peak errors of the lowpass
optimal variable lowpass filters. The possibility to filter in the passband and stopband, respectively.
obtain unequal ripples in the passband and stop- The error is the deviation of the actual filter
band is considered in detail. The implementation response magnitude from the desired ideal value.
of the proposed filters is also discussed and illustra- A variable center bandpass filter can be imple-
tive examples are given. mented using equation (4) directly. If the lowpass
filter cutoff frequency can be controlled through
2. Filter type transformations one parameter, the cutoff frequencies of a band-
pass filter can be controlled through only two
In this section, we review some simple filter parameters.
transformations which are useful in the context of From a zero phase lowpass filter HLPo(z), a zero
variable band selective FIR filters. phase highpass filter HHPo(Z) having equal 6 dB
Signal Processing
P. Jarske, Y. Neuvo, S.K. Mitra / Variable FIR filters 315
cutoff frequency can be obtained as the amplitude Using both equation (4) and (8), a notch filter can
complementary of the prototype lowpass filter [ 16] be designed having a first-order zero at two sepa-
rate frequencies.
HHP0(2') = 1 -- H k p o ( Z ). (5) As an example of the use of equations (6) and
The impulse response of the zero phase highpass (8), a lowpass prototype filter of length 21 was
filter is thus given as designed. The passband edge is 0.4~r and the stop-
band edge 0.5~r. The filter was designed to have
hLpo( n ) for n = O, equal, and relatively large, ripples on both bands.
hupo(n) = f1 (6) The frequency response of the prototype filter and
(-h~o(n) for 1 <~[nl~< N.
the highpass filter obtained using equation (6) are
presented in Fig. l(a). Fig. l(b) shows the response
The passband error of the highpass filter is equal
of the notch filter resulting from equation (8).
to the stopband error of the prototype lowpass
filter, and vice versa.
By combining equations (4) and (6), a band- . . . . I . . . . [ . . . . I . . . . I . . . .
complementary
o
= 2HLPo(Z) -- 1. (7) . . . . I . . . . . . . . I . . . . I . . . .
o
This way the 6 dB cutoff frequency of the lowpass
filter is m a p p e d to the notch frequency of the
o
resulting notch filter. Another approach is to apply "0 -20
a simple linear transformation to the amplitude .,.¢
hnp(n) = eJ"=hLp(n)
where sinc(x) = sin(~x)/('rrx) and sinc(0) is equal
= cos(n~)hLp(n), (ll) to 1.
If we look at equation (13) from the point of
where 0 ~< n <~2 N - 1. This is equal to inverting the view of our problem, which is to vary the filter
sign of every other filter coefficient which makes coefficients such that the cutoff frequency of the
the filter symmetry odd. The resulting highpass filter varies in the desired manner, we notice that
filter is not the complementary of the prototype the center coefficient (n = 0) is a linear function of
lowpass filter. the cutoff frequency and the other coefficients are
of the form h i D ( n ) = c(n) sin(tocn), Inl ~> 1, where
c(n) is constant for each n and c ( - n ) = - c ( n ) .
So, in the ideal case, the coefficients, or the impulse
3. V a r i a b l e cutoff l o w p a s s filters
response values, are actually a very simple function
of the cutoff frequency.
In the previous section we showed that various
The length of the ideal lowpass filter is, naturally,
response types can be derived from a lowpass
infinite, and a finite impulse response filter can
prototype filter in a simple manner. Thus, the prob-
only approximate the ideal response. Nevertheless,
lem of designing a variable band selective filter is
we define the filter class considered in this section
reduced to the design of a variable cutoff lowpass
such that the coefficients of the filter are of the
filter. In the following discussion, we introduce
same form as in the ideal case, that is to say,
linear phase lowpass digital filters whose coeffi-
cients can be calculated from a simple func-
c(n)to¢+d for n = 0 ,
f
tion of the 6 dB cutoff frequency. The approach is
based on the very basic and well known properties
of lowpass digital filters and traditional F I R filter
ho( n ) =
~ (n)sin(tocn) for l~<lnl<~ N, (14)
otherwise,
design methods.
The ideal Iowpass digital filter frequency where toc is the variable 6 dB cutoff frequency, d
response can be defined as is a constant and c ( - n ) = - c ( n ) for [n[>~l. It
should be noted that if a iowpass prototype filter
HiD(eJ°') = { 10 f°r 0~< t° <~ we' (12) has the impulse response of this form, the
for We< W ~<~r, responses resulting from equations (4), (6), and
(8) also have the same form.
where toe is the cutoff frequency. HiD(e j'°) is peri- Any given fixed lowpass filter, designed with any
odic with period 2~r a n d symmetric with respect method, can be expressed in the form of equation
to w = 0. The ideal impulse response can be derived (14). The use of equation (14) with varying cutoff
as the inverse discrete Fourier transform of frequency is discussed next.
Signal Processing
P. darske, }I. Neuvo, S.K. Mitra / Variable FIR filters 317
I
filter of length 51 designed using the Hamming
window [14]. The frequency response of the vari- 0.6
able filter with several different cutoff frequencies 0.4
is presented in Fig. 2. The cutoff frequency is 0.2
variable over nearly the whole frequency band. 0.0 '
The only limiting factor is that it is not reasonable 0.4 'b''' .... ' .... ' ........
to make the 6 dB cutoff frequency smaller than
2~Ato or greater than w-½Aw, where Ato is the
0.2
transition bandwidth of the filter.
0.1
0.0 . . . . . . . . . . . . . . . . .
.... I .... I .... I .... I 0 . 2 1 . . . . . I . . . . I . . . . I . . . . I . . . . 4
0
~ 0.1
"~ 0.0
8 -o.1
° -0.2 ................ I, , 1
-50 - 0 . 0 4 . . . . , . . . . , . . . . , . . . . I . . . .
0.00
-0.02
-0.04
-100 ' ' 0.0 0.1 0.2 0.3 0.4 0.5
0.0 0.1 0.2 0.3 0.4 0.5 cutoff frequency. ~/2~
frequency, ~/2~
Fig. 3. Coefficients of an o p t i m a l l o w p a s s filter of length 51 as
Fig. 2. A v a r i a b l e cutoff l o w p a s s filter d e s i g n e d using the H a m - a function of the cutoff frequency. (a) n = 0 (center). (b) n = 1.
ming window. (c) n =2. (d) n = 10.
Vol. 14, No 4. June 1988
318 P. Jarske, Y. Neuvo, S.K. Mitra / Variable FIR filters
Based on large number of designs with different As an example, a variable cutoff lowpass filter
filter lengths and transition bandwidths, the fol- of length 51 was designed with two different transi-
lowing conclusions are drawn. For optimal low- tion bandwidths and equal weights in both bands
pass filters of odd length and equal peak errors on of the model filter. The results are presented in
both passband and stopband, the filter coefficients Fig. 4. The filters are exactly equiripple at the cut-
follow equations (14) very closely. Note that, also off frequency of the model filter, and approxi-
in the window designs, the maximum errors are mate optimal filters quite well at other cutoff
equal on both bands. frequencies.
Also in filters of even length, the coefficients
behave in a simple manner as a function of the
. . . . I . . . . I . . . . I . . . . I . . . .
0.5 )
Wco= 2"rr 0 . 2 5 + 2 N + 1
E -60
for filters of length 2 N + 1 , and Wco=0.5,r for
length 2N. Other choices are possible. The -flO
0.0 0.1 0.2 0.3 0.4 0.5
coefficients c(n) in equation (14) or (16) can now frequency, ~/2~
be calculated from
Fig. 4. A variable cutoff Iowpass filter approximating optimal
filters, length = 51, transition bandwidth. (a) 0.10w, (b) 0.02w.
=
[ hMO(n)
~sin(wcon)
for
odd length and n # 0,
c(n) ] hMo(n) (17) The following examples illustrate variable linear
lsin(wco(n - ½)) for even length. phase bandpass and notch filters obtained using
the equations derived above. A variable center
The center coefficient c(0), for filter length 2 N + 1, bandpass filter can be implemented using a low-
is equal to 1/~r and d = 0 according to equation pass prototype and equation (4) or (10). Fig. 5
(13), in the lowpass case. The variable cutoff filter presents the frequency responses of a length-50
is then implemented using equation (14) or (16). variable center bandpass filter resulting from an
Signal Processing
P. Jarske, Y. Neuvo, S.K. Mitra / Variable FIR .filters 319
ho(n) = c(n)(sin(wc2(n-½))
optimal prototype and equation (10). The center
frequency is controlled with one parameter. - sin(wc~(n -½))) (19)
A variable bandwidth bandpass filter is realized is obtained. As an example, the responses of a
with a bandpass prototype and equation (14) or variable cutoff bandpass filter of length 50 are
(16). The bandpass prototype filter can be designed presented in Fig. 7.
using equation (4) or (10). The frequency A variable notch filter of odd length is easily
responses of a variable bandwidth bandpass filter implemented using a prototype obtained with
of length 50 are shown in Fig. 6. The bandwidth equation (8). The variable filter is then realized
of the filter is controlled with one parameter.
~ -5o
-5o ,
according to equation (14). Fig. 8 illustrates a (15) where hiD(n) is calculated from equation (13).
notch filter of length 51 and notch width 0.1"rr. The window function w(n), in this case, is also a
function of the cutoff frequency, while in the win-
dow design methods, w(n) is constant for each n
and all cutoff frequencies. As an example, some
of the window values of an optimal lowpass filter
of length 51 are presented in Fig. 9. The design is
weighted such that the passband ripple of the filter
is ten times the stopband ripple. For simplicity,
btl the cutoff frequency toc is defined to be the
-50 frequency half-way between the passband and
stopband edges. For designs with considerably
differing weights, this is not exactly the 6 dB
frequency.
1.2 . . . . I . . . . I . . . .
-i00
0.0 0.1 0.2 0.3 0.4 0.5
frequency, ~/2rr 1.O .
1.2 . . . . i . . . . i . . . .
3.3. Unequal ripples in passband and stopband
Earlier, we pointed out that window design
1.O -
methods produce approximately equal maximum
ripples in the passband and stopband of a lowpass 0.9
filter. Also, optimal lowpass filters can be success- 0.8 i . . . .
.... , bt
fully approximated with equation (14) or (16) only
' " ' I . . . . !
if the prototype filter is designed to have equal =:1 1.4
The results of numerous optimal designs (for where R and Q are polynomials. HLp0 can be
example, the curves of Fig. 9 are extracted from approximated with P( to - toe) and S( w - co~.) which
230 different designs) indicate that w(n) can be are truncated series expansions of the ideal
very well approximated, in a wide range of cutoff response, in other words polynomials in to. Thus,
frequencies, with functions of the form
[
{P(to-to~) f°r0~to<~Wc' (26)
c'(n)+d'(n)/to~ for n =0, HLp°(eJ~')'~ S ( t o - t o c ) forto~<to<~r.
w(n)= c'(n)+d'(n)cot(tocn) (20)
As HLpo is symmetric with respect to to = 0 and
for 1 <~[nl<~ N.
periodic with period 2qv, the ideal impulse response
can be derived as
For comparison, the coefficients calculated from
equation (20) are also shown in Fig. 9 (dashed
line). The coefficients c'(n) and d'(n) are obtained
with the design method described later in this
hLr,o(n) = --
1
71"
j'( -rr
1
HLPo(e j'°) cos(ton) dw
(27)
where - N + 1 <~ n <~ N, the window function can
If we solve the integrals in equation (27) by
be approximated with
parts, we can see that the resulting impulse
w(n) = c'(n)+ d'(n) cot(toc(n -~)). (22) response is of the form of equation (23) except
for the terms + P " ) ( - t o c ) and +S(~)(~r-to¢),
Using equations (15), (20), (21), and (22), the i = 1, 3, 5 , . . . , where
expression for approximately optimal variable cut-
dip(to)
off zero phase lowpass filter impulse response is
P(')(to)- dw' " (28)
fc(n)toc+d(n) for n =0, However, since HLeo is a function of cos to, and
ho(n) = ~ c ( n ) s i n ( t o c n ) + d ( n ) cos(tocn) (23) p(i)(_to~)~, rJ(') ~ o,~
/ • J LP0~e ,I
( for l<~lnl<~ N,
and
when the filter length is 2 N + 1, and
S(il(.rr- toc)= ~(i)
s l L P O I~oJ~
~, j,
~
-100
C
-so -
-50
....'cJ
i .... J ....
the form
filters are useful, for instance, in the areas of image by the transformation function T. As an example,
coding and pattern recognition. a variable 2-D filter was designed using a variable
A simple and straightforward approach to vari- 1-D prototype of length 21 and the original
able 2-D filters is the use of separable FIR filters. McClellan transformation. The prototype filter was
A separable 2-D frequency response can be designed using the method described in Section 3.
expressed as a product of two one-dimensional The frequency responses of the resulting filter with
responses two different cutoff frequencies are presented in
Fig. 13. The shape of the passband, in this case,
H ( e j%, e j'°2) = Ht(eJ'°') H2(eJ~2). (32) follows the contours of the original McClellan
Similarly, the impulse response of such a filter can transformation function [9], as expected.
be expressed as a product The IFIR concept can be readily extended to
two-dimensional filters [17]. Using this approach,
h(n, m) = h~(n)h2(m). (33) tunable 2-D narrowband or wideband filters can
be realized with considerably reduced number of
A variable 2-D filter results if one or both of the variable coefficients.
1-D filters are variable. A separable frequency
response has always approximately rectangular
symmetry, and the bandwidth of such a filter can
be controlled individually in each direction.
McClellan [7] introduced a transformation
method for the design of 2-D FIR filters having
approximately circular symmetry. This, so-called
McClellan transformation, was generalized by
Mersereau et al. [9]. In this method, the 2-D
response is obtained from a 1-D filter with a substi-
tution of variables. The 1-D response of length
2 N + 1 is first expressed in the form
N
H ( e j'°) = ~ b(n)[cos to]". (34) a
n=0
5. Implementation and applications cosine functions can be approximated with the first
terms of their Taylor series expansions, and the
There are several arguments which support the filter coefficients for different frequencies can be
direct form implementation of digital filters, calculated from the linear equations
especially FIR filters, in microprocessor-based sys-
tems. The theory and properties of these structures h0(n) = c ( n ) [ s i n ( w m n )
are thoroughly studied. With modern special pur-
pose signal processors and other high speed VLSI + 6wn cos(comn)]. (38)
devices it is not necessary to minimize the number
of multiplications in all cases since multiplication The width of the usable tuning range, in this
can be performed as fast as addition. Furthermore, case, is inversely proportional to the length of the
the instruction set of a microprocessor designed filter.
for high speed signal processing is usually such The most obvious applications of variable
that a direct form filter can be implemented very digital filters are in laboratory instruments,
efficiently. In many cases, a FIR filter of length M communications and audio signal processing.
can be realized with M instructions. Also, with Here, we review shortly two special applications
devices designed for vector operations, the direct of variable FIR filters which are currently being
form FIR is a natural structure as the filter is the studied.
scalar product of the coefficient vector and a vector In the design of digital filter banks, one of the
of signal samples. The above arguments are valid decisions to be made is the degree of overlapping
also for variable FIR filters which, as we have of the responses of different channels. There are
shown in the previous sections, can be readily applications where completely nonoverlapping
implemented by directly controlling the coeffi- designs are required, such as T D M - F D M trans-
cients of a direct form filter. multiplexers for communication systems. In many
The major problem in the implementation is the applications, however, a certain degree of overlap-
function sin x. Standard methods for obtaining the ping is accepted or even desired. Uniform filter
sine function values are table lookup and series banks are usually realized using a single model
expansions. The values of a sinusoid can also be filter which is then modulated to different channels.
calculated recursively using a digital sinewave gen- If the model filter is variable, the degree of overlap-
erator which is essentially a second order recursive ping between channels can easily be adjusted, dur-
digital filter with poles on the unit circle [4]. If the ing the filter operation if necessary. Nonuniform
second-order section is in coupled form, both the filter banks can also be readily implemented with
sine and cosine functions are available simul- variable FIR filters. Efficient DFT algorithms can
taneously [ 11 ]. be applied especially to uniform but also to non-
In some applications, the filter is required to be uniform filter banks [6].
tunable only within a narrow range around a Half-band filters are commonly used in subband
certain selected frequency CO m . A very efficient coding of one- and two-dimensional signals. The
implementation results if the filter coefficients are coding of images is usually done using separable
represented in terms of filters. The application of nonseparable filters, with
approximately circular band shapes, to subband
sin((COm + 6 w ) ) n = sin(COmn) cos(6COn) coding of images, and frequency domain
+ cos(comn) sin(6COn), (37) pseudocoloring of graylevel images are being
studied [10]. With tunable 2-D filters, suitable
where 6CO is the deviation from the selected band edges can be selected for each image
frequency. For small values of 6CO, the sine and separately.
V o l . 14, N~) 4, J u n e 19~8
326 P. Jarske, Y. Neuvo, S.K. Mitra / Variable FIR filters