ELEN E4810: Digital Signal Processing Topic 5: Transform-Domain Systems 1. Frequency Response (FR) 2. Transfer Function (TF) 3. Phase Delay and Group Delay Dan Ellis 2013-10-09 1 1. Frequency Response (FR) Fourier analysis expresses any signal as the sum of sinusoids 1 X(ej )ej n d e.g. IDTFT: x[n] = 2 Sinusoids are the eigenfunctions of LSI systems (only scaled, not ‘changed’) Knowing the scaling for every sinusoid fully describes system behavior describes how a → frequency response system affects each pure frequency Dan Ellis 2013-10-09 2 Sinusoids as Eigenfunctions IR h[n] completely describes LSI system: x[n] h[n] y[n] = x[n] h[n] = h[m]x[n m] m Complex sinusoid input i.e. x[n] = ej y[n] = = y[n] = j 0 (n m) h[m]e m j 0m j 0n h[m]e · e m H(ej ) = |H(ej )|ej H(ej 0 ) · x[n] = |H(ej 0 )| · ej( 0 n+ Output is sinusoid scaled by FT at Dan Ellis 2013-10-09 0n ( 0 3 ( ) 0 )) System Response from H(ej!) If x[n] is a complex sinusoid at !0 then the output of a system with IR h[n] is the same sinusoid scaled by |H(ej! )| and phase-shifted by arg{H(ej! )} = µ(!0) where H(ej!) = DTFT{h[n]} 0 0 (Any signal can be expressed as sines...) |H(ej!)| “magnitude response” → gain arg{H(ej!)} “phase resp.” → phase shift Dan Ellis 2013-10-09 4 Real Sinusoids In practice signals are real e.g. x[n] =A cos( 0 n + ) A j( 0 n+ ) = e +e 2 A j j 0n A = e e + e 2 2 |X(ejω)| j( j A/2 0 n+ ) e j 0n ω0 - ω0 ω A j A j j 0 j 0n y[n] = e H(e )e + e H(e j 0 )e j 0 n 2 2 Real h[n] H(e j ) = H (ej ) = |H(ej )|e j ( y[n] = A|H(ej 0 )| cos ( Dan Ellis 0n 2013-10-09 + + ( 0 )) 5 ) Real Sinusoids A cos( 0n + ) h[n] A|H(ej 0 )| cos ( 0n + + ( A real sinusoid of frequency !0 passed through an LSI system with a real impulse response h[n] has its gain modified by |H(ej!0)| and its phase shifted by µ(!0). Dan Ellis 2013-10-09 6 0 )) Transient / Steady State Most signals start at a finite time, e.g. x[n] = ej 0 n µ[n] What is the effect? y[n] = = = n j 0 (n m) h[n] x[n] = h[m]e m= ⇥ ⇥ ⇥ j 0 (n m) j 0 (n m) h[m]e h[m]e m= ⇥ m=n+1 ⇥ j 0 j 0n H(e )e ( m=n+1 h[m]e j 0 m )ej 0 n Steady state - same as with pure sine input Dan Ellis Transient response - consequence of gating 2013-10-09 7 Transient / Steady State x[n] = ej 0n µ[n] ⇥ y[n] = H(ej 0 )ej transient ⇥ m=n+1 h[m]e ( 0n j 0m 0n FT of IR h[n]’s tail from time n onwards zero for FIR h[n] for n ≥ N tends to zero with large n for any ‘stable’ IR Total output Steady State Transient -40 Dan Ellis )ej -30 -20 -10 0 2013-10-09 10 20 30 40 time / n 8 FR example MA filter 1 y[n] = M M 1 ] x[n =0 =x[n] 1/M h[n] -1 1 2 3 4 5 6 H(ej ) = DTFT{h[n]} = h[n]e n= j n 1 = M 1 1 1 e j M = e = j M 1 e M Dan Ellis 2013-10-09 M 1 e j n n=0 j (M 1) 2 sin(M /2) sin( /2) 9 n FR example MA filter: 1 H(e ) = e M j j (M 1) 2 sin(M /2) sin( /2) 6 4 2 0 1 sin(M /2) j H(e ) = M sin( /2) (M 1) ( )= + ·r 2 6 4 2 0 0 - 2 (jumps at sign changes: r= M!/2π ) Response to Dan Ellis x[n] = ej 2013-10-09 0n + ej 0 1n 2 (M = 5) ... 10 FR example 6 4 2 0 6 4 MA filter j input x[n] = e = 0.1 = 0.5 0 1 2 0 0 0n +e j 1n - H(ej 0 ) 0.8ej 0 H(ej 1 ) ( )0.2ej output y[n] = H(ej 0 )ej 0n 0 2 2 1 + H(ej 1 )ej 1n 2 1 x[n] 0 y[n] -1 -2 -20 Dan Ellis 0 20 40 2013-10-09 60 80 n 11 M 2. Transfer Function (TF) Linking LCCDE, ZT & Freq. Resp... N N LCCDE: dk y[n k] = k=0 Take ZT: k] k=0 k dk z k Hence: Y (z) = or: Dan Ellis pk x[n Y (z) = Y (z) = P p z Pk k k dk z X(z) k k k X(z) H(z)X(z) 2013-10-09 k pk z Transfer function H(z) 12 Transfer Function (TF) Alternatively, y[n] = h[n] x[n] ZT → Y (z) = H(z)X(z) Note: same H(z) = P P pk z dk z ... if system has DE form k k n n h[n]z ... from IR e.g. FIR filter, h[n] = {h0, h1,... hM-1} M pk=hk, d0=1, DE is 1 · y[n] = Dan Ellis 2013-10-09 1 hk x[n k=0 13 k] Transfer Function (TF) Hence, MA filter: 1 y[n] = M H(z) = = = 1 M M 1 =0 M 1 =0 z zM M ·z M ] ⇥ h[n] = 1 1 (z 1) 0 Im{z} n 1 z M M (1 z 1 ) (ignore poles at z=0) Dan Ellis x[n 0 n M otherwise 1 M zM=1 i.e. M roots of 1 @ z=ej2πr/M |H(ej!)| Re{z} 1 ROC? pole @ z=1 cancels 2013-10-09 z-plane 14 TF example y[n] = x[n 1] 1.2x[n 2] + x[n 3] + 1.3y[n 1] 1.04y[n 2] + 0.222y[n Y (z) H(z) = = X(z) 1 H(z) = z 1.3z 1.2z 2 + z 3 1 + 1.04z 2 0.222z 3] 1 3 factorize: z (1 Dan Ellis (1 0z 1 )(1 0z 1 )(1 0z 1 )(1 1z 1 2013-10-09 ) 1z 1 1) ζ0 = 0.6+j0.8 λ0 = 0.3 λ1 = 0.5+j0.7 → ... 15 TF example H(z) = z (1 (1 0z 1 )(1 0z 1 )(1 0z 1 )(1 1z 1 ζ0 = 0.6+j0.8 λ0 = 0.3 λ1 = 0.5+j0.7 Poles ∏i → ROC causal → ROC is |z| > max|∏i| includes u.circle → stable Dan Ellis 2013-10-09 ) 1z 1 1) Im{z} λ1 × λ0 × λ*1 ζ0 Re{z} 1 × 16 ζ ∗0 TF → FR DTFT H(ejω) = ZT H(z)|z = ejω i.e. Frequency Response is Transfer Function eval’d on Unit Circle 1 k z ) p0 z (z k ) ( k=1 k=1 H (z) = = N N 1 N d0 (1 k z ) d0 z (z k ) k=1 k=1 M j e ( k) p j NM j ( ) k=1 0 H (e ) = e N j d0 k=1 (e k ) factor: Dan Ellis p0 M 1 2013-10-09 M M 17 TF → FR p0 j j H(e ) = e d0 (N M) p0 H(e ) = d0 ⇥(⌅) = arg + p0 d0 M ⇧ k=1 Dan Ellis ⌅ ej + ⌅ · (N arg e j k k (ej M j e k=1 N j |e k=1 j ⇤ M k=1 N k=1 k) Magnitude response k k| M) ⇥ 2013-10-09 N ⇧ ζk, λk are TF roots on z-plane Phase response arg e j ⇤k k=1 18 ⇥ FR: Geometric Interpretation M j e ( k) p j NM j ( ) k=1 0 Have H e ( )= d e N j 0 k=1 (e k ) Constant/ linear part On z-plane: Im{z} × ej!−∏i × Dan Ellis ej!−≥i ej! Re{z} × Product/ratio of terms related to poles/zeros Each (ej! - ∫) term corresponds to a vector from pole/zero ∫ to point ej! on the unit circle Overall FR is product/ratio of all these vectors 2013-10-09 19 FR: Geometric Interpretation Im{z} ≥i ∏i× ej!−∏i ej!−≥i ej! × Re{z} × Dan Ellis Magnitude |H(ej!)| is product of lengths of vectors from zeros divided by product of lengths of vectors from poles Phase µ(!) is sum of angles of vectors from zeros minus sum of angles of vectors from poles 2013-10-09 20 FR: Geometric Interpretation Magnitude and phase of a single zero: Imaginary Part 1 0.6 0.4 0.8 0.5 0.2 1 0 0.0 0 magnitude 2 phase -0.5 -0.8 -0.6 -1 -1 -0.5 /2 -0.2 0 -0.4 0 0.5 Real Part - /2 1 - 0 0.5 1.5 2 Pole is reciprocal mag. & negated phase Dan Ellis 2013-10-09 21 FR: Geometric Interpretation ( ( 1 Imaginary Part )( )( j0.3 j0.3 Multiple z 0.8e z 0.8e poles, H (z ) = j0.3 j0.3 zeros: z 0.9e z 0.9e 0.6 0.4 0.8 0.5 0.2 1 0 0.0 0 magnitude 2 phase -0.5 -0.8 -0.6 -1 -1 Dan Ellis -0.2 -0.5 0 -0.4 0 0.5 Real Part /2 - /2 1 - 2013-10-09 0 0.5 1.5 22 2 V ) ) Geom. Interp. vs. 3D surface 3D magnitude surface for same system Full surface Dan Ellis Showing ROC 2013-10-09 23 Geom. Interp: Observations Roots near unit circle → rapid changes in magnitude & phase zeros cause mag. minima (= 0 → on u.c.) poles cause mag. peaks (→ 1÷0=∞ at u.c.) rapid change in relative angle → phase Pole and zero ‘near’ each other cancel out when seen from ‘afar’; affect behavior when z = ej! gets ‘close’ Dan Ellis 2013-10-09 24 M PEZdemo Filtering Idea: Separate information in frequency with constructed H(ej!) e.g. x [n] = A cos(1n) + B cos( 2 n) interested in this part Construct a filter: |H(ej!1)| ∼1 |H(ej!2)| ∼ 0 don’t care about this part B/ 2 X(ej!) H(ej!) A/ 2 −!2 −!1 B/ 2 “filtered out” ! A/ 2 !1 !2 Then y[n] = h[n] x [n] A cos(1n + (1 )) Dan Ellis 2013-10-09 25 Filtering example Æ x[n] Consider Ø z filter ‘family’: z Æ 3 pt FIR filters with h[n] = {Æ Ø Æ} Frequency Response: -1 -1 + y[n] Æ -2 -1 Ø Æ 1 2 3 4 n ( ) = n h[n]e = + e + e j j j j = e ( + (e + e )) = e ( + 2 cos ) can set Æ and Ø j to obtain desired H (e ) = + 2 cos |H(e )| ... H e j jn j 2 j j! Dan Ellis 2013-10-09 26 Filtering example (cont’d) ( ) = + 2 cos h[n] = {Æ Ø Æ} H e j Consider input as mix of sinusoids at !1 = 0.1 rad/samp want to remove and !2 = 0.4 rad/samp i.e. make H(ej!2) = 0 Solve H(ej ) = |⇥ + 2 cos ⇤| ⇥ 1 ⇤ = ⇤1 = 0.1 = 0 ⇤ = ⇤2 = 0.4 Ø = -12.46, Æ = 6.76 ... Dan Ellis 2013-10-09 27 Filtering example (cont’d) 15 Filter IR 10 5 0 -5 -10 -15 0 5 10 15 20 25 30 35 40 45 n 20 Freq. resp 10 dB 0 -10 -20 0 0.2 0.4 0.6 0.8 / rad 1 2 input/ output 1 0 -1 -2 0 Dan Ellis 20 40 60 80 2013-10-09 100 120 140 160 180 28 n 3. Phase- and group-delay For sinusoidal input x[n] = cos!0n, ( we saw y[n] = H e j 0 ) cos( 0n + ( 0 )) gain ( 0 ) i.e. cos 0 n + 0 or cos( 0 (n p ( 0 ))) ( ) where p ( ) = Dan Ellis 2013-10-09 phase shift or time shift subtraction so positive øp means delay (causal) is phase delay 29 Phase delay example For our 3pt filter: ( )=e H e j j Æ -2 -1 Ø Æ 1 2 3 4 ( + 2 cos ) n ( ) = p ( ) = = +1 i.e. 1 sample delay (at all frequencies) (as observed) Dan Ellis 2013-10-09 30 Group Delay Consider a modulated carrier e.g. x[n] = A[n]·cos(!cn) with A[n] = Acos(!mn) and !m << !c 1 0.5 0 0.5 1 0 Dan Ellis 50 100 150 200 2013-10-09 250 300 350 400 31 X(ej!) Group Delay So: x[n] = Now: = !c -!m A cos( m n) · cos( c n) A m )n + cos( c + 2 [cos( c y[n] = = h[n] A 2 H(ej( +H(ej( m )n] x[n] c m) ) cos( c c+ m) ) cos( c m )n + Assume |H(ej!)| ∼ 1 around !c±!m but µ(!c-!m) = µl ; µ(!c+!m) = µu ... Dan Ellis 2013-10-09 !c +!m !c ! 32 m )n Group Delay j( = y[n] |H(ej!)| ∼ 1 µ(!c-!m) = µl µ(!c+!m) = µu A 2 = = A cos H(e +H(ej( A 2 c m) ) cos( c c+ m) ) cos( c cos[( + cos[( cn + + u+ l 2 phase shift of carrier Dan Ellis 2013-10-09 + m )n m )n+ l ] c c m )n m )n+ u ] · cos mn + u l 2 phase shift of envelope 33 !c Group Delay µ(!) If µ(!c) is locally linear i.e. " µ(!c+¢!) = µ(!c) + S¢!, µl ! S µu !c–!m !c+!m d ( ) S= d = c l + u Then carrier phase shift = ( c ) 2 ( c ) = p , phase delay so carrier delay c u l Envelope phase shift = m S 2 d ( ) → delay g ( c ) = group delay d = c Dan Ellis 2013-10-09 34 Group Delay Envelope (group) delay 1 0.5 Carrier (phase) delay 0 -0.5 -1 0 50 100 150 200 !c øp, phase delay 250 300 350 400 n ! øg, group delay µ(!) If µ(!) is not linear around !c, A[n] suffers “phase distortion” → correction... Dan Ellis 2013-10-09 35 M