Basics on Digital Signal Processing
Total Page:16
File Type:pdf, Size:1020Kb
Basics on Digital Signal Processing z - transform - Digital Filters Vassilis Anastassopoulos Electronics Laboratory, Physics Department, University of Patras Outline of the Lecture 1. The z-transform 2. Properties 3. Examples 4. Digital filters 5. Design of IIR and FIR filters 6. Linear phase 2/31 z-Transform 2 N 1 N 1 j nk n X (k) x(n) e N X (z) x(n) z n0 n0 Time to frequency Time to z-domain (complex) Transformation tool is the Transformation tool is complex wave z e j e j j j2k / N e e With amplitude ρ changing(?) with time With amplitude |ejω|=1 The z-transform is more general than the DFT 3/31 z-Transform For z=ejω i.e. ρ=1 we work on the N 1 unit circle X (z) x(n) z n And the z-transform degenerates n0 into the Fourier transform. I -z z=R+jI |z|=1 R The DFT is an expression of the z-transform on the unit circle. The quantity X(z) must exist with finite value on the unit circle i.e. must posses spectrum with which we can describe a signal or a system. 4/31 z-Transform convergence We are interested in those values of z for which X(z) converges. This region should contain the unit circle. I Why is it so? |a| N 1 N 1 X (z) x(n) zn x(n) (1/zn ) n0 n0 R At z=0, X(z) diverges ROC The values of z for which X(z) diverges are called poles of X(z). 5/31 z-Transform example Which is the z-transform and the ROC of a discrete time sequence x(n)=an for n0 and a<1 ? x(n) 1 a I a2 a3 |a|a 4 n R N 1 X (z) x(n) zn ROCan z n (az1)n n0 n0 n0 -1 1 z which for |az |<1 or |z|>|a| converges to X (z) 1 az1 z a The pole z=a, is never included in the ROC 6/31 Poles and zeros of X(z) Poles: X(z)= Zeros: X(z)=0 For infinite sequences, X(z) converges everywhere outside the circle with radius the poleI with maximum value. For finite sequences, X(z) converges everywhere |a| except at z=0 x(n) 5 R 3 3 X(z) x(n)z n z 1 3z 2 5z 3 3z 4 z 5 1 1 n n ROC For stable, causal digital systems the region of convergence includes the Unit Circle so that the system possesses spectrum 7/31 z-Transform general form a a z1 a z2 a zN k(z z )(z z )(z z ) 0 1 2 N X (z) 1 2 N X (z) 1 2 M b0 b1z b2z bN z (z p1)(z p2 )(z pN ) Those values of z (zi) that make the nominator zero are called zeros. While the poles are the values of z (pi) that make the denominator zero and thus X(z) diverges. For stable, causal digital systems the region of convergence includes the Unit Circle so that the system possesses spectrum H(e jT ) H(z) h(n)z n h(n)e jT ze jT n ze jT n 8/31 Inverse z-Transform A simple way to evaluate the signal from the X(z) is to perform the division 1 2z 1 z 2 X(z) 1 z 1 0.356z 2 X(z) 1 3z 1 3.6439z 2 2.5756z 3 The signal is x(0)=1, x(1)=3, x(2)=3.6439, x(3)=2.5756 9/31 z-Transform properties x1(n) X1(z) Linearity x2 (n) X 2 (z) ax1(n) bx2 (n) aX1(z) bX 2 (z) x(n) X (z) Delay or Shift x(n m) zm X (z) Convolution y(n) h(k)x(n k) Y(z) H(z)X(z) k 10/31 z-Transform and digital systems N M y(n) ak x(n k) bk y(n k) k0 k1 x(n) x(n-1) x(n-2) x(n-Ν+1) x(n-Ν) Ts Ts Ts a0 a1 a2 aΝ-1 aΝ y(n) N + k ak z k0 H (z) N bΜ bΜ-1 b2 b1 k 1 bk z k1 T T T y(n-Μ) s y(n-Μ+1) y(n-2) s y(n-1) s 11/31 Digital system z-Transform derivation N M y(n) ak x(n k) bk y(n k) z-transform both sides k0 k1 N M n n n Interchange z y(n) z ak x(n k) z bk y(n k) summations n0 n0 k0 n0 k1 N M n n Y (z) ak z x(n k) bk z y(n k) Replace transforms k0 n0 k1 n0 N M Y (z) ak X (z k) bkY (z k) Shift property k0 k1 N M k k Common factors Y(z) ak z X(z) bk z Y(z) k0 k1 N M k k Y (z) X (z)ak z Y (z)bk z k0 k1 12/31 Digital system z-Transform derivation M N N M k y(nk) aCommonx(n k factors) b y(n k) Y (z) Y (z)bk z X (z)ak z k k k1 k0 k0 k1 M N x(n) x(n-1) x(n-2) x(n-Ν+1) x(n-Ν) Ts Ts k Ts k Y (z)(1 bk z ) X (z)ak z k1 k0 a0 a1 a2 aΝ-1 aΝ N k ak z Y (z) y(n) k0 Frequency N + H(z) X (z) k 1 bk z k1 bΜ bΜ-1 b2 b1 Ts Ts Ts Time y(n-Μ) y(n-Μ+1) y(n-2) y(n-1) 13/31 Application Find the impulse response h(n) and the input-output relationship of the filter described by 1 z 1 H(z) 1 0.5z 1 Examine the stability of the filter and find its frequency response. Solution -1 Y(z) 1 z 1 x(n) z H(z) X(z) 1 0.5z 1 1 1 Z1 -1 Y(z) 0.5Y(z)z X(z) X(z)z y(n) y(n) 0.5y(n 1) x(n) x(n 1) -0.5 y(n) x(n) x(n 1) 0.5y(n 1) z-1 h(n) is obtained from the terms of the polynomial which results after the division (1 z 1 ) / (1 0.5z 1 ) 11.5z 1 0.75z 2 0.375z 3 14/31 Application 1 Im 1 z H(z) Stable 1 0.5z 1 |z|=1 1 Re Frequency response using MATLAB 5 2 4.5 1.8 4 1.6 3.5 1.4 3 1.2 2.5 1 Phase Magnitude 2 0.8 1.5 0.6 1 0.4 0.5 0.2 0 0 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4 Frequency Frequency 15/31 Frequency on the Unit Circle π/2 or Fs/4 Im 1 z 1 H(z) z=e1jω0t .5z 1 |z|=1 π or Fs/2 0 Re The region from 0 to π corresponds to the region 0- Fs/2 of the Frequency response 16/31 Digital Filters •They are characterized by their Impulse Response h(n), their Transfer Function H(z) and their Frequency Response H(ω). •They can have memory, high accuracy and no drift with time and temperature. •They can possess linear phase. •They can be implemented by digital computers. 17/31 Digital Filters - Categories N M IIR y(n) a(k)x(n k) bk y(n k) k0 k1 N k ak z x(n) x(n-1) x(n-2) x(n-Ν+1) x(n-Ν) Ts Ts Ts k0 H(z) M 1 b z k k a a a a a k1 0 1 2 N-1 N y(n) + bΜ bΜ-1 b2 b1 T T T y(n-Μ) s y(n-Μ+1) y(n-2) s y(n-1) s 18/31 Digital Filters - Categories N N y(n) h(k)x(n k) a(k)x(n k) FIR k0 k0 N N k k H(z) ak z h(k)z k0 k0 x(n) x(n-1) x(n-2) x(n-Ν+2) x(n-Ν+1) Ts Ts Ts aΝ-2 ή a ή a0 ή a1 ή a2 ή Ν-1 h(0) h(1) h(2) h(Ν-2) h(Ν-1) y(n) + •Stable •Linear phase 19/31 Digital Filters - Examples a a z 1 a z 2 0 1 2 1.5 1 H(z) 1 2 1 b1z b2 z 0 1 a0=0.498, a1=0.927, -1 a2=0.498, b1=-0.674 b2=-0.363. 0.5 IIR Phase Magnitude IIR Magnitude -2 0 -3 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4 Frequency Frequency 11 1.5 4 H(z) h(k)z k 2 k0 1 0 h(1)=h(10)=-0.04506 0.5 FIR Phase h(2)=h(9)=0.06916 FIR Magnitude -2 h(3)=h(8)=-0.0553 0 -4 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4 h(4)=h(7)=-.06342 Frequency Frequency h(5)=h(4)=0.5789 20/31 IIR filter design Design using the Bilinear z-transform, BZT Design using the position of poles and zeros on the unit circle Fs/4 Im •The frequency response is zero at the points of zeros |z|=1 Fs/2 1 0 or Fs •The frequency response takes a peak at the position of poles.