Visit : www.EasyEngineeering.net
UNIT-I Discrete Fourier Transform (DFT) DFT is used for analyzing discrete time finite duration signals in the frequency domain. DFT is the method of obtaining finite samples from continuous frequency spectrum by the process of sampling.
This equation is called DFT analysis equation.
1 xn N
N 1
X k e
j 2kn / N
n 0,1,...N 1
k 0
This equation is called as DFT synthesis equation. Thus DFT and IDFT are collectively called as DFT pair. DFT
xn X (k ) IDFT
n- time index ; k- frequency index.
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Problems on DFT : Find the DFT for the sequence x(n)={1,-1,1,-1} Solution : Here Number of samples N=4 DFT of a N-Point sequence is given by
3
xn e j 2kn / 4 n 0
x0e0 x1e j 2k / 4 x2e j 2k *2 / 4 x3e j 2k *3 / 4 x0 x1e jk / 2 x2e jk x3e j 3k / 2 X k 1 e jk / 2 e jk e j 3k / 2 When k=0
X 0 1 e0 e0 e j 0 1 1 1 1 0 When k=1
X 1 1 e j / 2 e j e j 3 / 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
3 3 1 cos j sin cos j sin cos j sin 2 2 2 2 X 1 0 When k=2
X 2 1 e j e j 2 e j 3
1 cos j sin cos 2 j sin 2 cos 3 j sin 3 X 2 4 When k=3
X 3 1 e
j
3 2
e
j 3
e
j
9 2
3 3 9 9 1 cos j sin cos 3 j sin 3 cos j sin 2 2 2 2 X 3 0
X k 0 , 0, 4, 0
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Fast Fourier Transform (FFT) FFT is a highly efficient tool for computing the DFT with reduced number of calculation To achieve the dramatic increase in efficiency, it is necessary to decompose the DFT computation into successively smaller DFT computations.
Radix-r FFT ALGORITHM In an N- point sequence, N=rm; then the sequence can be decimated into rpoint sequences. For each r- point sequence, r-point DFT can be computed. From the results of r-point DFT, r2 –point DFTs are computed and the steps are repeated until rm –point DFT is computed. Radix-2 FFT ALGORITHM In an N- point sequence, N=2m; then the sequence can be decimated into 2point sequences. For each 2- point sequence, 2-point DFT can be computed. From the results of 2-point DFTs, 4–point DFTs are computed. From the results of 4-point DFTs, 8–point DFTs are computed and so on. NEED OF FFT ALGORITHM Number of calculations for Direct DFT No. of complex multiplication = N2 No. of complex addition = N(N-1) Number of calculations for FFT No. of complex multiplication = (N/2) log2N
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
No. of complex addition = Nlog2N
Comparison of No. of computation in Direct DFT and FFT Number of points N
Direct computation
Radix-2 FFT
Complex additions N(N-1)
Complex multiplications
2
12
16
4x log22 = 4x2=8
3
56
64
8x log22 = 8x3=24
4
240
256
16x log22 = 16x4=64
5
992
1024
32x log22 = 32x5=160
6
4032
4096
64x log22 = 64x6=384
7
16256
16384
128x log22 = 128x7=896
4 (=2 )
8 (=2 )
16 (=2 )
32 (=2 )
64 (=2 )
128(=2 )
2
Complex additions Nlog2N
N
2
3
4
5
6
7
Complex multiplication (N/2) log2N 2
(4/2) log22 = (4/2) x2=4 3
(8/2) log22 = (8/2) x3=12 4
(16/2) log22 = (16/2) x4=32 5
(32/2) log22 = (32/2) x5=80 6
(64/2) log22 = (64/2) x6=192 7
(128/2) log22 = (128/2) x7=448
GOAL OF AN EFFICIENT COMPUTATION The total number of computations should be linear rather than quadratic with respect to N. Most of the computations can be eliminated using the symmetry and periodicity properties
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
periodicity properties
W
kn N
k ( n N )
WN
(k N )n
WN
symmetry properties
kn N / 2
WNkn
WN
PHASE OR TWIDDLE FACTOR: Mathematical Representation of N- point DFT
Twiddle factor is defined as complex valued phase factor which is an N th root of unity.
e
j 2nk N
e
nk j 2 N
WNnk
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
CLASSIFICATION OF FFT ALGORITHM FFT can be performed either in Time Domain or Frequency Domain Accordingly ,FFT approach is divided into two algorithms Decimation in Time algorithm (DIT- FFT) Decimation in Frequency algorithm (DIF- FFT) DIT - FFT ALGORITHM DIT algorithm is used to calculate the DFT of a N-Point sequence In DIT, the time domain sequence x(n) is decimated and smaller point DFTs are performed. The results of smaller point DFTs are combined to get the result of Npoint DFT Initially the N-point sequence is divided into N/2 point sequences f1(n) or f2(n). f1(n) – odd numbered samples of x(n) f2(n) – even numbered samples of x(n)
8-point DFT using Radix-2 DIT - FFT Algorithm For 8 point sequence, N=8 = rm =23
here m=3 & r=2
Therefore, three stages of computations are needed and 8-point sequence is decimated into 4 numbers of 2-point sequences. Let x(n) = 8-point sequence f1(n), f2(n) = 4 point sequence obtained from x(n) v11(n), v12(n)= 2 point sequence obtained from f1(n) v21(n), v22(n)= 2 point sequence obtained from f2(n)
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Before decimation the input sequences are arranged in bit reversal order Normal order
Bit reversal order
X(0)
X(000)
X(0)
X(000 )
X(1)
X(001)
X(4)
X(100)
X(2)
X(010)
X(2)
X(010)
X(3)
X(011)
X(6)
X(110)
X(4)
X(100)
X(1)
X(001)
X(5)
X(101)
X(5)
X(101)
X(6)
X(110)
X(3)
X(011)
X(7)
X(111)
X(7)
X(111 )
THREE STAGES OF COMPUTATION IN 8-POINT DFT
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
FIRST STAGE COMPUTATION In the First stage of computation, 2-point DFTs of two point sequences are computed.
k=0 ;V11(0) = v11(0)W20 + v11(1)W20 = v11(0) + v11(1) = x(0) + x(4) k=1 ;V11(1) = v11(0)W20+ v11(1)W21 = v11(0) - v11(1) W20 = x(0) - x(4)
SECOND STAGE COMPUTATION In the second stage of computation, 4-point DFTs are computed using the results of first stage. F1(k) = V11(k) + W4k V12(k) ; for k= 0,1,2,3 k=0 ; F1(0) = V11(0) + W40 V12(0) ; k=1 ; F1(1) = V11(1) + W41 V12(1) k=2 ; F1(2) = V11(2) + W42 V12(2) = V11(0) _ W40 V12(0) k=3 ; F1(3) = V11(3) + W43 V12(3) = V11(1) _ W41 V12(1) Periodicity V11(k+2) = V11(k) ; V12(k+2) = V12(k)
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
THIRD STAGE COMPUTATION In the third stage of computation, 8-point DFTs are computed using the result s of second stage. X(k) = F1(k) + W8k F2(k) ; for k= 0,1,2,3,4,5,6,7 k=0 ; X(0) = F1(0) + W80 F2(0) ; k=1 ; X(1) = F1(1) + W81 F2(1) k=2 ; X(2) = F1(2) + W82 F2(2) ; k=3 ; X(3) = F1(3) + W83 F2(3) k=4 ; X(4) = F1(4) + W84 F2(4) = F1(0) _ W80 F2(0) k=5 ; X(5) = F1(5) + W85 F2(5) = F1(1) _ W81 F2(1) k=6 ; X(6) = F1(6) + W86 F2(6) = F1(2) _ W82 F2(2) k=7 ; X(7) = F1(7) + W87 F2(7) = F1(3) _ W83 F2(3) Periodicity F1(k+4) = F1(k) ; F2(k+4) = F2(k); F3(k+4) = F3(k); F4(k+4) = F4(k)
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
DIF - FFT ALGORITHM DIT - FFT algorithm is used to calculate the DFT of a N-Point sequence. In DIF, the N point time domain sequence x(n) is converted N/2 point sequences. Then each N/2 point sequence is converted to N/4 point sequences. This process is repeated until to get 2 point sequences. Finally the 2 point DFT of each 2 point sequence is computed to get N samples, which is the N point DFT of the time domain sequence.
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
DIFFERENCES in DIT and DIF ALGORITHM DIT- FFT Time domain decimated
sequence
DIF- FFT x(n)
is
Frequency domain sequence decimated
X(k) is
Input is in bit reversed order and Output in normal order
Input is in normal order and Output in bit reversed order
The complex multiplication WNnk takes place before add- subtract operation
The complex multiplication WNnk takes place after add- subtract operation
BASIC BUTTERFLY STRUCTURE OF DIF radix-2 FFT
8-point DFT using Radix-2 DIF - FFT Algorithm For 8 point sequence , N=8 = rm =23
here m=3 & r=2
Therefore, three stages of computations are needed. In each stages, input sequence is partitioned in power of 2 (21, 22 and 23 ).
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Let x(n) = 8-point sequence g1(n), g2(n) = 4 point sequence obtained from x(n) d11(n), d12(n) = 2 point sequence obtained from g1(n) d21(n), d22(n) = 2 point sequence obtained from g2(n) X(0), X(4) = 2 point DFT obtained from d11(n) X(2), X(6) = 2 point DFT obtained from d12(n) X(1), X(5) = 2 point DFT obtained from d21(n) X(3), X(7) = 2 point DFT obtained from d22(n) THREE STAGES OF COMPUTATION IN 8-POINT DFT
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
FIRST STAGE COMPUTATION In the First stage of computation, 2 numbers of 4 point sequence g1(n) and g2(n) are obtained
n=0 ; g1(0) = x(0) + x(4) n=3 ; g1(3) = x(3) + x(7)
n=1 ; g1(1) = x(1) + x(5)
n=2 ; g1(2) = x(2) + x(6)
n=0 : g2(0) = [x(0) - x(4)] W80 ; n=1 : g2(1) = [x(1) - x(5)] W81 ; n=2 :g2(2) = [x(2) - x(6)] W82 ; n=3 : g2(3) = [x(3) - x(7)] W83 ;
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
SECOND STAGE COMPUTATION In the second stage of computation, 2 numbers of 2 point sequences d11(n), d12(n) and d21(n), d22(n) are generated from g1(n) and g2(n) respectively. d11(n) = g1(n) + g1(n + N/4) = g1(n) + g1(n+2) ; for n= 0,1 n=0 ; d11(0) = g1(0) + g1(2)
n=1 ; d11(1) = g1(1) + g1(3)
d12(n) = [g1(n) - g1(n + N/4)] WN/2n = [g1(n) - g1(n+2)] W4n ; for n= 0,1 n=0 ; d12(0) = [g1(0) - g1(2)] W40 n=1 ; d12(1) = [g1(1) - g1(3)] W41 d12(n) = g2(n) + g2(n + N/4) = g2(n) + g2(n+2) ; for n= 0,1 n=0 ; d12(0) = g2(0) + g2(2)
n=1 ; d12(1) = g2(1) + g2(3)
d22(n) = [g2(n) – g2(n + N/4)] WN/2n = [g2(n) – g2(n+2)] W4n ; for n= 0,1 n=0 ; d22(0) = [g2(0) - g2(2)] W40 n=1 ; d22(1) = [g2(1) - g2(3)] W41
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
THIRD STAGE COMPUTATION In the third stage of computation, 2-point DFTs of 2 point sequences d11(n), d12(n), d21(n) and d22(n) are computed.
k=0 ; D11(0) = d11(0)W20 + d11(1)W20 = d11(0) + d11(1) Symmetry WNk+1= -WNk k=1 ; D11(1) = d11(0)W20+ d11(1)W21 = d11(0) W20 - d11(1) W20 = [d11(0) - d11(1)] W20
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
APPLICATION: It is extremely important in the area of frequency (spectrum) analysis; for eg:
voice recognition
digital coding of acoustic signals
detection of machine vibration
signal filtration
solving partial differential equations
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
UNIT II IIR FILTER The filters designed by considering all the infinite samples of impulse response are called IIR (Infinite Impulse Response) filters. In digital domain, the processing of infinite samples of impulse response is practically not possible. Hence direct design of IIR filter is not possible. Therefore, the IIR filters are designed via analog filter STEPS TO DESIGN IIR FILTER The specification of an IIR filter is transformed to specification of an analog filter. An analog filter with transfer function H(s) is designed to satisfy the specification. Then the analog filter is transformed to digital filter with transfer function H(z) The analog filter is designed by approximating the ideal frequency response using an error function. The popular solutions to the approximation problem of analog filter design are: 1. Butterworth approximation 2. Chebyshev approximation The analog filter with transfer function H(s) is transformed to digital filter with transfer function H(z) The popular transformation technique used to transform analog filter design to digital filter design are: 1. Impulse Invariant transformation 2. Bilinear transformation
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
COMPARISON OF DIGITAL AND ANALOG FILTER DIGITAL FILTER 1.
Operates on digital samples
ANALOG FILTER Operates on analog signals
2. Governed by Linear difference equation
Governed by Linear differential equation
3. Consists of adders, multipliers and delays implemented in digital logic
Consists of electrical components like resisters, capacitors & Inductors
4. The filter coefficients are designed to satisfy the desired frequency response
The approximation problem is solved to satisfy the desired frequency response
IMPULSE INVARIANT TRANSFORMATION The transformation of analog to digital filter without modifying the impulse response of the filter is called Impulse Invariant Transformation OBJECTIVE To preserve the frequency response characteristics of the analog filter, an IIR filter transfer function is developed whose impulse response is the sampled version of the impulse response of the analog filter. DERIVATION FOR IMPULSE INVARIANT TRANSFORMATION Let, h(t)= impulse response of analog filter Take Laplace transform of h(t) to get transfer function of analog filter Transfer function of analog filter, H(s) = L{h(t)} When H(s) has N no of distinct poles, it can be expressed by Partial Fraction Expansion N
H(s) =
Ai
s p i 1
i
AN A1 A2 s p1 s p2 s pN
1
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
On taking inverse Laplace transform of eqn 1 N
h(t) =
A e i 1
pi t
i
u (t ) A1 e p1 t u (t ) A2 e p2 t u (t ) AN e p N t u (t )
2
where, u(t) = continuous time unit step function Let, T = sampling period h(n) = Impulse response of digital filter The impulse response of the digital filter is obtained by uniformly sampling the impulse response of the analog filter h(t ) t nT h(nT )
h(n)
Therefore the impulse response h(n) can be obtained from eqn 2 by replacing t by nT N
h(t ) th(n) h(nT ) Ai e nT
pi nT
u (nT )
i 1
A1 e p1 nT u (nT ) A2 e p2 nT u (nT ) AN e p N nT u (nT )
3
On taking Z transform of eqn 3 we get,
Z e anT u (nT )
A1
1
H(z) = Z{h(n)}1 =e p T z 1 1
A2
1 1 e
p2T
z
1
1 1 e
aT
AN
z 1 N
1 1 e
pN T
z
Ai 1 i 1
1 1 e
pi T
z 1
4
Comparing eqn 1 and eqn 4 we can say
5
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
RELATION BETWEEN ANALOG & DIGITAL FILTER POLES From eqn 5 we say that the analog pole at s = pi is transformed in to a digital pole at z = e- pi T Consider the digital pole, z = e- pi T
6
Put, -pi=si in eqn 6 z = e-pi T = esi T
7
“si” is a point on s-plane with coordinates σi and jΩi si = σi + jΩi
8
Using eqn 8, eqn 7 can be, zi = e(σi + jΩi)T = eσi T e jΩi T
zi can be expressed in polar coordinates as, zi = zi zi ; zi
= eσi T and zi = e jΩi T 8
From eqn 8 the following observations can be 1. If σi<0 (neg), then the analog pole “si” lie on LHP of s-plane. In this case, zi <1, hence the corresponding digital pole “zi” will lie inside the unit circle in z-plane. 2. If σi=0, then the analog pole “si” lie on img axis of s-plane. In this case, zi =1, hence the corresponding digital pole “zi” will lie on the unit circle in z-plane. 3. If σi>0 (pos), then the analog pole “si” lie on RHP of s-plane. In this case, zi >1, hence the corresponding digital pole “zi” will lie outside the unit circle in z-plane
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
In general the impulse invariant transformation maps all points in the s-plane gn by si = σi + jΩi + j
, for k=0, ±1, ±2 ……
Into a single point in the z-plane as zi = e(σi + jΩi + j
)T
= eσi T e jΩi T e j2πk = eσi T e jΩi T
9
j2πk For integer k, e
=1
10
From eqn 9 & 10 we say that 1. The LHP of each strip in s-plane maps in to interior of the unit circle in z-plane 2. The RHP of each strip in s-plane maps in to exterior of the unit circle in z-plane 3. The imaginary axis of each strip in s-plane maps on the unit circle in z-plane
It is many-to-one mapping, where many points in s-plane are mapped to a single point in the z-plane. Example : Consider 2 poles in the s-plane with identical real parts, but with imaginary components differing by 2 . T
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Let the poles be s1 = σ + jΩ and s2 = σ + j
2k T
These poles map to z-plane poles z1 and z2 z1 = e(σ + jΩ)T = eσT e jΩT z2 = = eσ+j
= eσT e jΩT+j2π = eσT e jΩT
Example The s-plane poles having img parts greater than π/T or less than -π/T cause aliasing, when sampling analog signals. Solution There is no aliasing if the range of s-plane is confined within π/T The stability of the poles depends on location of the poles. For a stable analog filter the poles should lie on the LHP of the s-plane. Since LHP of s-plane maps inside the unit circle in z-plane we can say that for a stable digital filter the poles should lie inside the unit circle in z-plane .
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
RELATION BETWEEN ANALOG AND DIGITAL FREQUENCY Let, Ω= analog freq in rad/sec ω= digital freq in rad/sec Let, z = re jω be a point in s-plane and s = σ + jΩ be the corresponding point in s-plane Then by impulse invariant transformation, z = e sT
1
put, z = re jω and s = σ + jΩ in eqn 1 re
jω
= e (σ + jΩ)T = e σT e jΩT
2
On equating the phase on either side of eqn 2, we get Digital frequency, ω = ΩT or Analog frequency, Ω = ω /T
BILINEAR TRANSFORMATION It is a conformal mapping that transforms the imaginary axis of s-plane in to the unit circle in the z-plane only once, thus avoiding aliasing. In this mapping all points in the left half of s-plane are mapped inside the unit circle in the z-plane and all points in the right half of s-plane are mapped outside the unit circle in the z-plane. DERIVATION OF BILINEAR TRANSFORMATION Consider the first order differential equation of an analog system Let,
dy(t ) = x(t) dt
1
On integrating both sides of eqn 1 nT
( n 1)T
nT
dy(t ) dt x(t ) dt dt ( n 1)T Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
y(t )
nT
( n 1)T
nT
x(t ) dt
( n 1)T
nT
y(nT) - y((n-1)T)
x(t ) dt
2
( n 1)T
Integral on the right side of eqn 2 can be approximated by the trapezoidal rule y(nT) - y((n-1)T) = T [x(nT)+x(n-1)T)] 2
3
On discrete time system, the eqn 3 can be T y(n) - y((n-1)) = [x(n)+x(n-1))] 2
4
On taking Z transform of eqn 4 we get T Y(z) - z-1Y(z)] = [X(z) + z-1X(z)] 2
T 2
[1- z-1]Y(z) = [1 + z-1] X(z) 2(1 z 1 ) Y(z) = X(z) T (1 z 1 )
5
On taking Laplace transform of eqn 1 we get s Y(s) = X(s) On comparing eqn 5 & 6 we can write
where T is the sampling period
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
RELATION BETWEEN ANALOG & DIGITAL FILTER POLES s=
2(1 z 1 ) T (1 z 1 )
7
the eqn 7 can be rearranged as
On cross multiplying eqn 8 we get
In eqn 9, the variable s represent a point on s-planr & z is the corresponding point in z-plane sub si = σi + jΩi in eqn 9 we get T T ( i ji ) 1 i 2 2 zi T T 1 ( i ji ) 1 i 2 2
T i 2 T j i 2
1
j
10
1
2 2 T 2 T 1 i i 2 2 zi 2 T 2 T 1 i i 2 2
11
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
From eqn 11 the following observations can be 1. If σi<0 (neg), then the analog pole “si” lie on LHP of s-plane. In this case, <1, hence the corresponding digital pole “zi” will lie inside the unit circle in z-plane 2. If σi=0, then the analog pole “si” lie on img axis of s-plane. In this case, =1, hence the corresponding digital pole “zi” will lie on the unit circle in z-plane 3. If σi>0 (pos), then the analog pole “si” lie on RHP of s-plane. In this case, >1, hence the corresponding digital pole “zi” will lie outside the unit circle in z-plane
RELATION BETWEEN ANALOG & DIGITAL FREQUENCY 1 s = 2(1 z 1)
T (1 z )
put s = jΩ and z = e jω in the above eqn, we get Analog frequency,Ω =
2 tan T 2
12
from eqn 12, we get
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Digital frequency, ω = 2 tan 1
T 2
13
from eqn 12 & 13, we observe that For low freq, the relation between Ω and ω is linear ω ≈ ΩT For high freq, no longer linearity between Ω and ω is maintained. Rather the relation becomes tangential. ω = 2 tan 1 T 2
Fig shows relation between Ω and ω
Further, positive imaginary axis in s-plane is mapped to upper half of unit circle in zplane. Positive axis from Ω= 0 to ∞ is mapped to ω= 0 to π
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Negative imaginary axis in s-plane is mapped to lower half of unit circle in z-plane. Negative axis from Ω= -∞ to 0 is mapped to ω= -π to 0 This non-linear effect is called as frequency warping Let us interpret frequency warping graphically
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
It is clear that analog filter response consists of equally spaced & regular interval passband But the derived digital filter response whose centre frequencies and bandwidth got reduced disaproportionately. SOLUTION FOR FREQUENCY WARPING This non-linear effect can be eliminated by prewarping the analog filter STEPS 1. The specified digital frequencies are converted to analog equivalent. This analog frequency are called prewarp frequencies. 2. Using the prewarp frequencies, the analog filter transfer function is designed and then transformed to digital filter transfer function.
Conclusion Therefore Bilinear transformation preserves the magnitude response of an analog filter only if the specification requires piecewise constant magnitude. But the phase of the analog filter is not preserve
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
UNIT-III FIR FILTER DESIGN INTRODUCTION A Finite impulse response (FIR) is a filter whose impulse response is of finite duration FIR filter is mandatory since the operation performed in discrete time domain is equivalent to the processing of data in frequency domain using FFT algorithms. FIR filters usually have finite impulse response because it contains finite number of non zero values. Comparison of FIR and IIR filter: FIR filter
IIR filter
Impulse response is of finite duration
Impulse response is of infinite duration
All zero filters
All pole filters
FIR filters can be realized recursively and non recursively
FIR filters are recursively filters
No feedback is present
Presence of feedback
Linear Phase FIR Filters: In signal processing applications, it is mandatory to have a filter which has zero phase or linear phase.
Realization of Digital filters offering Nonlinear phase - Distort the signal
Realization of Digital filters offering zero phase (major problem )
Non casual filter
Realization of Digital filters offering Linear phase - Casual filter (Impossible in IIR but possible in FIR filter )
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Therefore, FIR filter is called as Linear phase FIR filter Consider a discrete time signal x(n) passed through a casual FIR filter The transfer function of casual FIR filter is given by N 1
H z hn z 1
1
n 0
h(n)-finite impulse response of the filter The frequency response of the filter is obtained by replacing z = e jω
hne
He
j
N 1
jn
2
n 0
Since frequency response is a complex quantity, it can be expressed as
H e j H e j e j
3
where
H e j
Magnitude response (constant)
()
Phase response (variable)
If the phase function Ɵ (ω) of a filter is a linear function of frequency then the filter is called Linear phase filter. To find the Linear and Non- Linear phase characteristics two delay functions are defined.
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
They are: Phase Delay Group Delay
Phase Delay Phase delay can be defined as negative ratio of phase and frequency of the filter
p
4
Group Delay Group delay can be defined as rate of decrease of phase response with respect to frequency
g
d d
5
To achieve the desired specification, Assume that phase of the frequency response H(ejω) is a direct function of frequency. Desired specification
-
FIR filter should offer linear phase response
i.e., Ɵ(ω) is directly proportional to ω
( )
( ) for Where α - constant phase delay in samples
p
p
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
g
d d g d d α is independent of frequency
p g Hence , FIR filters have constant phase delay and group delay
p g From the eqn 2 and eqn 3 we can write N 1
hn e
jn
H e j e j
6
n 0
Using the relation ( ) N 1
hn e
j n
the eqn 6 becomes
H e j e j
n 0
hn cos n j sin n H e cos j sin N 1
j
n 0
e j cos i sin
Separating the real and imaginary terms
hn cos n H e cos N 1
j
7
n 0
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
hn sin n H e sin N 1
j
8
n 0
Dividing eqn8 by eqn7 we get, N 1
hn sin n H e cos hn cos n H e j sin
n 0 N 1
j
n 0
N 1
hn sin n sin nN01 cos hn cos n n 0
Cross multiplying we get , N 1
N 1
n 0
n 0
hn cos n sin hn sin n cos N 1
hn sin cos n cos sin n 0
9
n 0
sin A B sin A cos B cos A sin B N 1
hn sin n 0
10
n 0
Eqn10 is valid only if
N 1 and h(n) =h(N-1-n) 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
N 1
N 1 n 2
hnsin n 0
N 1 2n h n sin 2 n 0 N 1
Proof N 1
N 1 n n 2
hn sin n 0
nn hn sin 2 n 0 N 1
N 1
hn sin 0 0 n0
The impulse response satisfying the equation h(n) = h(N-1-n) and
N 1 2
for odd and even values of N.
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Frequency Response of Linear phase FIR filters: There are 6 possible types of linear phase FIR filters: Case(i): Symmetric impulse response, when N is odd Case(ii): Symmetric impulse response, when N is even n
Case(iii): Antisymmetric impulse response, when N is odd Case(iv): Antisymmetric impulse response, when N is even Case(v): Symmetric impulse response when N is odd and centre of symmetry is n=0
Case(vi): Antisymmetric impulse response when N is odd and centre of symmetry is n=0 Case(i): Symmetric impulse response, when N is odd and n=(N-1)/2 The Fourier transform of h(n) is
hne
He
j
n 0
jn
1
Visit : www.EasyEngineeering.net
N 1 2
Visit : www.EasyEngineeering.net
Impulse response h(n) is real and finite defined over the range of 0 to N-1
hne
He
j
N 1
jn
2
n 0
The change in limits of summation is due to the presence of only N samples of h(n) when N is odd, symmetric impulse response have centre of symmetry at n
N 1 2
consider N=5, Samples defined are 0,1,2,3,4
n
5 1 4 2 2
n 2
Centre of symmetry
Now the eqn 2 becomes N 3 2
hne
He
j
jn
n 0
N 3 2
hne
He
j
n 0
jn
N 1 2
N 1 j h e 2
N 1 2
N 1 j h e 2
N 1
hne n
3
N 1 2
N 1
hne n
jn
jn
N 1 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Substituting the limit the eqn 3 becomes N 3 2
N 1 H e j hne jn h e 2 n 0
N 1 j 2
N 3 2
hN 1 me j N 1m m 0
Replacing m by n we get,
H e j
N 3 2
N 1 2
N 1 j hne jn h e 2 n 0
N 3 2
hN 1 ne j N 1n n 0
For symmetric impulse response, h(N-1-n) =h(n) N 3 2
N 1 H e j hne jn h e 2 n 0
N 1 j 2
N 3 2
hne j N 1n n 0
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
e
N 1 j 2
e
N 3 N23 N 1 N 1 2 j j N 1 jn 2 hn e j N 1n .e 2 h hn e . e 2 n 0 n 0
N 1 j 2
N 3 2
hn e n 0
N 1 j n 2
N 3 2
hne n 0
N 1 j N 1 n 2
N 1 h 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Substituting the limit the eqn 3 becomes
H e j e
N 1 j 2
N 1 2
N 1 h k 2 cos k 2 k 1
N 1 h 2
Replacing k by n we get, H e j e
N 1 j 2
N 1 2
N 1 2h n cosn 2 n 1
N 1 h 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Summary of frequecy response characteristics of linear phase FIR filter Impulse Response
Number of samples(N)
Magnitude Response
symmetric
Odd
symmetric
symmetric
Even
Anti symmetric
Anti symmetric
Odd
Anti symmetric
Anti symmetric
Even
symmetric
Summary of symmetric conditions Impulse Response
Number of samples(N)
Symmetric condition
symmetric
Odd
h(N-1-n) = h(n)
symmetric
Even
h(N-1-n) = h(n)
Anti symmetric
Odd
h(N-1-n) = - h(n)
Anti symmetric
Even
h(N-1-n) =- h(n)
symmetric
Odd
h(-n) = h(n)
Anti symmetric
Odd
h(-n) = -h(n)
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Summary of Magnitude response S.No
Nature of Impulse response
(i)
symmetric,N is odd with centre of symmetry at n=(N-1)/2
(ii)
(iii)
symmetric,N is even with centre of symmetry at n=(N-1)/2 Anti symmetric,N is odd with centre of anti symmetry at n=(N-1)/2
(iv)
Anti symmetric,N is even with centre of anti symmetry at n=(N-1)/2
(v)
symmetric,N is odd with centre of symmetry at n=0
(vi)
Antisymmetric,N is odd with centre of symmetry at n=0
Magnitude function
N 1 2
2h N21 n cosn h N21
H e j
n 0
N 2
2h N2 n cos n 12
H e j
n 1
N 1 2
2h N21 n sin n
H e j
n 1
N 2
1 N H e j 2h n sin n 2 2 n 1 N 1 2
H e j h0 2hn cosn n 1
N 1 2
2hnsin n
H e j
n 1
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Summary of Phase response and applications S.No (i)
(ii)
(iii)
(iv)
Nature of Impulse response symmetric,N is odd with centre of symmetry at n=(N1)/2
symmetric,N is even with centre of symmetry at n=(N1)/2 Anti symmetric,N is odd with centre of anti symmetry at n=(N-1)/2 Anti symmetric,N is even with centre of anti symmetry at n=(N-1)/2
Phase Response
0, H e 0 , H e 0
H e j j
j
0, H e 0 , H e 0
H e j j
Application Low pass, High pass,band pass and band stop filters Low pass and band pass filters
j
2 0, H e 0 , H e 0 H e j j
Hilbert Transformer differentiator
j
2 0, H e 0 , H e 0
Differentiator Hilbert Transformer
H e j j
j
(v)
symmetric,N is odd with centre of symmetry at n=0
0
Low pass, High pass,band pass and band stop filters
(vi)
Antisymmetric,N is odd with centre of symmetry at n=0
-π/2
Hilbert Transformer Differentiator
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
DESIGN OF FIR FILTERS USING WINDOWS WINDOW- The technique by which the small subset of total data is analysed and finally manipulated together. In signal processing, window function (also called as apodization function or tapering function) is a mathematical function that is zero valued outside the chosen interval. For a digital filter , the desired frequency response is given by
h n e
Hd e
j
n
j
1
d
This equation is periodic in frequency
1 hd n 2
H e e j
jn
d
2
Windows are defined as
W(n) = W(-n)
N 1 0 for n 2 N 1 0 for n 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Consider a response of a low pass filter
hd n is multiplied with Windows are defined as W(n) = W(-n)
N 1 0 for n 2 N 1 0 for n 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
The samples are defined at these instants only outside the window limits the values of samples gets zero since there is no overlap between hd(n) and w(n) On taking fourier transform for above signal
Dotted lines – ideal response of designed filter In order to have the reliability shift h(n) by α times where
N 1 2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Windows are used for truncating infinite series. These windows should posses the following desirable characteristics (i) The center lobe of frequency response should contain most of the energy and its must be narrow (ii) The highest side lobe level of frequency response should be small. (iii)The side lobes should decrease in energy rapidly as ω tends to π.
Types of Window There are different window functions 1. Rectangular window 2. Hamming window 3. Hanning window Rectangular window
N 1 N 1 1 for n to W R n 2 2 0 otherwiswe
Non causal filter
or
N 1 1 for n 0 to W R n 2 0 otherwiswe
causal filter
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Frequency spectrum of rectangular window
W R e j
N sin 2 sin 2
Hamming window
Non causal filter
2n N 1 N 1 for n to 0.54 0.46 cos W H n N 1 2 2 0 otherwiswe
Or causal filter
2n for n 0 to N 1 0.54 0.46 cos W H n N 1 0 otherwiswe
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Frequency spectrum of Hamming window
W H e j
N N N N N sin sin sin 2 2 N 1 2 N 1 0.54 0.23 0.23 sin sin sin 2 2 N 1 2 N 1
Hanning window Non causal filter
2n N 1 N 1 for n to 0.5 0.5 cos W Hn n N 1 2 2 0 otherwiswe
Or causal filter
2n for n 0 to N 1 0.5 0.5 cos W Hn n N 1 0 otherwiswe
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
Frequency spectrum of Hanning window
W Hn e j
N N N N N sin sin sin 2 2 N 1 2 N 1 0.5 0.25 0.25 sin sin sin 2 2 N 1 2 N 1
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
1
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
2
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
3
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
4
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
5
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
6
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
7
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
8
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
9
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
10
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
11
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
12
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
13
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
14
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
15
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
16
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
17
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
18
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
19
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
20
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
21
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
22
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
23
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
24
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
25
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
26
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
27
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
28
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
29
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
30
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
31
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
32
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
33
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
34
Musical Sound Processing
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
35
Visit : www.EasyEngineeering.net
Visit : www.EasyEngineeering.net
210 / PEC - CS2403 DSP
UNIT 5
APPLICATIONS
36
Visit : www.EasyEngineeering.net