ECE 8443 – PatternContinuous Recognition EE 3512 – Signals: and Discrete LECTURE 16: FOURIER ANALYSIS OF CT SYSTEMS • Objectives: Response to a Sinusoidal Input Frequency Analysis of an RC Circuit Response to Periodic Inputs Response to Nonperiodic Inputs Analysis of Ideal Filters • Resources: Wiki: The RC Circuit CN: Response of an RC Circuit CNX: Ideal Filters URL: Differential Equations • For CT systems, such as circuits, our principal tool is the differential equation. • For the circuit shown, we can easily compute the input/output differential equation using Kirchoff’s Law. Ri(t ) y (t ) x(t ) 0 dvC (t ) dy(t ) C dt dt dy(t ) RC y (t ) x(t ) 0 dt dy(t ) 1 1 y (t ) x(t ) dt RC RC i (t ) C EE 3512: Lecture 16, Slide 1 • What is the nature of the impulse response for this circuit? Numerical Solutions to Differential Equations • Consider our 1st-order diff. eq.: • We can replace n by n-1 to obtain: dy (t ) y[n] (1 aT ) y[n 1] bTx[n 1] ay (t ) bx (t ) dt • This is called the Euler approximation • We can solve this numerically by to the differential equation. setting t = nT: dy(t ) • With x[n] 0 n and initial condition, ay(nT ) bx(nT ) y[0] , the solution is: dt t nT • The derivative can be approximated: y[n] (1 aT) n y[0], n 0, 1, 2, ... dy(t ) y(nT T ) y(nT ) • The CT solution is: dt t nT T at y ( t ) e y(0), t 0 • Substituting into our diff. eq.: y (nT T ) y (nT ) • Later, we will see that using the ay (nT ) bx (nT ) T Laplace transform, we can obtain: • Let x(nT ) x[n] and y(nT ) y[n] : y[n] e anT y[0], n 0, 1, 2, ... y[n 1] y[n] ay[n] bx[n] T y[n 1] y[n] aTy[n] bTx[n] y[n 1] (1 aT ) y[n] bTx[n] EE 3512: Lecture 16, Slide 2 • But we can approximate this: a 2T 2 a 3T 3 aT e 1 aT ... 2 6 • Which tells us our 1st-order approximation is accurate! Higher-Order Derivatives • We can use the same approach for the second-order derivative: d 2 y (t ) dt t nT dy(t ) dt t nnT T dy(t ) dt t nnT T y (nT 2T ) 2 y (nT T ) y (nT ) T • Higher-order derivatives can be similarly approximated. • Arbitrary differential equations can be converted to difference equations using this technique. • There are many ways to approximate derivatives and to numerically solve differential equations. MATLAB supports both symbolic and numerical solutions. • Derivatives are quite tricky to compute for discrete-time signals. However, in addition to the differences method shown above, there are powerful methods for approximating them using statistical regression. • Later in the course we will consider the implications of differentiation in the frequency domain. EE 3512: Lecture 16, Slide 3 Series RC Circuit Example dy (t ) 1 1 y (t ) x(t ) dt RC RC Difference Equation: R=1;C=1;T=0.2; a=-(1-T/R/C);b=[0 T/R/C]; y0=0; x0=1; n=1:40; x=ones(1,length(n)); y1=recur(a, b, n, x, x0, y0); Analytic Solution: t=0:0.04:8; y2=1-exp(-t); y1=[y0 y1]; n=0:40; plot(n*T, y1, ’o’, t, y2, ’-’); EE 3512: Lecture 16, Slide 4 Example: RC Circuit dy (t ) 1 1 y (t ) x(t ) dt RC RC • Using our FT properties: jY 1 1 Y X ( ) RC RC 1 / RC Y ( ) X j 1 / RC Y ( ) 1 / RC H ( ) X j 1 / RC 1 / RC H ( ) 2 (1 / RC) 2 H ( ) t an1 RC • Compute the frequency response: RC = 0.001; W=0:50:5000; H=(1/RC)./(j*w+1/RC); magH=abs(H); angH=180*angle(H)/pi; EE 3512: Lecture 16, Slide 5 Response of an LTI System to a Sinusoid • Consider an LTI CT system with impulse response h(t): y(t ) h(t ) * x(t ) h( ) x(t )d • We will assume that the Fourier transform of h(t) exists: H ( ) h(t )e jt dt • The output can be computed using our Fourier transform properties: Y () H () X () and Y () H () X () Y () H () X () • Suppose the input is a sinusoid: x(t ) A cos(0 t ) • Using properties of the Fourier transform, we can compute the output: X ( ) A e j 0 e j 0 Y ( ) H ( ) X ( ) AH ( ) e j 0 e j 0 A H ( 0 )e j 0 H ( 0 )e j 0 A H ( ) e A H ( 0 ) e j H (0 ) e j 0 e j H (0 ) e j 0 0 0 e j H ( j H (0 ) 0 ) y (t ) F -1 Y ( ) A H ( 0 ) cos 0 t H ( 0 ) EE 3512: Lecture 16, Slide 6 0 Example: RC Circuit (Cont.) • We can compute the output for RC=0.001 and ω0=1000 rad/sec: y(t ) A(0.707) cos1000t 45 • We can compute the output for RC=0.001 and ω0=3000 rad/sec: y(t ) A(0.316) cos3000t 71.6 • Hence the circuit acts as a lowpass filter. Note the phase is not linear. • If the input was the sum of two sinewaves: x(t ) cos100t cos3000t describe the output. EE 3512: Lecture 16, Slide 7 Response To Periodic Inputs • We can extend our example to all periodic signals using the Fourier series: x(t ) a0 Ak cosk0 t k (a variantof the trigonometric Fourier series) k 1 • The output of an LTI system is: y(t ) a0 H 0 Ak H k0 cosk0 t k H k0 k 1 • We can write the Fourier series for the output as: y (t ) a Aky cos k 0 t ky y 0 k 1 where, a 0y a 0x H (0) Aky Akx H (k 0 ) ky kx H (k 0 ) also, 1 x Ak H (k 0 ) and c ky kx H (k 0 ) 2 • It is important to observe that since the spectrum of a periodic signal is a line spectrum, the output spectrum is simply a weighted version of the input, where the weights are found by sampling of the frequency response of the LTI system at multiples of the fundamental frequency, 0. c ky EE 3512: Lecture 16, Slide 8 Example: Rectangular Pulse Train and an RC Circuit • Recall the Fourier series for a periodic rectangular pulse: x(t ) a0 a k coskt k 1 where, sin k / 2 (k / 2) • Also recall the system response was: H ( ) a 0 0.5 a k • The output can be easily written as: y (t ) a Aky cos k 0 t ky y 0 k 1 where, a0y a0x H (0) 0.5 Aky Akx H (k 0 ) 2 k sin k / 2 1 / RC (k / 2) (k ) 2 (1 / RC) 2 1 / RC (k ) (1 / RC) 0 2 EE 3512: Lecture 16, Slide 9 2 k odd k even 1 / RC j 1 / RC Example: Rectangular Pulse Train (Cont.) • We can write a similar expression for the output: y(t ) a y 0 2 k k 1 k odd 1 / RC (k ) 2 (1 / RC) 2 coskt tan1 kRC 1/RC = 1 • We can observe the implications of lowpass filtering this signal. • What aspects of the input signal give rise to high frequency components? 1/RC = 10 • What are the implications of increasing 1/RC in the circuit? • Why are the pulses increasingly rounded for lower values of 1/RC? • What causes the oscillations in the signal as 1/RC is increased? EE 3512: Lecture 16, Slide 10 1/RC = 100 Response to Nonperiodic Inputs • We can recover the output in the time domain using the inverse transform: 1 j j jt y(t ) H ( e ) X ( e ) e d 2 • These integrals are often hard to compute, so we try to circumvent them using transform tables and combinations of transform properties. • Consider the response of our RC circuit to a single pulse: sin( / 2) ( / 2) 1 / RC H ( e j ) j 1 / RC X ( e j ) Y (e j ) X (e j ) H (e j ) sin( / 2) 1 / RC ( / 2) j 1 / RC • MATLAB code for the frequency response: RC=1; w=-40:.3:40; X=2*sin(w/2)./w; H=(1/RC)./(j*w+1/RC); Y=X.*H; magY=abs(Y); EE 3512: Lecture 16, Slide 11 Response to Nonperiodic Inputs (Cont.) • We can recover the output using the inverse Fourier transform: syms X H Y y w X = 2*sin(w/2)./w; H=(1/RC)./(j*w+1/RC); Y=X.*H; Y=ifourier(Y); ezplot(y,[-1 5]); axis([-1 5 0 1.5]) 1/RC = 1 1/RC = 1 1/RC = 10 EE 3512: Lecture 16, Slide 12 1/RC = 10 Ideal Filters • The process of rejecting particular frequencies or a range of frequencies is called filtering. A system that has this characteristic is called a filter. • An ideal filter is a filter whose frequency response goes exactly to zero for some frequencies and whose magnitude response is exactly one for other ranges of frequencies. • To avoid phase distortion in the filtering process, an ideal filter should have a linear phase characteristic. Why? H (e j ) t d for all ω in the filter passband • We will see this “ideal” response has some important implications for the impulse response of the filter. • Lowpass • Highpass • Bandpass • Bandstop EE 3512: Lecture 16, Slide 13 Ideal Linear Phase Lowpass Filter • Consider the ideal lowpass filter with frequency response: • Phase Response e jtd , B B H (e ) B, B 0 j • Using the Fourier transform pair for a rectangular pulse, and applying the time-shift property: h(t ) B sin c (t t d B • Is this filter causal? • The frequency response of an ideal bandpass filter can be similarly defined: e jtd , B1 B2 H (e ) elsewhere 0, j • Will this filter be physically realizable? Why? EE 3512: Lecture 16, Slide 14 • Impulse Response Summary • Showed that the response of a linear LTI system to a sinusoid is a sinusoid at the same frequency with a different amplitude and phase. • Demonstrated how to compute the change in amplitude and phase using the system’s Fourier transform. • Demonstrated this for a simple RC circuit. • Generalized this to periodic and nonperiodic signals. • Worked examples involving a periodic pulse train and a single pulse. • Introduced the concept of an ideal filter and discussed several types of ideal filters. • Noted that the ideal filter is a noncausal system and is not physically realizable. However, there are many ways to approximate ideal filters, and that is a topic known as filter design. EE 3512: Lecture 16, Slide 15