Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sept'05CS32911 CS3291 Sect 2: Review of analogue systems Example of an analogue system: Represent as “black box” R C y(t) x(t) y(t)

Similar presentations


Presentation on theme: "Sept'05CS32911 CS3291 Sect 2: Review of analogue systems Example of an analogue system: Represent as “black box” R C y(t) x(t) y(t)"— Presentation transcript:

1 Sept'05CS32911 CS3291 Sect 2: Review of analogue systems Example of an analogue system: Represent as “black box” R C y(t) x(t) y(t)

2 Sept'05CS32912 Linearity: (1)for any x(t), if x(t)  y(t) then ax(t )  ay(t) (2) for any x 1 (t) & x 2 (t), if x 1 (t)  y 1 (t) & x 2 (t)  y 2 (t) then x 1 (t) + x 2 (t)  y 1 (t) + y 2 (t)

3 Sept'05CS32913 Linearity: alternative definition For any x 1 (t) & x 2 (t), if x 1 (t)  y 1 (t) & x 2 (t)  y 2 (t) then a 1 x 1 (t) +a 2 x 2 (t)  a 1 y 1 (t) +a 2 y 2 (t) for any a 1 & a 2

4 Sept'05CS32914

5 Sept'05CS32915 Time-invariance : A time-invariant system must satisfy: for any x(t), if x(t)  y(t) then x(t-  )  y 1 (t-  ) for any  Delaying input by  seconds delays output by  seconds (Not all systems have this property) An LTI system is linear & time invariant.

6 Sept'05CS32916 Ex 2.1: Is it true that for all LTI systems, output has same shape as input? Answer: nope

7 Sept'05CS32917 2.2. Unit impulse:

8 Sept'05CS32918 Fundamental properties of unit impulse :

9 Sept'05CS32919 Sampling property of impulse

10 Sept'05CS329110 Proof of sampling property x(  )  (t-  ) = 0 except at  = t.  x(  )  (t-  ) = x(t)  (t-  ). It follows that:

11 Sept'05CS329111 Impulse-response:  (t) h(t) Impulse-response of RC circuit in Fig. 2.1 is:  0 : t < 0 h(t) =   (1/RC)e - t / R C : t  0

12 Sept'05CS329112 1/RC t h(t) Impulse-response of RC circuit. See Appendix A for proof.

13 Sept'05CS329113 Convolution x(t) y(t) LTI h(t ) x(t)  h(t)

14 Sept'05CS329114 Proof of formula for convolution:  (t)  h(t)  (t-  )  h(t-  ) (by time-invariance) x(  )  (t-  )  x(  )h(t-  ) (by linearity) x(t) x(t)  h(t) (by sampling property (convolution)

15 Sept'05CS329115 Ex 2.3: An LTI system has t h(t) 1 1 Calculate its response to sin(  t) Solution:

16 Sept'05CS329116 2.5: Properties of analogue LTI systems Stability: An LTI system is stable if h(t), satisfies:   |h(t)| dt < .  -  Causality: An LTI system is causal if h(t), satisfies: h(t) = 0 for t < 0 (No crystal ball!)

17 Sept'05CS329117

18 Sept'05CS329118 Consider response to x(t) = cos(  t) + j sin(  t) = e j  t Frequency response: Fourier transform of h(t). Complex number for any .

19 Sept'05CS329119 G(  ) =  H(j  )  is "gain response,  (  ) = Arg{H(j  )} is the "phase response". Therefore: H(j  ) = G(  )e j  (  ) As h(t) is real, H(-j  ) is complex conjugate of H(j  ).

20 Sept'05CS329120 Let input be A cos(  t) = real part of A e j  t We know that e j  t  e j  t H(j  ), Response to A cos(  t) will be: A. RE { e j  t H(j  ) } = A. RE { e j  t G(  ) e j  (  ) } = A. G(  ). RE { e j (  t +  (  ) ) } = A. G(  ). cos(  t +  (  ) ) = A. G(  ). cos(  (t -  ) ) where  = -  (  )/ 

21 Sept'05CS329121 Gain & phase response graphs G( 

22 Sept'05CS329122 Linear phase

23 Sept'05CS329123 Phase-response (cont) Meaning of phase-response not as obvious as ‘gain response’:  (  ) /  is ‘phase delay’ in seconds Ideal is to have same delay at all frequencies: linear phase. True if -  (  ) = T S  for all , where T S constant. All components of a Fourier series delayed by same time T S. Avoids changes in wave-shape due to ‘phase distortion’; i.e different frequencies being delayed by differently. Ear not very sensitive to phase distortion on normal telephones. Quite different wave-shapes can sound the same. But phase distortion of digital transmissions can be serious.

24 Sept'05CS329124 2.6: Inverse Fourier Transform: : 1   h(t) =   H(j  ) e j  t d  2   -  There are some interesting things to notice:- (1). Range of integration is -  to . (2). Differences between this formula & “forward” FT: (i) the (1/2  ) factor (ii) sign of j  t ( + for inverse, - for forward) (iii) variable of integration is d  for inverse transform & dt for forward.

25 Sept'05CS329125 Replacing s by j  gives H(s) = H(j  ) = freq-resp = Fourier transform of h(t). Fourier transform = Laplace transform with s = j . 2.7 Laplace transform Given analogue LTI system with impulse-response h(t). Response to x(t) = e st where s =  + j  is H(s) is "bilateral Laplace transform" of h(t). For causal system, H(s) becomes normal Laplace transform

26 Sept'05CS329126 For causal stable LTI system,... H(s) is finite for any s with real part  0.  H(s) cannot be infinite for values of s with real part  0  Proof: Consider |H(s)| for some value of s =  + j  with  > 0:

27 Sept'05CS329127 If x(t) = e st then y(t) = H(s)e st. Also dx(t)/dt = se st, d 2 x(t)/dt 2 = s 2 e s t, dy(t)/dt = sH(s)e st etc.  H(s)e st (b 0 +b 1 s+b 2 s 2 +...+b M s M ) = e st (a 0 + a 1 s + a 2 s 2 +... + a N s N ) i.e. a 0 + a 1 s + a 2 s 2 +... + a N s N H(s) =  b 0 + b 1 s + b 2 s 2 +... + b M s M 2.8. ‘System function’ for analogue LTI circuits: Relationship between input x(t) & output y(t):

28 Sept'05CS329128 2.9 Poles & zeros of H(s): Factorise numerator & denom of H(s) to obtain: (s-z 1 )(s-z 2 ).... (s-z N ) H(s) = K  (s-p 1 )(s-p 2 ).... (s-p M ) Poles: p 1, p 2,.... p M. Zeros: z 1, z 2,.... z N. H(s) normally zero at a zero infinite at a pole. For real system, poles & zeros real or in complex conj. pairs. Since H(s) must be finite for all s with real part  0, for causal stable system, no pole can have real part  0. On Argand diag, no poles can be on RHS or on imaginary axis. Poles are restricted to LHS. No such restrictions on zeros.

29 Sept'05CS329129 Real Part Imaginary part Poles must be on left of imag axis. Zeros can be anywhere Zero Pole Poles & zeros on real axis or in complex conjugate pairs Pole

30 Sept'05CS329130 2.10. Design of analogue filters Two stages given a frequency response specification: 1) Find realisable H(s) which approximates the specification: 2) Find circuit to realise H(s): Many design techniques for digital filters use the same approximations as are used for analogue filters. It is useful to review one of these.

31 Sept'05CS329131 2.10.1. Approximation stage for a low-pass analog filter: Ideal "brick-wall" gain response & linear phase response i.e  (  ) = arg(H(j  )) = -k    (  ) G(  ) 1 0 CC

32 Sept'05CS329132 Need expressions for G(  ) &  (  ) which are approximations to the ideal specification. Must correspond to the H(s) of a realisable circuit whose order is practically manageable. Concentrate on G(  ) first. Consider Butterworth approximation of order n: Properties (i) G(0) = 1 ( 0 dB gain at  =0) (ii) G(  C ) = 1/(  2) ( -3dB gain at  =  C ) (iii) When  >>  C, G(  )  (  C /  ) n (iv) G(  ) is maximally flat at  = 0 & at  = .

33 Sept'05CS329133 Examples of Butterwth low-pass gain responses Let  C = 100 radians/second & n = 2, 4, & 7. G(  C ) is always 1/  (2) Shape gets closer to ideal ‘brick-wall’ response as n increases. Common to plot G(  ) in dB, i.e. 20 log 10 (G(  )), against . With  on linear or log scale. As 20 log 10 (1/  (2)) = -3, all curves are -3dB when  =  C.

34 Sept'05CS329134 050100150200250300350400 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 radians/second G(  ) n = 2 n=4 n=7 1 /  (2) LINEAR-LINEAR PLOT

35 Sept'05CS329135 050100150200250300350400 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 dB radians/second -3dB dB-LINEAR PLOT n=2 n=4 n=7

36 Sept'05CS329136 10 0 1 2 3 -80 -70 -60 -50 -40 -30 -20 -10 0 dB radians/second dB-LOG PLOT n=2 n=4  3 dB

37 Sept'05CS329137 MATLAB program to plot these graphs clear all; for w = 1 : 400 G2(w) = 1/sqrt(1+(w/100)^4); G4(w) = 1/sqrt(1+(w/100)^8) ; G7(w) = 1/sqrt(1+ (w/100)^14); end; plot([1:400],G2,'r',[1:400],G4,'b',[1:400],G7,'k'); grid on; DG2=20*log10(G2); DG4=20*log10(G4); DG7=20*log10(G7); plot([1:400],DG2,'r',[1:400],DG4,'b',[1:400],DG7,'k'); grid on; semilogx([1:990], DG2,'r', [1:990], DG4, 'b’);

38 Sept'05CS329138 ‘ Cut-off’ rate This is best seen on a dB-Log plot By property (iii), cut-off rate is 20n dB per decade or 6n dB per octave at frequencies  much greater than  C. Decade is a multiplication of frequency by 10. Octave is a multiplication of frequency by 2. So for n=4, gain drops by 80 dB if frequency is multiplied by 10 or by 24 dB if frequency id doubled.

39 Sept'05CS329139 2.10.3 H(s) for nth order Butterworth low-pass approxn: 1 H(s) =  [n/2] (1+s/  C ) P  {1 + 2sin[(2k-1)  /2n]s/  C + (s/  C ) 2 } k=1 [n/2] is integer part of n/2, P=0 / 1 for n even/odd.  sign means ‘product’. Denominator is product of 1st & 2nd order polynomials in s. H(s) is often realised by analogue circuits. Can also be realised by IIR digital filters.

40 Sept'05CS329140 Examples

41 Sept'05CS329141 More Examples … and if  C  1 replace ‘s’ by ‘s /  C ’ in formula Not easy to show that replacing s by j  & taking modulus gives appropriate Butterwth G(  ). But it’s true!

42 Sept'05CS329142 2.10.4 Frequency-band transformations: Given H(s) for low-pass approxn with  C =1 (pass-band -1    1), we can produce the transfer functns of other useful approxns: Low-pass: s  s/  C Scales cut-off from1 to  C. High-pass: s  C /s H(  C /s) is high-pass with cut-off  C Band-pass: s  (s+p/s)/d where d =  U -  L & p =  U  L. Produces band-pass transfer function with cut-off  U &  L. Band-stop : s  d/(s+p/s) where d=  U -  L & p=  U  L

43 Sept'05CS329143 Examples: use of freq band transformations 1. Transform the 1st order Butterwth low-pass system function with 3 dB cut-off 1 radian/second: H(s) = 1 / (1+s) into a high-pass system fn with cut-off  C 2. Transform H(s) = 1/(1+s) into a band-pass (narrow-band) transfer fn with cut-off frequencies:  L = 2,  U = 3. 3. Transform H(s) = 1/(1+s) into a band-stop (narrow-band) transfer fn with cut-off frequencies:  L = 2,  U = 3. 4. Transform H(s) = 1/(1+s) to band-pass (broad-band) transfer fn with cut-off frequencies:  L = 2,  U = 9

44 Sept'05CS329144   G(  ) 1 G(  ) 1 CC 1 radian/s Low-pass with  C = 1 Low-pass Ideal Approximatn

45 Sept'05CS329145   G(  ) 1 G(  ) 1 CC LL UU High-pass Band-pass

46 Sept'05CS329146  G(  ) 1 LL UU Band-stop

47 Sept'05CS329147   G(  ) 1 LL UU Narrow-band (  U < 2  L ) Broad-band (  U > 2  L ) Two types of band-pass gain-responses LL UU G(  ) 1

48 Sept'05CS329148   G(  ) 1 LL UU Narrow-band (  U < 2  L ) Broad-band (  U > 2  L ) Three types of ‘band-stop’ gain-responses LL UU G(  ) 1

49 Sept'05CS329149   G(  ) 1 NN Notch All-pass Third type of ‘band-stop’ gain-response Yet another type of gain-response G(  ) 1

50 Sept'05CS329150 Comments: Given H(s) for low-pass gain-resp. with  C =1, freq-band transfns always work & must be used for narrow-band. ‘Broad-band’ band-pass & band-stop transfer fns can be obtained by combining low-pass & high-pass. ‘Notch’ gain-resp. is band-stop with very narrow stop-band. Used for ‘notching out’ sinusoidal tone at one frequency. All-pass gain-responses do nothing to magnitudes of sinusoids but can change their phases in useful ways.

51 Sept'05CS329151 2.11. Use of MATLAB for analogue filter design High level language for matrix operations & complex numbers. Ideal for studying & implementing signal processing operations. Variables declared automatically when first used. Each variable may be a matrix with complex elements. E.g.: X = [ 1 2 3 4 -5+3j ]; % Comment If semicolon omitted, print result of assignment. It is easy to generate sections of sine-waves. You need to know the sampling frequency f S in Hz. Can make f S = 1 Hz which means 1 sample every second).

52 Sept'05CS329152 Produce row matrix x containing 100 samples of 1/20 Hz sine- wave when f S = 1 Hz. Plot this as a graph: for n = 1:100 x(n) = sin(n*2*pi / 20); % 2  /20 radians/second end; plot(x); 0 10 203040 50 6070 8080 90100 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 seconds

53 Sept'05CS329153 Produce 100 samples of a 0.7 Hz sine-wave when f S = 10 Hz: fs = 10; f = 0.7; for n = 1:100 x(n) = sin(n*2*pi * f /fs ); end; plot( [1:100]/fs, x); 012345678910 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 seconds

54 Sept'05CS329154 Note: ‘ [1:100] / fs ’ is a row matrix [1, 2, …, 100] with each element divided by fs. Following example shows how a WAV file containing speech or music may be read in, listened to & plotted in sections. Sections may be processed and written to a second file. ‘Control-C’ will interrupt a running MATLAB program even when in a infinite loop.

55 Sept'05CS329155 clear all; [x, fs, nbits] = wavread('cap4th.wav'); SOUND(x,fs,nbits); for n=1:1000 y(n)=x(n+10000); end; plot([1:1000]/fs,y); wavwrite(y,fs,nbits,’newfile.wav’); 00.0050.010.0150.020.0250.030.0350.040.0450.05 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3

56 Sept'05CS329156 2.11.1 MATLAB Signal Processing toolbox: A set of functions available to user of MATLAB for: (i) carrying out operations on signal segments stored in row matrices (ii) evaluating the effect of these operations, (iii) designing analogue & digital filters. Some of these functions are as follows: are:

57 Sept'05CS329157 zplane(a,b)% Plot poles & zeros of H(s) on Argand diag. [a,b] = butter(n, wc,’s’)% H(s) for nth order analog Butterw % low-pass with cut-off wc. [a,b] = butter(n, wc, ‘high’,’s’);% High-pass analog Butterw. [a,b] = butter(n, [wL wU],’s’ );% Band-pass analog Butterw. [a,b] = butter(n, [wL wU],’stop’,’s’); % Band-stop.. freqs(a,b)% Plot analogue frequency-response H(j  ) when

58 Sept'05CS329158 Other analogue gain response approximations: [a,b] = cheby1(n, Rp,wc,’s’ ); % Low-pass Chebychev type 1. % Rp = pass-band ripple in dB. [a,b] = cheby2(n, Rs,wc,’s’ ); % Low-pass Chebychev type 2. % Rs = stop-band ripple in dB (Slight error in notes (‘discrete time’).

59 Sept'05CS329159 Examples:- 1. Use MATLAB to plot gain response of Butterwth type analog low-pass filter of order 4 with  C = 100 radians/second. for w = 1 : 400 G(w) = 1/sqrt(1+(w/100)^8) ; end; plot(G); grid on;

60 Sept'05CS329160 Result obtained:-

61 Sept'05CS329161 2. Using Signal Processing toolbox calculate coeffs of 3rd order Butt low-pass filter with  C = 5, & plot gain & phase resp. Solution: [a,b] = butter(3,5,’s’); freqs(a,b); Result obtained:- a = 0 0 0 125.0 b = 1.0 10.0 50.0 125.0

62 Sept'05CS329162

63 Sept'05CS329163 Postscript MATLAB goes not give H(s) with its denominator expressed in 2nd order sections as our earlier formula did. This is sometimes inconvenient. As an exercise, find out how to use MATLAB to produce H(s) in 2nd order sections.

64 Sept'05CS329164 2.7: Problems on Section 2: 2.1 Is it true that if a system is linear & its input is a sine-wave, its output must be a sine-wave? 2.2. If L 1 & L 2 are LTI with imp-responses h 1 (t) & h 2 (t), calculate imp-response of each arrangement below. Show that these 2 arrangements with input same x(t) produce same output y(t): 2.3. An LTI system has impulse response:  1 : 0  t  1 h(t) =   0 : otherwise Sketch its gain & phase responses.

65 Sept'05CS329165 2.4. An LTI system has impulse response:  1 : 1  t  2 h(t) =   0 : otherwise Sketch its gain & phase responses & compare with previous. 2.5.We wish to design an LTI system with impulse response:  cos (  0 t) : 0  t  2  /  0 h(t) =   0 : otherwise Is it stable and/or causal & what is its frequency-response? 2.6. Show that for stable system, H(j  ) cannot be infinite for any .

66 Sept'05CS329166 2.7. Calculate impulse-response of analogue filter with:  1 : |  |  1 radian/second H(j  ) =   0 : |  | >1 Why can this ideal filter not be realised as a practical circuit? 2.8. Write down inverse FT to give h(t) in terms of H(j  ). Split it into 2 integrals, & express H(j  ) in polar form. Show that when H(-j  ) = H*(j  ) for all  1   h(t) =   | H(j  ) | cos(  (  ) +  t )d  if  (  )= Arg [H(j  )]   0 Then show that if -  (  )/  = D for all , h(t) must be symmetric about t = D; i.e. h(D+t) = h(D-t) for all t. What does this tell us about the possibility of designing analog filters which are exactly linear phase?

67 Sept'05CS329167 2.9 An LTI analog crt has: H(s) = 1 / (1 + s) Give its gain & phase responses & its phase delay at  = 1. 2.10 Give H(s) for a Butterwth low-pass gain response with 3dB cut-off at 1 rad/sec, of order: (i) n=6 & (ii) n=7. 2.11. Can we design 4th order Butterwth lowpass filter with 3dB cut-off  C by cascading two identical 2nd order Butterwth low-pass filters? 2.12. Give H(s) for a Butterwth high-pass gain response with 3dB cut-off  C =2 & of order (i) n=2, (ii) n=3 and (iii) n=4. 2.13. Give H(s) for Butterwth band-pass approxn with  L =3 &  U = 4, of order (i) n=2, (ii) n=3, & (iii) n=4. This will involve 4th order denominator polynomials in s. 2.14 Convert the 4th order polynomials in previous question to product of two 2nd order polynomials in s. Hence express H(s) as product of 2nd order sections. Use MATLAB!

68 Sept'05CS329168 2.15. With 2nd order Butterwth low-pass prototype, use a frequency band transformn to derive H(s) for 4th order band-pass filter with  L =2 &  U =20. Express H(s) as product of 2 nd order sections using MATLAB. 2.16. Consider an easier approach to deriving H(s) for 4th order band-pass & band-stop filters where we express H(s) = H LP (s) H HP (s), i.e. product of a 2 nd order low-pass & a 2 nd order high-pass section. Repeat the 4 th order band-pass design exercises above by this method & use MATLAB to compare gain responses. The exercises have (i)  L =3,  U =4 ("narrow-band") and (ii)  L =2,  U =20 ("wide-band")

69 Sept'05CS329169 R R1R1 xy R 1 y =  x R + R 1 R C X(s) Y(s) 1/Cs Y(s) =  X(s) R + 1/Cs Appendix A: Analysis of RC circuit

70 Sept'05CS329170 Y(s) 1/Cs 1/(RC) H(s) =  =  =  X(s) R + 1/Cs s + 1/(RC) H(s) is Laplace transform of h(t). By tables, the Laplace transform of  0 : t < 0 1 x(t) =  is X(s) =   e - a t : t  0 s + a Replacing "a" by 1/RC:  0 : t < 0 h(t) =   (1/RC)e - t / R C : t  0


Download ppt "Sept'05CS32911 CS3291 Sect 2: Review of analogue systems Example of an analogue system: Represent as “black box” R C y(t) x(t) y(t)"

Similar presentations


Ads by Google