# Connexions

You are here: Home » Content » FIR FILTER DESIGN: THE WINDOW DESIGN METHOD

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

#### Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
• VOCW

This module is included inLens: Vietnam OpenCourseWare's Lens
By: Vietnam OpenCourseWare

Click the "VOCW" link to see all content affiliated with them.

### Recently Viewed

This feature requires Javascript to be enabled.

# FIR FILTER DESIGN: THE WINDOW DESIGN METHOD

Module by: Nguyen Huu Phuong. E-mail the author

The design of a FIR filter starts with its specifications in either discrete-time domain or DTFT frequency domain, or both. In the time domain, the design objective is the impulse response. In the frequency domain, the requirement is on various parameters of the magnitude response, shown in Fig.5.8 for a lowpass filter. Important parameters are band edge frequencies ωpωp size 12{ω rSub { size 8{p} } } {} and ωsωs size 12{ω rSub { size 8{s} } } {}, passband

[0, ω p ] [0, ω p ] MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqaaeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacUfacaaIWaGaaiilaiabeM8a3naaBaaaleaacaWGWbaabeaakiaac2faaaa@3C03@ , transition band Δω=ωsωpΔω=ωsωp size 12{Δω=ω rSub { size 8{s} } - ω rSub { size 8{p} } } {}, stopband , cutoff frequency ωc=(ωp+ωc)/2ωc=(ωp+ωc)/2 size 12{ω rSub { size 8{c} } = $$ω rSub { size 8{p} } +ω rSub { size 8{c} }$$ /2} {}, passband ripple (or deviation) δpδp size 12{δ rSub { size 8{p} } } {} and stopband ripple δsδs size 12{δ rSub { size 8{s} } } {}. The two ripples are usually assumed equal . Notice that for ideal (desired) filter, the passband frequency magnitude is normalized to 1 and the stopband to 0 , and the frequency response of the designed filter oscillates between the high amplitude of 1 or the low amplitude of 0.

Figure 2 illustrates the specifications of bandpass filter. Here there are two sets of edge frequencies, lower and upper. The rising bandwith Δ ω l Δ ω l MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiabfs5aejabeM8a3naaBaaaleaacaWGSbaabeaaaaa@3A52@ and the falling bandwidth Δ ω u Δ ω u MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiabfs5aejabeM8a3naaBaaaleaacaWG1baabeaaaaa@3A5B@ are usually assumed equal.

Even the initial requirement is imposed on magnitude response but we must design the filter having linear phase or generalized linear phase.

Overall filter design

From the filter specifications, the first step is to choose between FIR and IIR filters based on their advantages and disadvantages. This chapter only concerns FIR filters. The next step is to select the proper linear phase FIR filters (section 5.2.3). A rather complete procedure for the design of FIR filters are as follows.

• Specifications of the filter
• Choosing an appropriate linear phase filter type (section 5.2.3)
• Choosing the mothod of design such as window, optimal, frequency sampling…
• Calculation the filter coefficients (impulse response)
• Finding suitable structure
• Analysis of the finite wordlength effects (chapter 7)
• Implementation of the filter in hardware and/or software (chapter 7).Fig.5.9: Bandpass filter specifications

## Fixed windows

The impulse response of ideal filters is infinite duration (IIR). We cannot evaluate the corresponding frequency response and, especially, implement the filter by hardware and/or software. Thus we must truncate the impulse response at both ends with respect to the central. Even we truncate the impulse response when it is small enough, but such a sudden cutoff will cause some undesired effects. The window method will reduce them.

In the time domain, windowing means that the we multiply the desired (usually ideal) infinite duration impulse response hd(n)hd(n) size 12{h rSub { size 8{d} } $$n$$ } {} by a finite duration window (or window function) w(n)w(n) size 12{w $$n$$ } {} to get a soft truncation. The resulted impulse response h(n)h(n) size 12{h $$n$$ } {} of the designed filter is the product

(1)

Here we assume that all desired impulse responses and windows are causal, from n=0n=0 size 12{n=0} {} to n=Mn=M size 12{n=M} {}, i.e. window length is M+1M+1 size 12{M+1} {} samples (time indices). Many authors start the design with hd(n)hd(n) size 12{h rSub { size 8{d} } $$n$$ } {} and w(n)w(n) size 12{w $$n$$ } {} bi-sided (noncausal), i.e. defined in the interval then shift to the right M/2M/2 size 12{M/2} {} indices to make them causal.

Multiplying in time domain corresponds to convolution in frequency domain. Thus the frequency response of the designed filter (corresponding to the windowed impulse response h(n)h(n) size 12{h $$n$$ } {}) is

H(ω)=Hd(ω)W(ω)=1ππHd(ω')W(ωω')'H(ω)=Hd(ω)W(ω)=1ππHd(ω')W(ωω')' size 12{H $$ω$$ =H rSub { size 8{d} } $$ω$$ * W $$ω$$ = { {1} over {2π} } Int rSub { size 8{ - π} } rSup { size 8{π} } {H rSub { size 8{d} } $$ω'$$ W $$ω - ω'$$ dω'} } {}
(2)

where W(ω)W(ω) size 12{W $$ω$$ } {} is the Fourier transform (DTFT) of the window w(n)w(n) size 12{w $$n$$ } {}.

In the window design method , we first evaluate the desired filter impulse response h d (n) h d (n) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiaadIgadaWgaaWcbaGaamizaaqabaGccaGGOaGaamOBaiaacMcaaaa@3A3B@ from the given desired frequency response H d (ω) H d (ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeadaWgaaWcbaGaamizaaqabaGccaGGOaGaeqyYdCNaaiykaaaa@3B16@ , and then apply an appropriate window . Thus the method should be called the Fourier – window method.

Retangular window

Actually, the sudden truncation mentioned earlier is the simplest window called rectangular window, defined as (Figure 3)

w(n)=1,0nM0,otherwisew(n)=1,0nM0,otherwisealignl { stack { size 12{w $$n$$ = matrix { {} # 1{} } matrix { {} } , matrix { {} # {} } 0 <= n <= M} {} # size 12{ matrix { {} # {} # matrix { {} # 0{} } {} } matrix { {} } , matrix { {} # {} } "otherwise"} {} } } {}
(3)

The Fourier transform of this window is

W(ω)= n= w(n) e jωn = n=0 M e jωn = 1 e jω(M+1) 1 e jω = e j M 2 ω sinω(M+1)/2 sinω/2 ,ω0 M+1 , ω=0 W(ω)= n= w(n) e jωn = n=0 M e jωn = 1 e jω(M+1) 1 e jω = e j M 2 ω sinω(M+1)/2 sinω/2 ,ω0 M+1 , ω=0 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeGabiGaciaacaqaaeaadaqaaqaaaOabaeqabaGaam4vaiaacIcacqaHjpWDcaGGPaGaeyypa0ZaaabCaeaacaWG3bGaaiikaiaad6gacaGGPaGaamyzamaaCaaaleqabaGaeyOeI0IaamOAaiabeM8a3jaad6gaaaGccqGH9aqpdaaeWbqaaiaadwgadaahaaWcbeqaaiabgkHiTiaadQgacqaHjpWDcaWGUbaaaaqaaiaad6gacqGH9aqpcaaIWaaabaGaamytaaqdcqGHris5aOGaeyypa0ZaaSaaaeaacaaIXaGaeyOeI0IaamyzamaaCaaaleqabaGaeyOeI0IaamOAaiabeM8a3jaacIcacaWGnbGaey4kaSIaaGymaiaacMcaaaaakeaacaaIXaGaeyOeI0IaamyzamaaCaaaleqabaGaeyOeI0IaamOAaiabeM8a3baaaaaabaGaamOBaiabg2da9iabgkHiTiabg6HiLcqaaiabg6HiLcqdcqGHris5aaGcbaqbaeqabeGaaaqaaaqaauaabeqabiaaaeaafaqabeqadaaabaqbaeqabeGaaaqaauaabeqabiaaaeaaaeaaaaaabaaaaaqaaaqaaaaaaeaafaqabeqacaaabaqbaeqabeGaaaqaauaabeqabiaaaeaaaeaaaaaabaaaaaqaaaaaaaaaauaabeqabeaaaeaacqGH9aqpcaWGLbWaaWbaaSqabeaacqGHsislcaWGQbWaaSaaaeaacaWGnbaabaGaaGOmaaaacqaHjpWDaaGcdaWcaaqaaiGacohacaGGPbGaaiOBaiabeM8a3jaacIcacaWGnbGaey4kaSIaaGymaiaacMcacaGGVaGaaGOmaaqaaiGacohacaGGPbGaaiOBaiabeM8a3jaac+cacaaIYaaaaaaafaqabeqabaaabaaaaiaacYcacaaMf8UaeqyYdCNaeyiyIKRaaGimaaqaauaabeqabiaaaeaaaeaafaqabeqacaaabaqbaeqabeWaaaqaauaabeqabiaaaeaafaqabeqacaaabaaabaaaaaqaaaaaaeaaaeaaaaaabaqbaeqabeWaaaqaauaabeqabiaaaeaaaeaaaaaabaaabaaaaaaaaaGaaGzbVlaaywW7caaMf8UaamytaiabgUcaRiaaigdafaqabeqabaaabaaaaiaacYcafaqabeqacaaabaaabaGaaGzbVlaaywW7aaGaaGzbVlaaywW7caaMe8UaeqyYdCNaeyypa0JaaGimaaaaaa@9C45@
(4)

This is the same as Equation (3.54) when replacing MM size 12{M} {} by 2N2N size 12{2N} {}. Also, instead of the above expression we can use the sum of cosines (Equations (3.46), (3.53)). W(ω)W(ω) size 12{W $$ω$$ } {} has includes a phase factor showing the time shift of a two-sided symmetric window to a causal window. The magnitude and phase responses are, respectively,

(5)
Φ(ω)= M 2 ω+β Φ(ω)= M 2 ω+β MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeGabiGaciaacaqaaeaadaqaaqaaaOqaaiabfA6agjaacIcacqaHjpWDcaGGPaGaeyypa0JaeyOeI0YaaSaaaeaacaWGnbaabaGaaGOmaaaacqaHjpWDcqGHRaWkcqaHYoGyaaa@4265@
(6)

where ββ size 12{β} {} is 0 or ππ size 12{π} {} as discussed in previous section. Thus the window is linear phase. Fig.3.27 illustrates the variation of the amplitude of W(ω)W(ω) size 12{ lline W $$ω$$ rline } {} (remember to replace 2N2N size 12{2N} {} by MM size 12{M} {}). It is maximum and equals to M+1M+1 size 12{M+1} {} at ω=0ω=0 size 12{ω=0} {}. The zero-crossing points are multiples of /(M+1)/(M+1) size 12{2π/ $$M+1$$ } {}. The response consists of a main lobe and many sidelobes. As MM size 12{M} {} gets larger the main-lobe gets smaller, and there are more sidelobes, also narrower but the amplitude of the first sidelobe remains the same (Fig.5.11). As MM size 12{M rightarrow infinity } {}, W(ω)W(ω) size 12{W $$ω$$ } {} tends to be an unit sample δ(ω)δ(ω) size 12{δ $$ω$$ } {}.

The oscillatory W(ω)W(ω) size 12{ lline W $$ω$$ rline } {} when convolved with the ideal lowpass response Hd(ω)Hd(ω) size 12{H rSub { size 8{d} } $$ω$$ } {} will result in a response H(ω)H(ω) size 12{H $$ω$$ } {} having a non-zero transition width and ripples is both the passband and stopband. Fig.5.12 shows the designed lowpass filter when using rectangular window having M=44M=44 size 12{M="44"} {} to abruptly truncate the impulse response of an ideal lowpass filter with cutoff frequency ωc=π/2ωc=π/2 size 12{w rSub { size 8{c} } =π/2} {}. Fig.5.13 shows the magnitude in linear scale for two case of filter order, M = 10 and M = 18.

In order that H(ω)H(ω) size 12{H $$ω$$ } {} approaches Hd(ω)Hd(ω) size 12{H rSub { size 8{d} } $$ω$$ } {} the rectangular window must be of infinite duration, i.e. we must take into account the whole impulse response without truncation. In frequency domain this means W(ω)W(ω) size 12{W $$ω$$ } {} is an unit sample δ(ω)δ(ω) size 12{δ $$ω$$ } {} as said. We can reason in the reverse direction: Since H(ω)=Hd(ω)δ(ω)=Hd(ω)H(ω)=Hd(ω)δ(ω)=Hd(ω) size 12{H $$ω$$ =H rSub { size 8{d} } $$ω$$ * δ $$ω$$ =H rSub { size 8{d} } $$ω$$ } {} then δ(ω)δ(ω) size 12{δ $$ω$$ } {} must be a unit sample and the windows must be of infinite duration. When we simulate H(ω)H(ω) size 12{H $$ω$$ } {}on a computer using Maltlab sofware, or else, with MM size 12{M} {} in the hundreds we will still see the non-zero transition width and ripples due to the Gibbs phenomenon (section 3.1.4). An infinitely long windows is not practical, so the idea is to look for finite duration windows which perform better than the rectangular.

Actually in examples 5.2.1 and 5.2.2 the truncation of the impulse responses of the ideal filters meant the rectangular window had been applied.

Other windows

The Gibbs phenomenon can be reduced considerably by the use of a softer (less abrupt) truncation, i.e. by tapering the rectangular smootly to zero at both ends. Unfortunately, the reduction in amplitude of sidelobes of H(ω)H(ω) size 12{H $$ω$$ } {}is accompanied by a widening of its mainlobe. For comparision, the window responses W(ω)W(ω) size 12{W $$ω$$ } {}are usually plotted in dBdB size 12{ ital "dB"} {} scale.

Several smooth window functions have been proposed and used. It might come to our mind that the first applicant would be the triangular window, also called Bartlett window , depicted in Fig.5.14. From the figure we can write the window function ( table 5.1). Table 5.1 lists common fixed windows and Fig.5.15 plots their functions. Fig.5.16 plots the dB magnitude for and Fig.5.17 for M = 50.The first sidelobe is at -25dB compared to the -13dB of the corresponding (same length) rectangular window. However the mainlobe width is about twice as large.

The sidelobe of the triangular window is still high because the tapering is still rather coarse. For smoother tapering, cosinusoid is incorporated into the window function. This observation has led to the three well known windows: Hanning (or von Hann), Hamming, and Blackman, all defined in the interval 0nM0nM size 12{0 <= n <= M} {}, otherwise zero (table 5.1). We can check that the functions are normalized (peak value of 1 at n=M/2n=M/2 size 12{n=M/2} {}) and zero at both ends except the rectangular and the Hamming (0.08 instead of 0). Besides, there are many other less-used fixed windows.

Notice that all windows mentioned, from rectangular to Blackman, are simple functions easily evaluated, and their frequency responses concentrate around ω=0ω=0 size 12{ω=0} {}(the mainlobe) as expected. Also notice that all the windows mentioned are symmetric about the mid-point n=M/2n=M/2 size 12{n=M/2} {}, this when combined with the symmetry or antisymmetry of the filter’s impulse response will make the corresponding designed filter linear phase or generalized linear phase.

Table 5.2 lists various features of common windows for comparison. The passband ripple and the stopband ripple δsδs size 12{δ rSub { size 8{s} } } {} and the stopband ripple δ s δ s MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaaiabes7aKnaaBaaaleaacaWGZbaabeaaaaa@38AE@ , are taken equal (the smaller of the two):

A=20 log 10 [min( δ p , δ s )] A=20 log 10 [min( δ p , δ s )] MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadgeacqGH9aqpcqGHsislcaaIYaGaaGimaiGacYgacaGGVbGaai4zamaaBaaaleaacaaIXaGaaGimaaqabaGccaGGBbGaciyBaiaacMgacaGGUbGaaiikaiabes7aKnaaBaaaleaacaWGWbaabeaakiaacYcacqaH0oazdaWgaaWcbaGaam4CaaqabaGccaGGPaGaaiyxaaaa@4ACA@
(7)

Fig.5.16, Fig.5.17 and Table 5.2 show that no window is the best in all aspects but there is a tradeoff of features, and the choice of an appropriate window depending on our requirement. For smallest mainlobe width it’s the rectangular window, for best sidelobe attenuation it’s the Blackman. In between, the Hamming is a good choice. The Bartlett is the transition from the rectangular to the other windows. See section 5.3.3 for design examples.

## The Kaiser window

The windows discussed so far are fixed windows, only the length (M+1)(M+1) size 12{ $$M+1$$ } {} is adjustable. The Kaiser window has an additional ripple parameter ββ size 12{β} {} , enabling the designer to tradeoff the transition and ripple. It is defined in the interval 0nM0nM size 12{0 <= n <= M} {}, otherwise zero:

(8)

where I0(x)I0(x) size 12{I rSub { size 8{0} } $$x$$ } {} is the modified zeroth-order Bessel function, computed by a power series expansion:

I0(x)=1+k=1x(2)kk!2=1+x24+122x24x24+1z2x24x416+I0(x)=1+k=1x(2)kk!2=1+x24+122x24x24+1z2x24x416+ size 12{I rSub { size 8{0} } $$x$$ =1+ Sum cSub { size 8{k=1} } cSup { size 8{ infinity } } { left [ { {x $$2$$ rSup { size 8{k} } } over {k!} } right ]} rSup { size 8{2} } =1+ { {x rSup { size 8{2} } } over {4} } + { {1} over {2 rSup { size 8{2} } } } cdot { {x rSup { size 8{2} } } over {4} } cdot { {x rSup { size 8{2} } } over {4} } + { {1} over {z rSup { size 8{2} } } } cdot { {x rSup { size 8{2} } } over {4} } cdot { {x rSup { size 8{4} } } over {"16"} } + cdot cdot cdot } {}
(9)

Following is the values of I0(x)I0(x) size 12{I rSub { size 8{0} } $$x$$ } {} for small xx size 12{x} {}:

The upper limit of the summation does not need to be too large, say about 20 at the most.

For β=0β=0 size 12{β=0} {} both the numerator and denominator are 1 and the Kaiser window becomes the rectangular window, and for β=5.44β=5.44 size 12{β=5 "." "44"} {} it is near to the Hamming window. The parameter ββ size 12{β} {}is so chosen that the magnitude response of the filter lies in the allowed region (see Fig.5.1). Fig.5.18 shows the Kaiser for various values of ββ size 12{β} {} and MM size 12{M} {}. Notice that the Kaiser is also symmetric. It has minimum stopband attenuation from 50dB (for β=4.54β=4.54 size 12{β=4 "." "54"} {}) to 90dB (for β=8.96β=8.96 size 12{β=8 "." "96"} {}), so we can choose a Kaiser window to have maximum stopband atternuation equal to the Blackman window (74, Table 5.2) or higher.

For ideal filters (Fig.5.1 and Fig.5.2) the Kaiser window has equal ripple δδ size 12{δ} {} in both the passband and stopband. For real filters the ripples are slightly different . In design we take the common ripple as δ=min(δp,δs)δ=min(δp,δs) size 12{δ="min" $$δ rSub { size 8{p} } ,δ rSub { size 8{s} }$$ } {} of the desired values δp,δsδp,δs size 12{δ rSub { size 8{p} } ,δ rSub { size 8{s} } } {}. As said earlier, actually δδ size 12{δ} {} is usually specified in term of dBs: A=20log10δA=20log10δ size 12{A= - "20""log" rSub { size 8{"10"} } δ} {}, for example δ=0.01δ=0.01 size 12{δ=0 "." "01"} {} then A=40dBA=40dB size 12{A="40""dB"} {}, δ=0.001δ=0.001 size 12{δ=0 "." "001"} {} then A=60dBA=60dB size 12{A="60""dB"} {}. Since δδ size 12{δ} {} is a fraction of 1 then A is always ponsitive.

Kaiser has developed empirical formulae and guide for the application of the window. Following is design steps for lowpass filters (similarly for other frequency selective filters).

1/ Specifications of edge frequencies ωp,ωsωp,ωs size 12{ω rSub { size 8{p} } ,ω rSub { size 8{s} } } {}; ripples δp,δsδp,δs size 12{δ rSub { size 8{p} } ,δ rSub { size 8{s} } } {}

2/Evaluate the minimum ripple A=20log10[min(δp,δs)]A=20log10[min(δp,δs)] size 12{A= - "20""log" rSub { size 8{"10"} } $"min" $$δ rSub { size 8{p} } ,δ rSub { size 8{s} }$$$ } {}, the cutoff frequency ω c =( ω p + ω s )/2 ω c =( ω p + ω s )/2 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3naaBaaaleaacaWGJbaabeaakiabg2da9iaacIcacqaHjpWDdaWgaaWcbaGaamiCaaqabaGccqGHRaWkcqaHjpWDdaWgaaWcbaGaam4CaaqabaGccaGGPaGaai4laiaaikdaaaa@4371@ , the transition width ω= ω s ω p ω= ω s ω p MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabloBjwjabeM8a3jabg2da9iabeM8a3naaBaaaleaacaWGZbaabeaakiabgkHiTiabeM8a3naaBaaaleaacaWGWbaabeaaaaa@414B@

3/ Determine the filter filter order M

M=A7.952.285Δω,A>21M=5.79Δω,A21M=A7.952.285Δω,A>21M=5.79Δω,A21alignl { stack { size 12{M= { {A - 7 "." "95"} over {2 "." "285"Δω} } matrix { } , matrix { {} # {} # {} } A>"21"} {} # size 12{M= { {5 "." "79"} over {Δω} } matrix { {} } , matrix { matrix { {} # {} } {} # {} # {} } matrix { {} } A <= "21"} {} } } {}
(10)

4/ Determine the parameter ββ size 12{β} {}, depending on A:

(11)

5/ Computer the window coefficients w(n)w(n) size 12{w $$n$$ } {}from the formula (5.40)

6/ Compute the impulse response hd(n)hd(n) size 12{h rSub { size 8{d} } $$n$$ } {}of the desired filter which is linear phase

7/ Compute the designed impulse response h(n)=hd(n)w(n)h(n)=hd(n)w(n) size 12{h $$n$$ =h rSub { size 8{d} } $$n$$ w $$n$$ } {}.

8/ Find the frequency response H(ω)=IDTFT[h(n)] H(ω)=IDTFT[h(n)] MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaiabg2da9iaadMeacaWGebGaamivaiaadAeacaWGubGaai4waiaadIgacaGGOaGaamOBaiaacMcacaGGDbaaaa@43E8@ to check with specifications. For bandpass filter the two transition bandwidths are usually equal, if not we take the smaller one.

## Design examples

### Example 1

Design a linear phase lowpass filter using the Hamming window to meet the specifications

• Cutoff frequency 2.5 kHz
• Transition width 1.65 kHz
• Stopband attenuation >50dB
• Sampling frequency 10kHz

Solution

The relation between the analog linear frequency FF size 12{F} {} samples/sec (or Hz) and the digital angular frequency ωω size 12{ω} {} radians/sample is (Equation 1.40) is

ω = F f s ω = F f s size 12{ω=2π { {F} over {f rSub { size 8{s} } } } } {}

where fsfs size 12{f rSub { size 8{s} } } {} is the sampling frequency (samples/sec, or Hz). Thus

• Cutoff frequency ωc=2.510=0.ωc=2.510=0. size 12{ω rSub { size 8{c} } =2π { {2 "." 5} over {"10"} } =0 "." 5π} {} rad/sample
• Transition width Δω=1.6510=0.33πΔω=1.6510=0.33π size 12{Δω=2π { {1 "." "65"} over {"10"} } =0 "." "33"π} {} rad/sample

Table 5.2 shows that the Hamming satisfy (so can the Blackman) the maximum stopband attenuation ( 20log10δs)20log10δs) size 12{ - "20""log" rSub { size 8{"10"} } δ rSub { size 8{s} } \) } {} requirement. Table 5.2 includes the relation between transition width ΔωΔω size 12{Δω} {} and window order MM size 12{M} {}:

Δω = 6 . M M = 6 . 0 . 33 π = 20 Δω = 6 . M M = 6 . 0 . 33 π = 20 size 12{Δω= { {6 "." 6π} over {M} } matrix { {} # drarrow {} # {} } M= { {6 "." 6π} over {0 "." "33"π} } ="20"} {}

Now we compute the causal impulse response hLP(n)hLP(n) size 12{h rSub { size 8{ ital "LP"} } $$n$$ } {}of ideal lowpass filter (Equation (5.32)) for 0n200n20 size 12{0 <= n <= "20"} {}. Notice that for MM size 12{M} {} even and h(n)h(n) size 12{h $$n$$ } {}symmetric we have linear phase FIR-1 (Fig.5.4a). The result is plotted in Fig.5.19a.

Next we evaluate the Hamming window

The result is plotted in Fig.5.19b.

The impulse response of the designed filter is the product

We can evaluale w(n) and h LP (n) h LP (n) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIgadaWgaaWcbaGaamitaiaadcfaaeqaaOGaaiikaiaad6gacaGGPaaaaa@3AF8@ separately as above then take the product, or evaluate the product directly . The result is plotted in Fig.5.19c. We then take the inverse transform of h(n)h(n) size 12{h $$n$$ } {} to get the frequency response H(ω)H(ω) size 12{H $$ω$$ } {}:

H ( ω ) = n = h ( n ) e jωn = n = 0 M h ( n ) e jωn , M = 20 H ( ω ) = n = h ( n ) e jωn = n = 0 M h ( n ) e jωn , M = 20 size 12{H $$ω$$ = Sum cSub { size 8{n= - infinity } } cSup { size 8{ infinity } } {h $$n$$ } e rSup { size 8{ - jωn} } = Sum cSub { size 8{n=0} } cSup { size 8{M} } {h $$n$$ e rSup { size 8{ - jωn} } } matrix { } , matrix { {} # {} } M="20"} {}

Fig.5.19d shows |H(ω)| |H(ω)| MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacaWGibGaaiikaiabeM8a3jaacMcacaGG8baaaa@3BD6@ , and Fig.5.19c shows |H(ω) | dB |H(ω) | dB MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacaWGibGaaiikaiabeM8a3jaacMcacaGG8bWaaSbaaSqaaiaadsgacaWGcbaabeaaaaa@3DB2@ .

### Example 2

We need ro extract a low frequency signal having bandwidth 200Hz and center frequency 300Hz from a blackground noise. Design a bandpass filter having transition width 100Hz, passband ripple 40dB, stopband ripple 60dB. The sampling frequency is 1200Hz.

Solution

The passband of the signal is from 300 – 200/2 to 300 + 200/2, i.e. from 200Hz to 400Hz. We are to design a bandpass FIR filter to meet the specifications

• Passband: 200Hz
• Transition width: 100Hz
• Passband ripple: (20log10δp)=40dB(δp=0.01)(20log10δp)=40dB(δp=0.01) size 12{ $$- "20""log" rSub { size 8{"10"} } δ rSub { size 8{p} }$$ ="40""dB" matrix { } $$δ rSub { size 8{p} } =0 "." "01"$$ } {}
• Stopband ripple: (20 log 10 δ p )=60dB δ s =0.001 (20 log 10 δ p )=60dB δ s =0.001 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacIcacqGHsislcaaIYaGaaGimaiGacYgacaGGVbGaai4zamaaBaaaleaacaaIXaGaaGimaaqabaGccqaH0oazdaWgaaWcbaGaamiCaaqabaGccaGGPaGaeyypa0JaaGOnaiaaicdacaGGKbGaaiOqaiabgkDiElaaysW7cqaH0oazdaWgaaWcbaGaam4CaaqabaGccqGH9aqpcaaIWaGaaiOlaiaaicdacaaIWaGaaGymaaaa@5075@
• Sampling frequency: 1200Hz

From Table 5.2 see that only the Blackman window can satisfy the stopband ripple (so can the Kaiser window, see next subsection). Since the passband and stopband attenuations are different, we take the smaller one in the design, i.e. AA size 12{A} {}= 60dB. The transition width and the filter order are, respectively,

Δω = 100 1200 = π 6 Δω = 100 1200 = π 6 size 12{Δω=2π { {"100"} over {"1200"} } = { {π} over {6} } } {} M= 11.1π π/6 =66.667 M= 11.1π π/6 =66.667 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaad2eacqGH9aqpdaWcaaqaaiaaigdacaaIXaGaaiOlaiaaigdacqaHapaCaeaacqaHapaCcaGGVaGaaGOnaaaacqGH9aqpcaaI2aGaaGOnaiaac6cacaaI2aGaeyisISRaaGOnaiaaiEdaaaa@46C4@

Thus the Blackman window is

Ideal bandpass filter impulse response (Equation 5.10b)

where

ω u = 400 1200 = 3 ω u = 400 1200 = 3 size 12{ω rSub { size 8{u} } =2π { {"400"} over {"1200"} } = { {2π} over {3} } } {} ω l =2π 200 1200 = π 3 ω l =2π 200 1200 = π 3 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeGabiGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3naaBaaaleaacaWGSbaabeaakiabg2da9iaaikdacqaHapaCdaWcaaqaaiaaikdacaaIWaGaaGimaaqaaiaaigdacaaIYaGaaGimaiaaicdaaaGaeyypa0ZaaSaaaeaacqaHapaCaeaacaaIZaaaaaaa@4512@

Since M is odd we have linear phase type 2 (FIR-2) . The designed impulse response is

h ( n ) = h BP ( n ) w ( n ) h ( n ) = h BP ( n ) w ( n ) size 12{h $$n$$ =h rSub { size 8{ ital "BP"} } $$n$$ w $$n$$ } {}

We then take the inverse transform of h(n) to get or the frequency response of the designed filter (Fig.5.20).

### Example 3

Design a highpass FIR filter using Kaiser window to meet the specifications :

• Cutoff frequency 2,5 kHz
• Transition width 0.5 kHz
• Passband ripple 0.001
• Stopband attenuation 40dB
• Sampling frequency 10kHz

Solution

First let’s derive the expression of the impule response of ideal highpass filter (Fig.5.1b) with generalized linear phase (Fig.5.4) (Fig.5.1b) with generalized linear phase (Fig.5.4). The frequency response of the causal highpass filter in the interval ω=[0,π] ω=[0,π] MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3jabg2da9iaacUfacaaIWaGaaiilaiabec8aWjaac2faaaa@3D9D@ is

(12)

or related to the frequency response of the lowpass filter HLP(ω)HLP(ω) size 12{H rSub { size 8{ ital "LP"} } $$ω$$ } {}(Equation (5.32)) as

H HP ( ω ) = e j M 2 ω H LP ( ω ) H HP ( ω ) = e j M 2 ω H LP ( ω ) size 12{H rSub { size 8{ ital "HP"} } $$ω$$ =e rSup { size 8{ - j { {M} over {2} } ω} } - H rSub { size 8{ ital "LP"} } $$ω$$ } {}

Taking the inverse DTFT of either above expression we will get the impulse response of the ideal highpass filter

h (n) HP = sinπ(nM/2) π(nM/2) sin ω c (nM/2) π(nM/2) ,n0 1 ω c π ,n=0 h (n) HP = sinπ(nM/2) π(nM/2) sin ω c (nM/2) π(nM/2) ,n0 1 ω c π ,n=0 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOabaeqabaGaamiAamaaBeaaleaacaWGibGaamiuaaqabaGccaGGOaGaamOBaiaacMcacqGH9aqpdaWcaaqaaiGacohacaGGPbGaaiOBaiabec8aWjaacIcacaWGUbGaeyOeI0Iaamytaiaac+cacaaIYaGaaiykaaqaaiabec8aWjaacIcacaWGUbGaeyOeI0Iaamytaiaac+cacaaIYaGaaiykaaaacqGHsisldaWcaaqaaiGacohacaGGPbGaaiOBaiabeM8a3naaBaaaleaacaWGJbaabeaakiaacIcacaWGUbGaeyOeI0Iaamytaiaac+cacaaIYaGaaiykaaqaaiabec8aWjaacIcacaWGUbGaeyOeI0Iaamytaiaac+cacaaIYaGaaiykaaaacaGGSaGaaGzbVlaad6gacqGHGjsUcaaIWaaabaGaaGzbVlaaywW7caaMf8UaaGzbVlaaigdacqGHsisldaWcaaqaaiabeM8a3naaBaaaleaacaWGJbaabeaaaOqaaiabec8aWbaacaGGSaGaaGzbVlaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGjcVlaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGzbVlaaysW7caWGUbGaeyypa0JaaGimaaaaaa@8C3B@
(13)

Notice that we cannot just shift the result of the two-sided symmetric impulse response Equation (5.10a) to get the above causal result (but must replace δ(n)δ(n) size 12{δ $$n$$ } {} by sinπn/πnsinπn/πn size 12{"sin"πn/πn} {} before shifting).

The given specifications are interpreted as

• Cutoff frequency : ωc=2.510=0.ωc=2.510=0. size 12{ω rSub { size 8{c} } =2π { {2 "." 5} over {"10"} } =0 "." 5π} {} rad/sample
• Transition width : Δω=0.510=0.Δω=0.510=0. size 12{Δω=2π { {0 "." 5} over {"10"} } =0 "." 1π} {} rad/sample
• Passband ripple : δp=0.001δp=0.001 size 12{δ rSub { size 8{p} } =0 "." "001"} {}
• Stopband ripple : 20log10δ=4020log10δ=40 size 12{ - "20""log" rSub { size 8{"10"} } δ="40"} {}dB δs=0.01δs=0.01 size 12{ drarrow δ rSub { size 8{s} } =0 "." "01"} {}

Thus the attenuation is

A=20 log 10 [min( δ p , δ s )]=20 log 10 δ p =60dB A=20 log 10 [min( δ p , δ s )]=20 log 10 δ p =60dB MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiaadgeacqGH9aqpcqGHsislcaaIYaGaaGimaiGacYgacaGGVbGaai4zamaaBaaaleaacaaIXaGaaGimaaqabaGccaGGBbGaciyBaiaacMgacaGGUbGaaiikaiabes7aKnaaBaaaleaacaWGWbaabeaakiaacYcacqaH0oazdaWgaaWcbaGaam4CaaqabaGccaGGPaGaaiyxaiabg2da9iabgkHiTiaaikdacaaIWaGaciiBaiaac+gacaGGNbWaaSbaaSqaaiaaigdacaaIWaaabeaakiabes7aKnaaBaaaleaacaWGWbaabeaakiabg2da9iaaiAdacaaIWaGaaGjbVlaadsgacaWGcbaaaa@5B5B@

Knowing ΔωΔω size 12{Δω} {} and AA size 12{A} {} we can determine the window order

Since A>50A>50 size 12{A>"50"} {}dB, the ripple parameter ββ size 12{β} {} is given by

β = 0 . 1102 ( A 8 . 7 ) = 5 . 65 β = 0 . 1102 ( A 8 . 7 ) = 5 . 65 size 12{β=0 "." "1102" $$A - 8 "." 7$$ =5 "." "65"} {}

With M/2 =33 M/2 =33 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaamaalyaabaGaamytaaqaaiaaikdaaaGaeyypa0JaaG4maiaaiodaaaa@3A07@ and β=5.65 β=5.65 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabek7aIjabg2da9iaaiwdacaGGUaGaaGOnaiaaiwdaaaa@3B7A@ , the Kaiser window (Equation (5.40)) is

h ( n ) = h HP ( n ) w ( n ) h ( n ) = h HP ( n ) w ( n ) size 12{h $$n$$ =h rSub { size 8{ ital "HP"} } $$n$$ w $$n$$ } {}

As usual, the frequency response is the inverse DTFT of above impulse response.. Using Matlab we can simulate all the responses. ■

## Error in the Fourier design method

Let’s briefly consider the error in the Fourier design. Just like the Fourier series expansion of a signal (section 3.1), the Fourier design method give the least mean square (LMS) error as presented here. This also applies to the case of abupt truncation of the desired impulse , that is using the rectangular window. Let ε(ω) ε(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabew7aLjaacIcacqaHjpWDcaGGPaaaaa@3AB0@ be the error between the desired ideal frequency response H d (ω) H d (ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeadaWgaaWcbaGaamizaaqabaGccaGGOaGaeqyYdCNaaiykaaaa@3AF5@ and the designed frequency response H(ω) H(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaaaa@39D6@ :

ε(ω)= H d (ω)H(ω) ε(ω)= H d (ω)H(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabew7aLjaacIcacqaHjpWDcaGGPaGaeyypa0JaamisamaaBaaaleaacaWGKbaabeaakiaacIcacqaHjpWDcaGGPaGaeyOeI0IaamisaiaacIcacqaHjpWDcaGGPaaaaa@45A8@
(14)

This error varies with frequency and is a complex quantity , the same as the frequency response. We are interested in the error amplitude, so we take the square

|ε(ω) | 2 = Re 2 ε(ω)+ Im 2 ε(ω)=ε(ω) ε * (ω) |ε(ω) | 2 = Re 2 ε(ω)+ Im 2 ε(ω)=ε(ω) ε * (ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacqaH1oqzcaGGOaGaeqyYdCNaaiykaiaacYhadaahaaWcbeqaaiaaikdaaaGccqGH9aqpciGGsbGaaiyzamaaCaaaleqabaGaaGOmaaaakiabew7aLjaacIcacqaHjpWDcaGGPaGaey4kaSIaciysaiaac2gadaahaaWcbeqaaiaaikdaaaGccqaH1oqzcaGGOaGaeqyYdCNaaiykaiabg2da9iabew7aLjaacIcacqaHjpWDcaGGPaGaeqyTdu2aaWbaaSqabeaacaGGQaaaaOGaaiikaiabeM8a3jaacMcaaaa@5A11@
(15)

Since |ε(ω) | 2 |ε(ω) | 2 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacqaH1oqzcaGGOaGaeqyYdCNaaiykaiaacYhadaahaaWcbeqaaiaaikdaaaaaaa@3D99@ still depends on frequency, we then take its average value:

ε ¯ = 1 2π π π |ε(ω) | 2 dω= 1 2π π π ε(ω) ε * (ω)dω = 1 2π π π [ H d (ω) H(ω)] [ H d (ω)H(ω) ] 2 dω ε ¯ = 1 2π π π |ε(ω) | 2 dω= 1 2π π π ε(ω) ε * (ω)dω = 1 2π π π [ H d (ω) H(ω)] [ H d (ω)H(ω) ] 2 dω MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOabaeqabaGafqyTduMbaebacqGH9aqpdaWcaaqaaiaaigdaaeaacaaIYaGaeqiWdahaamaapedabaGaaiiFaiabew7aLjaacIcacqaHjpWDcaGGPaGaaiiFamaaCaaaleqabaGaaGOmaaaaaeaacqGHsislcqaHapaCaeaacqaHapaCa0Gaey4kIipakiaadsgacqaHjpWDcqGH9aqpdaWcaaqaaiaaigdaaeaacaaIYaGaeqiWdahaamaapedabaGaeqyTduMaaiikaiabeM8a3jaacMcaaSqaaiabgkHiTiabec8aWbqaaiabec8aWbqdcqGHRiI8aOGaeqyTdu2aaWbaaSqabeaacaGGQaaaaOGaaiikaiabeM8a3jaacMcacaWGKbGaeqyYdChabaGaaGzbVlaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGzbVlaaywW7caaMe8UaaGjbVlaaykW7cqGH9aqpdaWcaaqaaiaaigdaaeaacaaIYaGaeqiWdahaamaapedabaGaai4waiaadIeadaWgaaWcbaGaamizaaqabaGccaGGOaGaeqyYdCNaaiykaaWcbaGaeyOeI0IaeqiWdahabaGaeqiWdahaniabgUIiYdGccqGHsislcaWGibGaaiikaiabeM8a3jaacMcacaGGDbWaamWaaeaacaWGibWaaSbaaSqaaiaadsgaaeqaaOGaaiikaiabeM8a3jaacMcacqGHsislcaWGibGaaiikaiabeM8a3jaacMcaaiaawUfacaGLDbaadaahaaWcbeqaaiaaikdaaaGccaWGKbGaeqyYdChaaaa@9C3E@
(16)

The problem is to find H(ω) H(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaaaa@39D6@ so that the mean square error H(ω) H(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaaaa@39D6@ is smallest (i.e. least mean square - LMS). Because the frequency response H(ω) H(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaaaa@39D6@ can be expressed in term of the designed filter impulse response h(n) , we thus look for the filter impulse response for LMS error. To this end we take the derivative d ε ¯ /dh(n) d ε ¯ /dh(n) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadsgacuaH1oqzgaqeaiaac+cacaWGKbGaamiAaiaacIcacaWGUbGaaiykaaaa@3D60@ and equate it to zero to find the root of h(n) for the minimum ε ¯ ε ¯ MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiqbew7aLzaaraaaaa@37A1@ . After some mathematics (not presented here) , we will get the impulse response

(17)

This result means that when we start the design by evaluating the impulse response from the given (desired) filter frequency response then we will get the LMS error (i.e. no other design method can give a smaller mean square error) .

In LMS error we emphasized the large errors ( at local frequencies). This criterion is not always adopted , other criterion may be more privileged, such as the transition width must be as narrow as possible, or the error must be distributed evenly in both the passband and the stopband…

## Digital differentiator

In digital signal processing , sometimes we need to take the differentiation or integration of a signal . For example the differentiation (derivation) of displacement is speed, and the differentiation of speed is acceleration. It is interesting that the former can just be realized by a FIR filter or by an IIR filter, whereas the latter by an IIR filter. In this section we will discuss digital differentiators (Fig.5.2) designed by linear phase FIR-3 and FIR-4 associated with windowing. Other FIR design method , such as the optimal method discussed in the subsequent section , can also be used.

In an analog differentiator the output signal y(t) is related to the input signal x(t) by

On the other hand the derivative of the input x(n)= e jωn x(n)= e jωn MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIhacaGGOaGaamOBaiaacMcacqGH9aqpcaWGLbWaaWbaaSqabeaacaWGQbGaeqyYdCNaamOBaaaaaaa@3EF8@ is

By comparing the above two expressions we obtain

(18)

This is the frequency response of ideal digital differentiator. The response is purely imaginary, the magnitude response |H(ω)| |H(ω)| MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacaWGibGaaiikaiabeM8a3jaacMcacaGG8baaaa@3BD6@ is proportional to the frequency and the phase response Φ(ω) Φ(ω) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabfA6agjaacIcacqaHjpWDcaGGPaaaaa@3A83@ is π/2 π/2 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaamaalyaabaGaeqiWdahabaGaaGOmaaaaaaa@3872@ , independent of frequency (Fig.5.2) . Thus differentiators are generalized linear phase (Equation (5.17) with α=0,β=π/2 α=0,β=π/2 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabeg7aHjabg2da9iaaicdacaaMe8UaaiilaiaaysW7cqaHYoGycqGH9aqpdaWcgaqaaiabec8aWbqaaiaaikdaaaaaaa@4242@ ). Fig.5.21 shows the variation of |H(ω)| |H(ω)| MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacaWGibGaaiikaiabeM8a3jaacMcacaGG8baaaa@3BD6@ .

Even looked so simple but the such a differentiator cannot be realized exactly in practice . Thus approximate ciruits are used, the simplest of which is the first order differentiator which is just the difference

(19)

Its frequency response can be found to be

whose magnitude is

This is plotted in Fig.5.21 . The approximation is surprisingly good especially at low frequency. Notice that for small ,

Actually a differentiator is usually designed to use at the low frequency because the high response at high frequency will enhance noise. This again means that the simple first order differentiator is very good. The linear phase FIR filter implementing the differentiator is of FIR-4 type ( H(ω)=0 H(ω)=0 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaiabg2da9iaaicdacaaMe8oaaa@3D23@ atω=0and0atω=π atω=0and0atω=π MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadggacaWG0bGaaGjbVlabeM8a3jabg2da9iaaicdacaaMe8Uaamyyaiaad6gacaWGKbGaaGjbVlabgcMi5kaaicdacaaMe8UaamyyaiaadshacaaMe8UaeqyYdCNaeyypa0JaeqiWdahaaa@4EC2@ )

In order to reduce the high response at high frequency, the central differentiator is the candidate :

(20)

having frequency response

The magnitude response is

The response is also plotted in the same Fig.5.21. Notice also that H(ω)0 H(ω)0 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaiabgIKi7kaaicdaaaa@3C41@ at low ω ω MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3baa@37B0@ . The linear phase FIR filter implementing the differentiator is of FIR-3 type ( H(ω)=0 H(ω)=0 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaiabg2da9iaaicdaaaa@3B96@ at both ω=0 ω=0 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3jabg2da9iaaicdaaaa@3970@ and ω=π ω=π MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3jabg2da9iabec8aWbaa@3A73@ ).

### Example 4

For the ideal differentiator.

1. Find the expression of its two-sided impulse response . Evaluate and plot the response for M/2nM/2 M/2nM/2 MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiabgkHiTiaad2eacaGGVaGaaGOmaiabgsMiJkaad6gacqGHKjYOcaWGnbGaai4laiaaikdaaaa@3FAF@ with M = 20
2. Find the expression of its causal impulse response.
3. Design a differentiator using the Hamming window of length 21.

Solution

1. Taking the inverse DTFT of the known frequency response H(ω)=jω H(ω)=jω MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaiabg2da9iabgkHiTiaadQgacqaHjpWDaaa@3E85@ we will get the two-sided impulse response.

Because H d (ω) H d (ω) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadIeadaWgaaWcbaGaamizaaqabaGccaGGOaGaeqyYdCNaaiykaaaa@3AF5@ is an odd function while cosine is even and sine is odd, we only need to take the last term of the above expression:

h DIF (n)=j 1 2π π π H d (ω)sinωndω = 1 π 0 π ωsinωndω = cosnπ n ,n0 0,n=0 h DIF (n)=j 1 2π π π H d (ω)sinωndω = 1 π 0 π ωsinωndω = cosnπ n ,n0 0,n=0 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqabeaadaqaaqaaaOabaeqabaGaamiAamaaBaaaleaacaWGebGaamysaiaadAeaaeqaaOGaaiikaiaad6gacaGGPaGaeyypa0JaamOAamaalaaabaGaaGymaaqaaiaaikdacqaHapaCaaWaa8qmaeaacaWGibWaaSbaaSqaaiaadsgaaeqaaOGaaiikaiabeM8a3jaacMcaciGGZbGaaiyAaiaac6gacqaHjpWDcaWGUbGaamizaiabeM8a3bWcbaGaeyOeI0IaeqiWdahabaGaeqiWdahaniabgUIiYdGccqGH9aqpcqGHsisldaWcaaqaaiaaigdaaeaacqaHapaCaaWaa8qmaeaacqaHjpWDciGGZbGaaiyAaiaac6gacqaHjpWDcaWGUbGaamizaiabeM8a3bWcbaGaaGimaaqaaiabec8aWbqdcqGHRiI8aaGcbaqbaeqabeWaaaqaauaabeqabmaaaeaafaqabeqadaaabaaabaaabaaaaaqaaaqaaaaaaeaaaeaaaaqbaeqabeGaaaqaaaqaaaaafaqabeqacaaabaaabaaaaiaaysW7caaMe8UaaGjbVlaaysW7caaMc8Uaeyypa0ZaaSaaaeaaciGGJbGaai4BaiaacohacaWGUbGaeqiWdahabaGaamOBaaaacaaMe8UaaiilaiaaywW7caWGUbGaeyiyIKRaaGimaaqaaiaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGzbVlaaywW7caaMf8UaaGzbVlaaicdacaaMf8UaaiilaiaaywW7caWGUbGaeyypa0JaaGimaaaaaa@9D8B@
(21)

or

(22)

The last case is obtained by taking the original integral. Fig 5.22a depicts the impulse response which is of FIR-3.

2. We cannot just shift the noncausal result Equation (5.49a) M/2 time indices , i.e. by replacing n by n – M/2 , together the causal impulse response. Let’s start from the frequency response of a causal linear phase differentiator ( the two-sided response jω jω MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadQgacqaHjpWDaaa@389F@ is delayed by M/2 samples):

Taking the inverse transform to get the causal impulse response

(23)

When putting M/2 = 0 in above Equation we will get back Equation (5.49a) as expected.

In both impusle response (5.49a) and (5.50) we can notice that h D/F (n)= h D/F (Mn) h D/F (n)= h D/F (Mn) MathType@MTEF@5@5@+=feaagaart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIgadaWgaaWcbaGaamiraiaac+cacaWGgbaabeaakiaacIcacaWGUbGaaiykaiabg2da9iabgkHiTiaadIgadaWgaaWcbaGaamiraiaac+cacaWGgbaabeaakiaacIcacaWGnbGaeyOeI0IaamOBaiaacMcaaaa@4501@ , thus the differentiator is linear phase type 3 when M is even (Fig.5.4c) or type 4 when M is odd (Fig.5.4d).

3. Window length of 21 means M + 1 = 21 and the filter order is M = 20. We can use the two-sided impulse response in (a) and shift M/2 = 10 time indices to the future to get the causal response , or use the causal response in (b) . Fig.5.23a is the frequency response of the differentiator with truncation (equivalent to using rectangular window), Fig.5.23b is the frequency response of the differentiator when using the Hamming window. The optional method (later section) is a better method to design digital differentiator.

## Content actions

### Give feedback:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks