Communication Systems, 5e Chapter 3: Signal Transmission and Filtering A. Bruce Carlson Paul B. Crilly © 2010 The McGraw-Hill Companies Chapter 3: Signal Transmission and Filtering • • • • • • Response of LTI systems Signal distortion Transmission Loss and decibels Filters and filtering Quadrature filters and Hilbert transform Correlation and spectral density © 2010 The McGraw-Hill Companies Filter types • Low pass: • High pass: • Band pass: rejects high frequencies rejects low frequencies rejects frequencies above and below some limits • Notch: rejects one frequency • Band reject: rejects frequencies between two limits © 2010 The McGraw-Hill Companies Filter Design Notes • Butterworth Filter Definition – Poles on the unit circle – Frequency Scaling • Active Audio Filter Implementations – One Pole Op Amp design – Sallen-Key LPF Active Filter • 2-pole filter implementation per Op Amp (non-inverting) – Multiple Feedback (MFB) Circuit Lowpass Filter • Alternate 2-pole design (inverting) – Cascading stages for higher order filters • Texas Instruments, Active Low-Pass Filter Design, Application Report, SLOA049B • Passive LC filter – T and Pi Filters – Buy it from Coilcraft 4 Butterworth Low Pass Filter H jw H jw 1 1 w w0 2n Butterworth Filter Family 0 -20 2 1 1 s j w 0 1 2n 1 j s w0 1 1 1 s w0 n • 2n Attenuation (dB) Hs 2n 2n -40 -60 -80 -100 -120 -1 10 1st order 2nd order 3rd order 4th order 5th order 10 0 1 10 Frequency (normalized) 10 2 10 Maximally Flat, Smooth Roll-off, Constant 3dB point for all orders M.E. Van Valkenburg, Analog Filter Design, Oxford Univ. Press, 1982. SBN: 0-19-510734-9 5 3 Butterworth Filter PSD Butterworth Filter Family 0 Attenuation (dB) -20 -40 -60 -80 -100 -120 -1 10 1st order 2nd order 3rd order 4th order 5th order 10 0 1 10 Frequency (normalized) 10 2 10 3 6 Butterworth Filter PSD (2) Butterworth Filter Family 1 0 -1 Attenuation (dB) -2 -3 -4 -5 -6 -7 -8 -9 -1 10 1st order 2nd order 3rd order 4th order 5th order 10 Frequency (normalized) 0 7 Matlab Script: ButterPlot.m % % Butterworth filter plots % freqrange = logspace(-1,3,1024)'; wrange=2*pi*freqrange; [B1,A1]=butter(1,2*pi,'s'); [H1] = freqs(B1,A1,wrange); [B2,A2]=butter(2,2*pi,'s'); [H2] = freqs(B2,A2,wrange); [B3,A3]=butter(3,2*pi,'s'); [H3] = freqs(B3,A3,wrange); [B4,A4]=butter(4,2*pi,'s'); [H4] = freqs(B4,A4,wrange); figure(1) semilogx(freqrange,dB(psdg(Hmatrix))); grid title('Butterworth Filter Family'); xlabel('Frequency (normalized)'); ylabel('Attenuation (dB)'); legend('1st order','2nd order','3rd order','4th order','5th order','Location','SouthWest'); axis([10^-1 10^3 -120 3]); figure(2) semilogx(freqrange,dB(psdg(Hmatrix))); grid title('Butterworth Filter Family'); xlabel('Frequency (normalized)'); ylabel('Attenuation (dB)'); legend('1st order','2nd order','3rd order','4th order','5th order','Location','SouthWest'); axis([10^-1 3 -9 1]); [B5,A5]=butter(5,2*pi,'s'); [H5] = freqs(B5,A5,wrange); Hmatrix=[H1 H2 H3 H4 H5]; 8 Chebyshev Type I Filter PSD (Cheby1Plot.m) Chebyshev Type I Filter Family 0 Attenuation (dB) -20 -40 -60 -80 -100 -120 -1 10 1st order 2nd order 3rd order 4th order 5th order 10 0 1 10 Frequency (normalized) 10 2 10 3 9 Chebyshev Type I Filter PSD (2) Chebyshev Type I Filter Family 1 0 -1 Attenuation (dB) -2 -3 -4 -5 -6 -7 -8 -9 -1 10 1st order 2nd order 3rd order 4th order 5th order 10 Frequency (normalized) 0 10 Available MATLAB Filters (Signal Proc. TB) • Analog or Digital – – – – – Butterworth Chebyshev Type I Chebyshev Type II Elliptic or Cauer Bessel • Digital – – – – – – – – – – – – – – – – barthannwin bartlett blackman blackmanharris bohmanwin chebwin flattopwin gausswin hamming hann kaiser nuttallwin parzenwin rectwin triang tukeywin 11 Analog Lowpass Filter Design Filter Comparison: Magnitude 20 • Butterworth – Monotonic Decreasing Magnitude – All poles • Chebyshev (Cheby Type 1) – Passband Ripple – All poles • Inverse Chebyshev (Cheby Type2) – Stopband Ripple • Elliptical or Cauer Filter – Passband Ripple – Stopband Ripple • Bessel Filter – Linear Phase Maximized Butter Bessel Cheby1 Cheby2 Ellip Spec 0 -20 -40 -60 -80 -100 -120 -140 -160 1 10 10 2 10 3 Butterworth Order Predication Filter Order = 4 3dB BW = 1778.28 Hz Bessel Order Predication Filter Order = 4 3dB BW = 1778.28 Hz Chebyshev Type I Order Predication Filter Order = 3 3dB BW = 1000 Hz 10 4 10 5 10 6 10 Chebyshev Type II Order Predication Filter Order = 3 3dB BW = 8972.85 Hz Elliptical or Cauer Order Predication Filter Order = 3 3dB BW = 1000 Hz 12 7 Matlab Filter Generation (1) • • • • Passband Stopband Passband Ripple (dB) Stopband Ripple (dB) • • • • • fpass=4000; fstop=16000; AlphaPass=0.5; AlphaStop=60; w#### = 2 x pi x f#### Filter Order and other design parameters [Nbutter, Wnbutter] = buttord(wpass, wstop, AlphaPass, AlphaStop,'s'); [Ncheby1, Wncheby1] = cheb1ord(wpass, wstop, AlphaPass, AlphaStop,'s'); [Ncheby2, Wncheby2] = cheb2ord(wpass, wstop, AlphaPass, AlphaStop,'s'); [Nellip, Wnellip] = ellipord(wpass, wstop, AlphaPass, AlphaStop,'s'); 13 Matlab Filter Generation (2) Filter Transfer Function Generation [numbutter,denbutter] = butter(Nbutter,Wnbutter,'low','s') [numbesself,denbesself] = besself(Nbutter,Wnbutter) [numcheby1,dencheby1] = cheby1(Ncheby1,AlphaPass, Wncheby1,'low','s') [numcheby2,dencheby2] = cheby2(Ncheby2,AlphaStop, Wncheby2,'low','s') [numellip,denellip] = ellip(Nellip,AlphaPass,AlphaStop, Wnellip,'low','s'); Spectral Response from Transfer Function [Specbutter]=freqs(numbutter,denbutter,wspace); [Specbesself]=freqs(numbesself,denbesself,wspace); [Speccheby1]=freqs(numcheby1,dencheby1,wspace); [Speccheby2]=freqs(numcheby2,dencheby2,wspace); [Specellip]=freqs(numellip,denellip,wspace); 14 Matlab Filter Generation (3) figure(11) semilogx((fspace),dB(psdg([Specbutter Specbesself Speccheby1 Speccheby2 Specellip])), ... specfreq1,specmag1,'k-.',specfreq2,specmag2,'k-.',specfreq3,specmag3,'k-.'); title('Filter Comparison: Magnitude') legend('Butter','Bessel','Cheby1','Cheby2','Ellip','Spec') Filter Comparison: Magnitude 20 Butter Bessel Cheby1 Cheby2 Ellip Spec 0 -20 -40 -60 -80 -100 -120 -140 -160 1 10 2 10 3 10 4 10 5 10 6 10 7 10 15 Using the results Run using AnalogFilterCompare Butterworth Filter Bode Plot 50 Magnitude (dB) %% % Analog Filter Comparisons % clear close all clc 0 -50 -100 -150 fprintf('\nFilter Comparison\n'); fftsize=4096; fpass= 4000; fstop= 16000; AlphaPass=0.5; AlphaStop=60; Phase (deg) -200 0 -180 -360 -540 10 3 10 4 10 5 10 6 Frequency (rad/s) Butterworth Order Predication Filter Order = 6 3dB BW = 5059.64 Hz hbutter = 1.0323e+27 -------------------------------------------------------------------------------------(s^2 + 6.141e04s + 1.011e09) (s^2 + 4.496e04s + 1.011e09) (s^2 + 1.646e04s + 1.011e09) 16 Using the Results Butterworth Order Predication Filter Order = 6 3dB BW = 5059.64 Hz Bessel Order Predication Filter Order = 6 3dB BW = 5059.64 Hz Chebyshev Type I Order Predication Filter Order = 5 3dB BW = 4000 Hz Chebyshev Type II Order Predication Filter Order = 5 3dB BW = 11641.8 Hz Elliptical or Cauer Order Predication Filter Order = 4 3dB BW = 4000 Hz Build a 6th Order Sallen-Key Butterworth Low Pass Filter • 3 dB cutoff 5.05964 kHz [numbutter,denbutter] = butter(Nbutter,Wnbutter,'low','s') roots(denbutter) % Get the roots of the denomenator ans = 1.0e+04 * -0.8228 + 3.0707i -0.8228 - 3.0707i -2.2479 + 2.2479i -2.2479 - 2.2479i -3.0707 + 0.8228i -3.0707 - 0.8228i 17 Determine Poles • 6 poles: three complex pole pairs – Determine the roots on the unit circle. – Multiply by the cutoff frequency – Determine 2nd order coefficients w and LPFPoles = 1.0e+004 * -0.8228 + 3.0707i -0.8228 - 3.0707i -2.2479 + 2.2479i -2.2479 - 2.2479i -3.0707 + 0.8228i -3.0707 - 0.8228i Carbitrary Vout s K w2 2 Vins s a j b s a j b s 2 w s w2 2 w 2 a w2 a 2 b 2 18 The Pole Pairs LPFPoles = K1 w 2 2 H 1 s 2 s + 6.141e04 s + 1.011e09 s 2 1 w s w2 Carbitrary 1.0e+004 * -0.8228 + 3.0707i -0.8228 - 3.0707i -2.2479 + 2.2479i -2.2479 - 2.2479i -3.0707 + 0.8228i -3.0707 - 0.8228i K 2 w2 2 H 2 s 2 s + 4.496e04 s + 1.011e09 s 2 2 w s w2 Carbitrary K 3 w2 H 3 s 2 2 s + 1.646e04 s + 1.011e09 s 2 3 w s w2 Carbitrary Solve for the damping factors … ζ1, ζ2, and ζ3 The value of w2 is given. 19 Determine Rs and Cs C2 Let R=10 kohm Find C and R4 +Vdc R1 R2 V1 + - C1 C1 C 2 C Vout MaxGain K -Vdc w R1 R2 R3 R R3 R 4 K R3 OPAmp R4 R3 R3 R 4 R3 1 CR 3 K 2 1 R3 R 4 Vout s K w2 R3 C1 C 2 R1 R 2 2 R4 V 1s s 2 w s w2 1 1 1 R3 s 2 s C 2 R1 C 2 R 2 C1 R 2 C1 C 2 R1 R 2 20 Collect Results Sallen-Key LPF Design Summary Filter Gain = 4.20476, Filter Gain (dB) = 12.4748 Stage R C R3 R4 Gain 1 10.0 kohm 3145.6 pF 10.0 kohm 0.6815 kohm 1.07 2 10.0 kohm 3145.6 pF 10.0 kohm 5.8579 kohm 1.59 3 10.0 kohm 3145.6 pF 10.0 kohm 14.8236 kohm 2.48 21 The Easier Way • see BW_SKLPF_Gen.m %% % BW Filter generation demonstration % close all clear all clc BW Goal Final 0 Magnitude (dB) BWn=6; % Butterworth Filter Order PB_Hz=5059.64 ; % 3dB BW Derived from AnalogLPFCompare PBfreq=2*pi*PB_Hz; … After execution you get: Sallen-Key LPF Design Summary Butterworth SK LPF with Fc = 5.05964 kHz and Gain = 12.47 dB 50 -50 -100 Filter Gain = 4.20476, Filter Gain (dB) = 12.4748 -150 Stage R C R3 R4 Gain 1 10.0 kohm 3145.6 pF 10.0 kohm 0.6815 kohm 1.07 2 10.0 kohm 3145.6 pF 10.0 kohm 5.8579 kohm 1.59 3 10.0 kohm 3145.6 pF 10.0 kohm 14.8236 kohm 2.48 -200 10 0 10 1 10 2 10 3 10 4 10 5 Freq (Hz) 22 10 6 Check the Spice Design 23 The Spectral Plot 24 Taking it to the next level What resistors are actually available? What Capacitors are actually available? • Standard “E-Series” Values for resistors and capacitors: – selected to be evenly spaced logarithmically across one decade – typically related to value tolerance (+/- % accuracy) where a value is available within the tolerance – Example” E3 has three values available (10, 22, 47) • Normally think in 10%, 5%, or 1% tolerance – E12 – for 10%, E24 for 5%, and E96for 1% http://www.vishay.com/docs/28372/e-series.pdf 25 Matlab Code • AnalogFilterCompare.m • BW_SKLPG_Gen.m – subroutines • Additional Resources – Dr. Bazuin’s Filter Notes – on web site – Dr. Bazuin’s Draft Filter Manual – for ECE 4810 folks (or pre 4810) see me 26 Pulse Response and Risetime • Low Pass Filters cause sharp signal edges to be smoothed. • The amount of smoothing is based on the bandwidth of the filter – More smoothing smaller bandwidth • Fourier relationship: – a narrow rect function in time results in a broad (wide bandwidth) sinc function in frequency – a wide rect function in time results in a narrow (small bandwidth) sinc function in frequency 27 Filter Step Response • 1 Hz and 10 Hz 4th order Butterworth LPF Filters • The step response can be used to help define the bandwidth required for pulse signals. Butterworth Filters Step Response 0 1.4 1.2 1 -40 Amplitude Attenuation (dB) -20 -60 0.8 0.6 -80 0.4 -100 0.2 1 Hz 10 Hz -120 -1 10 10 0 1 Hz 10 Hz 1 2 10 10 Frequency (normalized) 10 3 10 4 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Time (sec) 28 1.8 Filter Bandwidth for Pulses • Pulse of length T t rect T sin cf T T 2 1.5 1 • Null-to-null BW of 2 null to null T • Single Sided BW desired B 0.5 0 -3 -2 -1 0 1 2 3 1 T • B/2 may be acceptable in some cases – See textbook discussion 29 Pulse Filtering Butterworth Filters 20 2.5 5.0 10. 20. 0 -20 Hz Hz Hz Hz • • Attenuation (dB) -40 Four one-sided BW filters 0.1 sec pulse responses -60 -80 Butterworth Filters -100 1.2 Test Signal 2.5 Hz 5.0 Hz 10. Hz 20. Hz -120 1 -140 0 10 20 30 40 50 60 70 Frequency (fs = 100 Hz) 80 90 Amplitude (dB) -160 0.8 100 0.6 0.4 0.2 PulseTest1.m (digital filters) 0 -0.2 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (fs=100Hz) 0.7 0.8 0.9 1 30 Text Comparison Chart (2.5, 5.0 and 20 Hz Plots) Pulse response of an ideal LPF Figure 3.4-10 See PulseTest2.m or PulseTest3.m (digital filters) Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 31 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Pulse resolution of an ideal LPF. B = 1/2 See Fig03_4_11.m (Butterworth filters) The inherent time delay has been removed from the output 32 Pulse Resolution: Matlab • Using a 1st order and 6th order Butterworth Filter – The text uses an “ideal filter” – Filters have group and phase delay! Linear Simulation Results Amplitude 1 0.5 0 0 0.5 1 1.5 2 2.5 3 2 2.5 3 Time (sec) Linear Simulation Results Amplitude 1 0.5 0 0 0.5 1 1.5 Time (sec) 33 The Hilbert Transform • It is a useful mathematical tool to describe the complex envelope of a real-valued carrier modulated signal. – Make a real signal complex complex Positive frequency • The precise definition is as follows: 1 1 x d x̂ t x t t t h Q t 1 t xHilbert t xt j xˆ t j, H Q f j sgn f 0, j f 0 f 0 0f H Q f H Q f H Q f 1 2 http://en.wikipedia.org/wiki/Hilbert_transform * 34 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Hilbert transform of a rectangular pulse (a) Convolution; (b) Result in time domain y t xt j xˆ t 35 Hilbert Transform of Cos x t A cos2 f 0 t A f f 0 f f 0 H Q f 2 A j f f 0 f f 0 2 X̂f x̂ t A sin 2 f 0 t • This is useful in generating a complex signal from a real input signal as follows … 36 Real to Complex Conversion t x t x t yt x t j x̂ t 1 t x̂ t 37 Real to Complex Mixing • Analog Devices AD8347: 0.8 GHz to 2.7 GHz Direct Conversion Quadrature Demodulator – RF input and LO input – Quadrature Output 38 Hilbert Transform Real to Complex Conversion • Original Real xt X f • Hilbert Transform Complex htct xt j xˆ t X f j j sgn f X f htct xt j xˆ t X f sgn f X f 2 X f , htct xt j xˆ t 0, for f 0 for f 0 The Hilbert Transform can be used to create a single sided spectrum! The complex representation of a real signal. 39 Quadratic Filters • We may want to process real signals using complex filtering or translated into the complex domain. • Quadrature Signal Processing involves creating an “In-Phase” and “Quadrature-Phase” signal representation. – Usually this is done by “quadrature mixing” which creates two outputs from a real data stream by mixing one by a cosine wave and the over by a sine wave. x t exp j 2 f t x t cos2 f t j sin 2 f t in phase j quadrature phase 40 Correlation and Spectral Density • Using Probability and the 1st and 2nd moments – Assuming an ergodic, WSS process we use the time average 2 Pv vt vt vt 0 • Properties: zt zt * * zt t 0 zt a 1 z1 t a 2 z 2 t a 1 z1 t a 2 z 2 t • Schwarz’s Inequality Pv Pw vt w t 2 41 Autocorrelation and Power • Autocorrelation Function R vv vt vt vt vt • Properties R vv 0 Pv R vv 0 R vv R vv R vv 42 Crosscorrelation • Crosscorrelation Function R vw vt w t vt w t • Properties R vv 0 R ww 0 R vw 2 R vw R wv 43 Application • Correlation of phasors T 1 2 exp j w 1 t exp j w 2 t lim exp j w 1 w 2 t dt T T T 2 sin cw 1 w 2 T T 2 exp j w 1 t exp j w 2 t lim 1, exp j w 1 t exp j w 2 t 0, w1 w 2 else 44 Power Spectral Density • The Fourier Transform of the Autocorrelation • Remember ECE 3800! 45 System analysis in τ domain x (t ) R x () y R y h (t ) y (t ) x(t ) h(t ) h() x(t )d Ryx () h() Rx () h( ) R ( ) d x and with output autocorrelation is: Ry () h ( ) Ryx () * h () R * yx ( ) d Ry () h* () h( ) Rx ( ) © 2010 The McGraw-Hill Companies System Analysis in f domain Gx f x ( t ) R x () y Gy f R y h (t ) H f Gx f Rx G y f R y Y f H f X f G y f H f Gx f 2 © 2010 The McGraw-Hill Companies Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Interpretation of spectral density functions Power or Energy Spectral Density is energy per unit frequency 48