330 likes | 347 Views
Learn about analog filtering in digital media processing, including digital processing, system linearity, and phase response. Discover the importance of designing analog low-pass filters for optimal signal processing.
E N D
UNIVERSITY of MANCHESTER School of Computer Science Comp30291: Digital Media Processing 2009-10 Section 2 Analogue filtering Comp30291 Section 2
x(t) y(t) Analog system represented as ‘black box’ Inside we could have analogue components, or Digital processor Analog lowpass filter 1 Analog lowpass filter 2 x(t) ADC y(t) DAC Fs Fs Comp30291 Section 2
DAC output t Analog low-pass filters • Analog Lowpass Filter 1 is ‘antialiasing’ filter: removes any frequency components above Fs/2 before sampling process. • Analog Lowpass Filter 2 is ‘reconstruction’ filter: smoothes DAC output to remove all frequency components above Fs/2. • Digital processor controls ADC to sample at Fs Hz. • Also sends output sample to DAC at Fs samples per second. • DAC produces ‘staircase’ waveform: smoothed by ALpF2. Comp30291 Section 2
Analogue filter x(t) y(t) Analogue filters • Still needed in the world of DSP • Also, many digital filter designs are based on analog filters. • They are ‘linear’ & ‘time-invariant’ (LTI) Comp30291 Section 2
Definition of ‘linearity’ • System is LINEAR if • for any signal x(t), • if x(t) y(t) then a.x(t ) a.y(t) for any constant a. • (2) for any signals x1(t) & x2(t), • if x1(t) y1(t) & x2(t) y2(t) • then x1(t) + x2(t) y1(t) + y2(t) • (By x(t) y(t) we mean that applying x(t) to the input produces the output signal y(t). ) Comp30291 Section 2
Alternative definition of ‘linearity’ System is linear if for any signals x1(t) & x2(t), if x1(t) y1(t) & x2(t) y2(t) then a1x1(t) + a2 x2(t) a1y1(t) +a2 y2(t) for any a1 & a2 Comp30291 Section 2
y1(t) x1(t) t t Linear system + + y2(t) x2(t) t t If x1(t) y1(t) & x2(t) y2(t) then 3x1(t)+4x2(t) 3y1(t)+4y2(t) Linearity (illustration) Comp30291 Section 2
Definition of ‘time-invariance’ • A time-invariant system must satisfy: • For any x(t), if x(t) y(t) then x(t-) y1(t-) for any • Delaying input by seconds delays output by seconds • Not all systems have this property. • An LTI system is linear & time invariant. • An analogue filter is LTI. Comp30291 Section 2
‘System function’ for analogue LTI circuits • An analog LTI system has a system (or transfer) function a0 + a1s + a2s2 + ... + aNsN H(s) = b0 + b1s + b2s2 + ... + bMsM • Coeffs a0, a1, ...,aN, b0, ..., bM determine its behaviour. • Designer of analog lowpass filters must choose these carefully. • H(s) may be evaluated for complex values of s. • Setting s = j where = 2f gives a complex function of f. • Modulus |H(j)| is gain at radians/second (/2 Hz) • Argument of H(j) is phase-lead at radians/s. Comp30291 Section 2
Gain & phase response graphs Gain: G() = |H(j)| Phase lead: () = Arg[H(j)| -() G(w) Gain Phase-lag f / (2) Comp30291 Section 2
Effect of phase-response • It may be shown that: • when input x(t) = A cos(t), • output y(t) = A . G() . cos( t +() ) • Output is sinusoid of same frequency as input. • ‘Sine-wave in sine-wave out’ • Multiplied in amplitude by G() & ‘phase-shifted’ by (). • Example: If G() = 3 and () = /2 for all what is the output? • Answer: y(t) = 3.A.cos(t + /2) • = 3.A.sin (t) Comp30291 Section 2
Phase-shift expressed as a delay • Express y(t) = A . G() . cos( t +() ) • as A . G() . cos ([t + ()/]) • = A . G() . cos( [t - ()] ) where () = -()/ • Cosine wave is delayed by -()/ seconds. • -()/ is ‘phase-delay’ in seconds • Easier to understand than ‘phase-shift’ Comp30291 Section 2
Linear phase • If -()/ is constant for all , all frequencies delayed by same time. • Then system is ‘linear phase’ - this is good. • Avoids changes in wave-shape due to ‘phase distortion’; • i.e different frequencies being delayed by differently. • Not all LTI systems are ‘linear phase’. Comp30291 Section 2
Linear phase response graph Comp30291 Section 2
()G() 1 0 C Low-pass analog filters Would like ideal ‘brick-wall’ gain response & linear phase response as shown below: C = cut-off frequency Comp30291 Section 2
Butterworth low-pass gain response • Cannot realise ideal ‘brick-wall’ gain response nor linear phase. • Can realise Butterworth approximation of order n: Properties (i) G(0) = 1 ( 0 dB gain at =0) (ii) G(C) = 1/(2) ( -3dB gain at = C) Comp30291 Section 2
Examples of Butterwth low-pass gain responses • Let C = 100 radians/second. • G(C) is always 1/(2) • Shape gets closer to ideal ‘brick-wall’ response as n increases. Comp30291 Section 2
LINEAR-LINEAR PLOT 1 G() 0.9 0.8 1 / (2) 0.7 0.6 0.5 0.4 0.3 0.2 n = 2 n=7 n=4 0.1 0 0 50 100 150 200 250 300 350 400 radians/second Comp30291 Section 2
Butterworth gain responses on dB scale • Plot G() in dB, i.e. 20 log10(G()), against . • With on linear or log scale. • As 20 log10(1/(2)) = -3, all curves are -3dB when = C Comp30291 Section 2
dB-LINEAR PLOT 0 dB -10 n=2 -20 -30 n=4 -3dB -40 -50 -60 n=7 -70 -80 -90 0 50 100 150 200 250 300 350 400 radians/second Comp30291 Section 2
dB-LOG PLOT 0 dB -10 3 dB -20 -30 n=2 -40 -50 -60 n=4 -70 -80 0 1 2 3 10 10 10 10 radians/second Comp30291 Section 2
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’); Comp30291 Section 2
‘Cut-off’ rate • Best seen on a dB-Log plot • 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 is doubled. Comp30291 Section 2
G() 1 Ideal Approximatn 1 radian/s G() 1 C Filter types - low-pass Low-pass with C = 1 Low-pass Comp30291 Section 2
Filter types - high-pass & band-pass G() 1 High-pass C G() 1 Band-pass L U Comp30291 Section 2
Filter types - band-stop G() 1 L U Comp30291 Section 2
Two types of band-pass gain-responses G() 1 Narrow-band (U < 2 L ) L U G() 1 Broad-band (U > 2 L ) L U Comp30291 Section 2
Three types of ‘band-stop’ gain-responses G() 1 Narrow-band (U < 2 L ) L U G() 1 Broad-band (U > 2 L ) L U Comp30291 Section 2
Third type of ‘band-stop’ gain-response G() 1 Notch N Yet another type of gain-response G() 1 All-pass Comp30291 Section 2
Approximatns for high-pass, band-pass etc • Fortunately these can be derived from the formula for a Butterworth LOW-PASS gain response. • MATLAB does all the calculations. Comp30291 Section 2
Other approximations • A filter which uses a Butterworth gain-response approximation of order n is an ‘nth order Butterworth type filter’. • In addition to Butterworth we have other approximations Chebychev (types 1 & 2) Elliptical Bessel, etc. Comp30291 Section 2
Problems 1. An analog filter has: H(s) = 1 / (1 + s) Give its gain & phase responses & its phase delay at = 1. 2. Use MATLAB to plot gain response of Butterwth type analog low-pass filter of order 4 with C = 100 radians/second. Solution to (2):- for w = 1 : 400 G(w) = 1/sqrt(1+(w/100)^8) ; end; plot(G); grid on; Comp30291 Section 2
Result obtained:- Comp30291 Section 2