Department of Electrical and Information Technology Formula Table Digital Signal Processing Bengt Mandersson Lund 0 Department of Electrical and Information Technology, Lund University, Sweden
Innehåll Basic trigonometrical formula 3. Trigonometry.............................. 3. Matrix theory.............................. 4.3 Notation of some basic signals..................... 5.4 Often used relations.......................... 5.5 Correlation............................... 6.6 Circuit model (single input, single output).............. 6.7 Input output relations......................... 7.8 Analogous sinusoids through a linear, causal lter.......... 8.9 Time discrete sinusoids through a linear, causal lter........ 9 Transforms 0. Laplace transform............................ 0.. Laplace transform of causal signals.............. 0.. One-side Laplace transform of non-causal signals........ Fourier transform of time continous signals...............3 Z-transform............................... 4.3. The z-transform of causal signals............... 4.3. One-side Z-transform of non-causal signals.......... 5.4 Fourier transform of time discrete signals............... 6.5 Fourier serial expansion......................... 8.5. Continuous in time....................... 8.5. Discrete time.......................... 8.6 Discrete Fourier Transform (DFT)................... 9.6. Denition............................ 9.6. Circular convolution...................... 9.6.3 Non-circular convolution using the DFT........... 9.6.4 Relation to the Fourier transform X(f):........... 0.6.5 Relation to Fourier series.................... 0.6.6 Parseval's theorem....................... 0.6.7 Some properties of the DFT...................7 Some window functions and their Fourier transform......... 3 Sampling of analogous signals 3 3. Sampling and reconstruction...................... 3 3. Distortion measurements........................ 5 3.. Aliasing distortion from sampling............... 5 3.. Signal-to-noise ratio during reconstruction.......... 5 3.3 Quantization noise........................... 6 3.4 Sampling rate conversion, decimation and interpolation....... 6 4 Analogous lters 7 4. Filter approximations of ideal LP-lter................ 7 4.. The Butterworth lter..................... 7 4.. The Chebyshev lters...................... 8 4..3 The Bessel lter......................... 3 4. Frequency transformation of analogous lters............. 33
5 Time discrete lter 34 5. FIR lters and IIR lters........................ 34 5. FIR lters using the window method................. 34 5.3 Ekviripple FIR lters.......................... 37 5.4 FIR lters using Least Squares method................ 37 5.5 IIR-lter................................. 38 5.5. The impulse invariance method................ 38 5.5. Bilinear transformation..................... 38 5.5.3 Quantication of the lter coecients............. 39 5.6 Lattice lter............................... 39 6 Spectral estimation 4
Basic trigonometrical formula. Trigonometry sin α = cos(α π/) sin(α β) = sin α cos β cos α sin β cos α = sin(α π/) cos(α β) = cos α cos β sin α sin β cos α sin α = sin α sin β = cos(α β) cos(α β) cos α sin α = cos α sin α cos β = sin(α β) sin(α β) sin α cos α = sin α cos α cos β = cos(α β) cos(α β) sin( α) = sin α sin α sin β = sin αβ cos α β cos( α) = cos α cos α cos β = cos αβ cos α β cos α = ( cos α) cos α = (ejα e jα ), sin α = j (ejα e jα ), e jα = cos α j sin α A cos α B sin α = A B cos(α β) with cos β = och β = A A, sin β = B B A B arctan B A if A 0 arctan B A π if A < 0 A cos α B sin α = A B sin(α β) with cos β = och β = B A, sin β = B A A B arctan A B if B 0 arctan A B π if B < 0 Degree Rad sin cos tan cot 0 0 0 0 ± 30 π 3 3 6 3 45 π 4 60 π 3 3 3 3 90 π 0 ± 0 3
. Matrix theory Notation of matrix A and vector x A matrix A of order mxn and a vector x with dimension n are dened by A = a a... a n a. a.... a n. a m a m... a mn The matrix A is symmetrical if a ij = a ji ij. I denotes the unit matrix. Transpose of a matrix A x = x x. x n Determinant of a matrix A B = A T där b ij = a ji (AB) T = B T A T deta = A = a a... a n a. a.... a n. a m a m... a mn n = a ij ( ) ij detm ij i= there M ij is the resulting matrix if row i and column j in the matrix A are deleted. detab = deta detb Specially for a x matrix: deta = a a a a Inverse of the matrix A A A = AA = I (om deta#0) with C dened by Specially for a x matrix: A = deta CT c ij = ( ) ij detm ij (AB) = B A A = ( a a deta a a ) 4
Eigenvalues and eigenvectors Eigenvalues (λ i, i =,,..., n) and eigenvectors (q i, i =,,..., n) are the solution to the equation system Aq = λq eller (A λi)q = 0 The eigenvalues can be determined as the solution to t6he characteristic equation to A det(λi A) = λ n α n λ n α 0 = 0 det(λi A) is called the characteristic polynomial to A..3 Notation of some basic signals Unit step function u(t) = The impuls function δ(t) = { t 0 0 t < 0 { t = 0 0 t # 0 δ(t)dt = Rectangular function p(t) = x(t)δ(t)dt = x(0) t < 0 t > Sinc-function Periodical sinc-function Complex sinusoids Complex undamped sinusoids sinc x = sin πx πx diric(x, N) = sin ( ) Nx N sin ( ) x e st = e σt e jωt e jωt = cos Ωt j sin Ωt.4 Often used relations Sum of a geometrical series. N a n = n=0 Sum of a sinusoids over a full periods. N n=0 e jπ kn/n = N if a = a N a if a { N if k = 0, ±N,... 0 f.ö. 5
.5 Correlation Correlation, cross correlation, spectrum, cross spectrum and coherence between input and out signals. y(t) = h(t) x(t) y(n) = h(n) x(n) Y (F ) = H(F ) X(F ) Y (f) = H(f) X(f) r yy (τ) = r hh (τ) r xx (τ) r yy (n) = r hh (n) r xx (n) R yy (F ) = H(F ) R xx (F ) R yy (f) = H(f) R xx (f) r yx (τ) = h(τ) r xx (τ) r yx (n) = h(n) r xx (n) R yx (F ) = H(F ) R xx (F ) R yx (f) = H(f) R xx (f) r xx (τ) = t x(t)x(t τ)dt r xx(n) = l x(l)x(l n) r yx (τ) = t y(t)x(t τ)dt r yx(n) = l y(l)x(l n) γ xx (τ) = E{x(t)x(t τ)} γ xx (n) = E{x(l)x(l n)} γ yx (τ) = E{y(t)x(t τ)} γ yx (n) = E{y(l)x(l n)} Gaussian random variables. X i N(m i, σ i ) E{X X X 3 X 4 } = E{X X } E{X 3 X 4 } E{X X 3 } E{X X 4 } E{X X 4 } E{X X 3 } m m m 3 m 4.6 Circuit model (single input, single output) ) Canonical form (direct form II) x(n) b 0 y(n) -a z - v N (n) b -a z - v N- (n) b -a N- b N- -a N z - v (n) b N ) The dierence equation N M y(n) = a k y(n k) b k x(n k) k= k=0 6
3) Steady state notation { v(n ) = Fv(n) q x(n) y(n) = g T v(n) d x(n) with F = 0... 0 0.... 0 0 0 a k a k... a a 0 ; q = 0. 4) The system function g T = (b k,..., b, b ) b 0 (a k,..., a, a ) ; d = b 0.7 Input output relations ) Convolution ) Steady state a) Direct solution y(n) = h x = b) Impulse response H(z) = b 0 b z b M z M a z a N z N k= y(n) = g T F n v(0) h(k)x(n k) = n k=0 k= h(n k)x(k) g T F n k qx(k)u(n ) dx(n) h(n) = g T F n qu(n ) dδ(n) c) System function H(z) = g T [zi F] q d 7
.8 Analogous sinusoids through a linear, causal lter ) Complex, non-causal input signal x(t) = e jω 0t = (cos(ω 0 t) j sin(ω 0 t)) < t < y(t) = τ=0 h(τ)x(t τ)dτ = ) Complex, causal input signal τ=0 h(τ)e jω 0(t τ) dτ = H(s) s=jω0 e jω 0t }{{} stationary x(t) = e jω 0t u(t) = (cos(ω 0 t) j sin(ω 0 t)) u(t); X(s) = s jω 0 Y (s) = H(s)X(s) = T (s) N(s) 3) Real, non-causal input signal s jω 0 = T (s) N(s) }{{} transient y(t) = transient H(s) s=jω0 e jω 0t }{{} stationary H(s) s=jω0 s jω 0 }{{} stationary x(t) = Re{e jω 0t } = cos(ω 0 t) < t < y(t) = τ=0 h(τ)x(t τ)dτ = 4) Complex, causal input signal τ=0 h(τ) (ejω 0(t τ) e jω 0(t τ) )dτ = = H(s) s=jω0 cos(ω 0 t arg{h(s) s=jω0 }) }{{} stationary x(t) = Re{e jω 0t } u(t) = cos(ω 0 t) u(t); X(s) = s s Ω 0 Y (s) = H(s)X(s) = T (s) N(s) s s Ω 0 = T (s) C s C 0 N(s) s Ω 0 }{{}}{{} transient stationary H(s) s=jω0 = A e jθ ; C = A cos(θ); C 0 = AΩ 0 sin θ y(t) = transient C cos(ω 0 t) C 0 sin(ω 0 t) = Ω }{{ 0 } stationary = transient H(s) s=jω0 cos(ω 0 t arg{h(s) s=jω0 }) }{{} stationary 8
.9 Time discrete sinusoids through a linear, causal lter ) Complex, non-causal input signal x(n) = e jω 0n = (cos(ω 0 n) j sin(ω 0 n)) < n < y(n) = h(k)x(n k) = h(k)e jω0(n k) = H(z) z=e jω 0 e jω 0n k=0 k=0 ) Complex, causal input signal }{{} stationary x(n) = e jω 0n u(n) = (cos(ω 0 n) j sin(ω 0 n)) u(n); X(z) = Y (z) = H(z)X(z) = T (z) N(z) 3) Real, non-causal input signal e jω 0 z e = T (z) H(z) jω 0 z N(z) z=e jω 0 e jω 0 z }{{}}{{} transient stationary y(n) = transient H(z) z=e jω 0 }{{} stationary e jω 0n x(n) = Re{e jω 0n } = cos(ω 0 n) < n < y(n) = h(k)x(n k) = h(k) k=0 k=0 (ejω 0(n k) e jω0(n k) ) = 4) Real, causal input signal = H(z) z=e jω 0 cos(ω 0 n arg{h(z) z=e jω 0 }) }{{} stationary x(n) = Re{e jω 0n } u(n) = cos(ω 0 n) u(n); X(z) = cos ω 0 z cos ω 0 z z Y (z) = H(z)X(z) = T (z) N(z) cos ω 0 z cos ω 0 z z = T (z) N(z) }{{} transient C 0 C z cos ω 0 z z }{{ } stationary H(z) z=e jω 0 = A e jθ ; C 0 = A cos(θ); C = A(sin ω 0 sin θ cos ω 0 cos θ) y(n) = transient C 0 cos(ω 0 n) C C 0 cos(ω 0 ) sin(ω 0 n) = sin(ω 0 ) }{{} stationary = transient H(z) z=e jω 0 cos(ω 0 n arg{h(z) z=e jω 0 }) }{{} stationary 9
Transforms. Laplace transform.. Laplace transform of causal signals In the table below, f(t) = 0 for t < 0 (i.e. f(t) u(t) = f(t)).. f(t) = F(s) = σj σ j F(s)est ds 0 f(t)e st dt. πj ν a ν f ν (t) ν a ν F ν (s) Linearity 3. f(at) a F( s a ) Scaling 4. f( t ) F(as) a > 0 Scalning a a 5. f(t t 0 ); t t 0 F(s) e st 0 Time shift 6. f(t) e at F(s a) Frequency shift 7. d n f s n F(s) Derivate dt n 8. t 0 f(τ)dτ s F(s) Integrate 9. ( t) n f(t) dn F(s) Derivation in ds frequency n 0. f(t) t s F(z)dz Integration in frequency. lim t 0 f(t) = lim s s F(s) Initial valuetheorem. lim t f(t) = lim s 0 s F(s) 3. f (t) f (t) = F (s) F (s) t 0 f (τ)f (t τ)dτ = Convolution in time domain t 0 f (t τ)f (τ)dτ 4. f (t) f (t) F πj (s) F (s) = σj πj σ j F (z) F (s z) dz Convolution in frequency domain 5. 0 f (t) f (t)dt = σj πj σ j F (s) F ( s)ds Parseval's relation 0
6. δ(t) 7. δ n (t) s n 8. s 9. n! t n s n 0. e σ 0t s σ 0. (n )! tn e σ 0t (s σ 0 ) n. sin Ω 0 t Ω 0 s Ω 0 3. cos Ω 0 t s s Ω 0 4. t sin Ω 0 t Ω 0 s (s Ω 0) 5. t cos Ω 0 t s Ω 0 (s Ω 0) 6. e σ 0t sin Ω 0 t 7. e σ 0t cos Ω 0 t Ω 0 (s σ 0 ) Ω 0 s σ 0 (s σ 0 ) Ω 0 8. e σ 0t sin(ω 0 t φ) (s σ 0) sin φ Ω 0 cos φ (s σ 0 ) Ω 0.. One-side Laplace transform of non-causal signals Notations F (s) = 0 f(t)e st dt F(s) = F (s) Taking the derivative of f(t) yelds One-side Laplacetransform, f(t) not nessesary causal. For causal signals d dt f(t) s F (s) f(0 ) First deivative d n dt f(t) sn F (s) s n f(0 ) s n f () (0 )... f (n ) (0 ) The n : th derivative
. Fourier transform of time continous signals Ω = πf. w(t) = F {W (F )} = W (F ) = F{w(t)} = W (F )ejπf t df w(t)e jπf t dt. ν a ν w ν (t) ν a ν W ν (F ) 3. w ( t) W (F ) 4. W (t) w( F ) 5. w(at) W ( ) F a a 6. w(t t 0 ) W (F ) e jπf t 0 7. w(t) e jπf 0t W (F F 0 ) 8. w (t) W ( F ) 9. d n w(t) dt n (jπf ) n W (F ) 0. t w(τ)dτ jπf W (F ) om W (F ) = 0 för F = 0. jπt w(t) dw df. w (t) w (t) W (F ) W (F ) 3. w (t) w (t) W (F ) W (F ) 4. 5. w(t) dt = W (F ) df w (t) w (t)dt = W (F ) W (F )df Parseval's relation w (t), w (t) real 6. δ(t) 7. δ(f ) 8. u(t) jπf δ(f ) 9. e at u(t) ajω
0. e a t a a Ω. e jπf 0t δ(f F 0 ). sinπf 0 t j {δ(f F 0) δ(f F 0 )} 3. sinπf 0 t u(t) Ω 0 Ω 0 Ω j 4 {δ(f F 0) δ(f F 0 )} 4. cosπf 0 t {δ(f F 0) δ(f F 0 )} 5. cosπf 0 t u(t) jω Ω 0 Ω 4 {δ(f F 0) δ(f F 0 )} 6. πσ e t /σ e (Ωσ) / 7. e at sinπf 0 t u(t) 8. e a t sinπf 0 t 9. e at cosπf 0 t u(t) 30. e a t cosπf 0 t Ω 0 (jω a) (Ω 0 ) Ω 0 (Ω 0 a Ω ) (Ω a Ω 0) 4a Ω 0 jω a (jω a) (Ω 0 ) a(ω 0 a Ω ) (Ω a Ω 0) 4a Ω 0 3. rect(at) = { for t < a 0 elsewhere a sinc( F a ) a > 0 3. sinc(at) = sin(πat) πat a rect( F a ) a > 0 33. rep T (w(t)) = m= w(t mt ) T comb /T (W (F )) 34. T comb T (w(t)) = rep /T (W (F )) T m= w(mt )δ(t mt ) 35. n= c n δ(t nt ) n= T c nδ(f n T ) = c n e jπnt F 3
.3 Z-transform.3. The z-transform of causal signals. X (z) = Z[x(n)] = n= x(n)z n Transform. x(n) = Z [X (z)] = πj Γ X (z)zn dz Inverse transform 3. ν a ν x ν (n) ν a ν X ν (z) Linearity 4. x(n n 0 ) z n 0 X (z) Skift (n 0 positive or negativte integer) 5. nx(n) z d dz X (z) Multiplication with n 6. a n x(n) X ( ) z a 7. x( n) X ( ) z Scaling Folding in time 8. [ nl= x(l) ] z z X (z) Sum 9. x y X (z) Y(z) Convolution 0. x(n) y(n) πj Γ Y(ξ)X ( ) z ξ ξ dξ Multiplication. x(0) = lim z X (z) (om gränsvärdet existerar) Initial value theorem. lim n x(n) = lim z (z )X (z) Final value theorem (if ROC includes th unit circle) 3. 4. l= x(l)y(l) = πj Γ x(z)y ( ) z z dz Parseval's theorem for real sequencies l= x (l) = πj Γ X (z)x (z )z dz -- 4
Time sequency Transform x(n) X (z) 5. δ(n) 6. u(n) z 7. nu(n) z ( z ) 8. α n u(n) αz 9. (n )α n u(n) ( αz ) 0. (n )(n )... (n r ) (r )! α n u(n) ( αz ) r. α n cos βn u(n). α n sin βn u(n) z α cos β z α cos β α z z α sin β z α cos β α z 3. F n u(n) (I z F).3. One-side Z-transform of non-causal signals Notations Shift of x(n) yields: i) shift one step X (z) = n=0 x(n)z n X (z) = X (z) ii) shift n 0 step (n 0 0) One-side Z-transform, x(n) not nessesary causal For causal signals x(n ) z X (z) x( ) x(n ) zx (z) x(0) z x(n n 0 ) z n 0 X (z) x( )z n 0 x( )z n 0... x( n 0 ) x(n n 0 ) z n 0 X (z) x(0)z n 0 x()z n 0... x(n 0 )z 5
.4 Fourier transform of time discrete signals. X(f) = F(x(n)) = Transform = l= x(l)e jπfl ω = πf. x(n) = / / X(f)ejπfn df = Inverse transform π π X(f)ejωn dω = π 3. aν x ν (n) ν a ν X ν (f) Linearity 4. x(n n 0 ) X(f) e jπfn 0 Shift 5. x(n)e jπf 0n X(f f 0 ) Frequency translation 6. x(n) cos πf 0 n [X(f f 0) X(f f 0 )] Modulation 7. x(n) sin πf 0 n j [X(f f 0) X(f f 0 )] Modulation 8. x y X(f) Y (f) Convoloution 9. x y / / X(λ) Y (f λ)dλ Multiplication 0. l= x(l)y(l) = Parseval's theorem = / / X(f)Y (f)df for real valued sequencies. X(f) = X (e jω ) If x(n) = 0 for n < n 0 and l= x(l) < (In eq.: 8,9,0, and in the Z-transform table for α < ). δ(n) 3. δ(n n 0 ) e jωn 0 4. n p= δ(f p) 5. u(n) p= δ(f p) j tan(πf) 6
6. f sinc(f n) = f sin(πf n) πf n ( ) rect f p f = Ideal LP-lter 7. 4f sinc(f n) cos(πf 0 n) ( ) rect f f0 p f f n < f < /, n integer 0 f.ö. ( ) rect f f0 p f Ideal BP-lter 8. πf n cos πf n sin πf n πn jπ(f n) f n < f < /, n integer (jπf) p = 0 f.ö. Derivation 9. cos(πf 0 n) p= [δ(f f 0 p) δ(f f 0 p)] 0. α n α α α cos πf. α n cos(πf 0 n) α [ ] α α cos π(f f 0 ) α α cos π(f f 0 ) n M. p r (n) = M udda 0 f.ö. P r (f) = sin(πfm) sin(πf) Rekctangular window 7
.5 Fourier serial expansion.5. Continuous in time A periodical function with the period T 0, i.e. f(t) = f(t T 0 ), can be expressed in a serial expansion with c k = T 0 If f(t) real, this can be written with f(t) = k= c k e jπkf 0t T 0 f(t)e jπkf 0t dt ; F 0 = T 0 f(t) = c 0 c k cos(πkf 0 t θ k ) = k= = a 0 a k cos πkf 0 t b k sin πkf 0 t k= a 0 = c 0 = T 0 T 0 f(t)dt a k = c k cos θ k = T 0 T 0 f(t) cos(πkf 0 t)dt b k = c k sin θ k = f(t) sin(πkf 0 t)dt T 0 T 0 The power is given by (Parseval's relation) For real signals also yields.5. Discrete time P = T 0 T 0 f(t) dt = k= c k P = c 0 c k = a 0 (a k b k= k) k= A periodical function with the period N, i.e. f(n) = f(n N), can be expressed in a serial expansion with c k = N N n=0 f(n) = N k=0 jπk n/n c k e f(n) e jπk n/n, k = 0,..., N The serial expansion is often denoted DTFS (Discrete-Time Fourier Series). If f(n) real, this can be written ( L f(n) = c 0 c k cos π kn ) k= N θ k = ( ( L = a 0 a k cos π kn ) ( b k sin k= N 8 π kn N ))
there The power is P = N and the energy over one period is E N = a 0 = c 0 a k = c k cos(θ k ) b k = c k sin(θ k ) L = N n=0 N n=0 N if N even N if N odd f(n) = f(n) = N N k=0 N k=0.6 Discrete Fourier Transform (DFT).6. Denition c k c k Note: X k = DF T (x n ) = x n = IDF T (X k ) = N N n=0 N n=0 N k=0 e jπ k k 0 N.6. Circular convolution x n e jπnk/n k = 0,,..., N Transform X k e jπnk/n n = 0,,..., N Inversion n = N δ(k k 0, (modulo N)) x n N y n = N l=0 x l y n l,modulon i.e. index is determined modulo N. Circular convolution is also denoted x(n) DFT X k Y k y(n). Circular convolution.6.3 Non-circular convolution using the DFT If x(n) = 0 for n [0, L ] and y(n) = 0 for n [0, M ] yields x y = 0 for n [0, N ] with N L M. The convolution can also be determined from with x y = x N y = IDFT(X k Y k ) n = 0,,..., N 0 f.ö. X k = DFT(x(n)) Y k = DFT(y(n)) 9
.6.4 Relation to the Fourier transform X(f): X(k/N) = X k = DF T (x(n)) if x(n) = 0 for n [0, N ] X(k/N) = X k = DF T (x p (n)) in general x(n) there x p (n) =.6.5 Relation to Fourier series X ( ) k = X k = DF T (x(n)) = N c k N l= x(n ln) if there and c k = N x(n) = x p (n), 0 n N x p (n) = N n=0 N k=0 nk jπ c k e N < n < nk jπ x p (n)e N k = 0,,..., N.6.6 Parseval's theorem N n=0 x(n)y (n) = N N k=0 X k Y (k) 0
.6.7 Some properties of the DFT Time Frequency x(n), y(n) X(k), Y (k) x(n) = x(n N) X(k) = X(k N) x(n ) X(N k) x((n )) N X(k)e jπk/n x(n)e jπn/n X((k )) N x (n) X (N k) x (n) N x (n) X (k)x (k) x(n) N y ( n) X(k)Y (k) x (n)x (n) N (k) N X (k) N n=0 x(n)y (n) N N k=0 X(k)Y (k).7 Some window functions and their Fourier transform i) Window functions symmetrically around origin (M odd) i.e. the functions are non-zero only for (M )/ n (M )/ Rectangular window: Hanning window: Hamming window: Blackman window: w rect (n) = W rect (f) = M sin(πfm) Msin(πf) ( ) πn w hanning (n) = 0.5 0.5cos M W hanning (f) = 0.5 W rect (f) 0.5 W rect ( f ) M ) 0.5 W rect ( f M ( ) πn w hamming (n) = 0.54 0.46cos M W hamming (n) = 0.54 W rect (f) 0.3 W rect ( f ) M ) 0.3 W rect ( f M w blackman (n) = 0.4 0.5cos πn 4πn 0.08cos M M
W blackman (f) = 0.4 W rect (f) 0.5 W rect ( f Bartlett window (triangular window): w triangel (n) = W triangel (f) = M 0.5 W rect ( f 0.04 W rect ( f ) M ) M ) M ) 0.04 W rect ( f M n (M )/ ( sin πfm ) M sin(πf) M W rect ( ) f for small f ii) Window functions dened for the interval 0 n M (M odd) Hanning window Hamming window Blackman window w hanning (n) = 0.5 cos π ( ) n M = M ( ( )) n = 0.5 cos π M w hamming (n) = 0.54 0.46 cos π ( ) n M M πn = 0.54 0.46 cos M w blackman (n) = 0.4 0.5 cos π ( ) n M M 0.08 cos 4π ( ) n M = M Bartlett (triangular) window = 0.4 0.5 cos w triangel (n) = πn 4πn 0.08 cos M ( ) n M M = M
3 Sampling of analogous signals 3. Sampling and reconstruction Fourier transforms Time continuous signals: X a (F ) = x a(t)e jπf t dt Time discrete signal: x a (t) = X a(f )e jπf t df X(f) = n= x(n)e jπfn The sampling theorem x(n) = / / X(f)ejπfn df For a bandlimited signal x a (t), that is X a (F ) = 0 for F /T yields x a (t) = Sampling frequency F s = /T. Sampling n= x(n) sin π (t nt ) T (t nt ) π T Reconstruction (ideal) x(n) = x a (nt ) ; T = F s ( ) F X(f) = X = F s X a (F kf s ) Fs k= ( ) F Γ(f) = Γ = F s Fs x a (t) = X a (F ) = F s X n= ( ) F Fs Γ a (F ) = ( ) F Γ F s Fs k= Γ a (F kf s ) x(n) sin π (t nt ) T (t nt ) π T F F s F F s Reconstruction using a sample-and-hold circuit X a (F ) = ( ) F X sin(πf T ) e jπf T HLP (F ) F s Fs πf T Γ a (F ) = ( ) F sin(πf T ) Γ H F s Fs πf T LP (F ) 3
Block diagram over D/A-conversion Ideal reconstruction x(n) T Lågpass y (t) a -Fs/ Fs/ x(n) Σ δ( t-n T) n x() T y (t) a X(f) n t t F X( ) T Fs Y (F) a f F F -.5.5 -Fs/ Fs/ -Fs/ Fs/ y a (t) = Y a (F ) = F s X x(n) sin π (t nt ) T (t nt ) n= ( ) F Fs Reconstruction using a sample-and-hold curcuit π T F F s x(n) h SH (t) Lågpass y a (t) T -Fs/ Fs/ x(n) Σ δ( t-n T) n y a (t) n t t X(f) F X( ) H (F) Y (F) Fs SH a f F F -.5.5 -Fs/ Fs/ -Fs/ Fs/ Y a (F ) = ( ) F X F s Fs sin(πf T ) πf T e jπf T HLP (F ) 4
3. Distortion measurements 3.. Aliasing distortion from sampling Spectrum after anti-aliasing lter: Γ in (F ) Aliasing distortion: Signal power: there 0 F p F s / D A = F s F p Γ in (F )df Fp D s = Γ in (F )df 0 Aliasing distortion ratio: A: SDR A = D S D A = Monotonic decreasing spectrum yields F p Γ 0 in (F )df Γ in(f )df Fs Fp B: SDR 0 A = min F Fp Γ in (F ) Γ in (F s F ) SDR 0 A = Γ in(f p ) Γ in (F s F p ) 3.. Signal-to-noise ratio during reconstruction Signal-to-quantization noise ratio: Signal power: D P = D S = Signal-to-quantization noise ratio: A useful measurement is F s/ Fs / A: SDR P = D S D P = B: SDR 0 P = min F <Fs / 0 Γ out (F )df Γ out (F )df F s/ Γ 0 out(f )df Γout(F )df Fs/ SDR 0 P = Γ out(f p ) Γ out (F s F p ) Γ out (F ) Γ out (F s F ) there F p is the highest frequency component in the digital signal. 5
3.3 Quantization noise D Q linear quantization, small Signal power SDR Q = D q Quantization noise for sinusoids, maximal amplitude, r bits SDR Q =.76 6 r[db] Quantization noise for sinusoids, amplitude expressed in peak- and RMS, r bits SDR Q = 6 r.76 0 0 log there [ V, V ] is the maximal range of the signal. ( ) ( ) Apeak V A RMS 0 0 log A peak 3.4 Sampling rate conversion, decimation and interpolation Down-sampling a factor M M y(n) = {... u(0), u(m), u(m)...} Y (f) = M M i=0 U ( ) f i M Up-sampling a factor L L w(n) = {... x(0), 0, 0,..., x(), 0, 0,..., x()...} }{{}}{{} L- st L- st W (f) = X(fL) 6
4 Analogous lters 4. Filter approximations of ideal LP-lter General form of the approximated amplitude function H(Ω) = K g N ( ( ΩΩp ) ) Ω = πf there ( ) g N Ω Ω p Ω Ω p < Ω Ω p > and Ω p is the cuto frequency of the lter. Sometimes it is convenient to normalize the angular frequency with Ω p. This corresponds to setting Ω p = below. 4.. The Butterworth lter H(Ω) = K ( ) N Ω Ω p H( Ω) Kurvan går alltid genom dessa punkter 3dB K K Ω p Ω K = Maximum of the amplitude function. K = the value of the amplitude function for Ω = 0. The denominator to the system function are the Butterworth polynomial if Ω p =. These polynomials are showed in table.. Generally, Ω p yields H(s) = there a,..., a N are nd in table 4.. K ( ) N ( ) N ( ) s Ω p s an Ω p s a Ω p 7
Table 4. Coecients a ν in the Butterworth polynomial s N a N s N... a s N a a a 3 a 4 a 5 a 6 a 7 3 4.63 3.44.63 5 3.36 5.36 5.36 3.36 6 3.864 7.464 9.4 7.464 3.864 7 4.494 0.03 4.606 4.606 0.03 4.494 8 5.6 3.38.848 5.69.848 3.38 5.6 Table 4. Factorized Butterworth polynomial for Ω p =. For Ω p let s s/ω p. N (s ) (s s ) 3 (s s )(s ) 4 (s 0.76536s )(s.84776s ) 5 (s )(s 0.680s )(s.680s ) 6 (s 0.576s )(s s )(s.938s ) 7 (s )(s 0.4450s )(s.465s )(s.80s ) 8 (s 0.3896s )(s.0s )(s.6630s )(s.96s ) 4.. The Chebyshev lters H(Ω) = K ( ) ε TN Ω Ωp Ripple H( Ω) N udda K K ε N jämn Ω p Kurvan går alltid genom denna punkt Ω OBS! Ej nödvändigtvis 3dB-gräns Ripple = 0 log( ε ) db. K = Maximum of the amplitude function. K the value of the amplitude function for Ω = 0 for N is even. 8
T N ( Ω Ω p ) is the Chebyshev polynomial. (Denoted with C N ( Ω Ω p ) ). These are found in Table 4.3 for Ω p =. For Ω p let Ω Ω Ω p i Table 4.3. System function H(s) = K a 0 { N udda N jämn ε ( s Ω p ) N an ( s Ω p ) N a0 there ε, a 0,..., a N are found in table 4.4. The poles for H(s) is found in table 4.5 for Ω p =. For Ω p the poles are multiplied by Ω p. Table 4.3 Chebyshev polynomial. or cos(n arccosω) Ω T N (Ω) = cosh(n arccoshω) Ω T N (Ω) = Recursive determination ( Ω Ω ) N ( Ω Ω ) N T N (Ω) = ΩT N (Ω) T N (Ω) Ω = πf Ω N T N (Ω) 0 Ω Ω 3 4Ω 3 3Ω 4 8Ω 4 8Ω 5 6Ω 5 0Ω 3 5Ω 6 3Ω 6 48Ω 4 8Ω 7 64Ω 7 Ω 5 56Ω 3 7Ω 8 8Ω 8 56Ω 6 60Ω 4 3Ω 9 56Ω 9 576Ω 7 43Ω 5 0Ω 3 9Ω 0 5Ω 0 80Ω 8 0Ω 6 400Ω 4 50Ω 9
Table 4.4. Coecients a ν in the Chebyshev lter. 0.5dB ripple (ε = 0.349, ε = 0.). N a 7 a 6 a 5 a 4 a 3 a a a 0.863.46.56 3.53.535 0.76 4.97.77.05 0.379 5.7.937.309 0.75 0.79 6.59.7.589.7 0.43 0.095 7.5.43.869.648 0.756 0.8 0.045 8.46.657.49.84.48 0.573 0.5 0.04 -db ripple (ε = 0.509, ε = 0.59). N a 7 a 6 a 5 a 4 a 3 a a a 0.965.098.0 3 0.989.38 0.49 4 0.953.454 0.743 0.76 5 0.937.689 0.974 0.580 0.3 6 0.98.93.0 0.939 0.307 0.069 7 0.93.76.49.357 0.549 0.4 0.03 8 0.90.43.655.837 0.447 0.448 0.07 0.07 -db ripple (ε = 0.765, ε = 0.585). N a 7 a 6 a 5 a 4 a 3 a a a 0.307 0.804 0.83 3 0.738.0 0.37 4 0.76.56 0.57 0.06 5 0.705.499 0.693 0.459 0.08 6 0.70.745 0.867 0.77 0.0 0.05 7 0.698.994.039.44 0.383 0.66 0.00 8 0.696.4..579 0.598 0.359 0.073 0.03 3-dB ) ripple (ε = 0.998, ε = 0.995). N a 7 a 6 a 5 a 4 a 3 a a a 0.00 0.645 0.708 3 0.597 0.98 0.5 4 0.58.69 0.405 0.77 5 0.575.45 0.549 0.408 0.063 6 0.57.663 0.69 0.699 0.63 0.044 7 0.568.9 0.83.05 0.300 0.46 0.06 8 0.567.6 0.97.467 0.47 0.3 0.056 0.0 *) The table is determined for "exact"3db, not for 0 log 3.0dB. Means ε and a 0 for N =. 30
Table 4.5. Poles for Chebyshev lters. 0.5dB ripple (ε = 0.349, ε = 0.). N = 3 4 5 6 7 8 -.863-0.73-0.66-0.75-0.36-0.078-0.56-0.044 ±j.004 ±j.06 ±j.008 ±j.005-0.33-0.43-0. -0. -0.057-0.4 ±j.0 ±j0.4 ±j.0 ±j0.738 ±j.006 ±j0.85-0.93-0.90 ±0.60-0.86 ±j0.65 ±j0.70 ±j0.807 ±j0.570-0.3-0.0 ±j0.448 ±j0.00 -db ripple (ε = 0.509, ε = 0.59). N = 3 4 5 6 7 8 -.965-0.549-0.494-0.39-0.89-0.06-0.05-0.035 ±j0.895 ±j0.983 ±j0.993 ±j0.996-0.47-0.337-0.089-0.70-0.046-0.00 ±j0.966 ±j0.407 ±j0.990 ±j0.77 ±j0.995 ±j0.845-0.34-0.3-0.8-0.49 ±j0.6 ±j0.66 ±j0.798 ±j0.564-0.85-0.76 ±j0.443 ±j0.98 -db ripple (ε = 0.765, ε = 0.585). N = 3 4 5 6 7 8 -.307-0.40-0.369-0.05-0.8-0.047-0.55-0.06 ±j0.83 ±j0.958 ±j0.98 ±j0.990-0.84-0.53-0.067-0.8-0.034-0.075 ±j0.93 ±0.397 ±j0.973 ±0.79 ±j0.987 ±j0.839-0.77-0.75-0.097-0.3 ±j0.60 ±j0.63 ±j0.79 ±j0.56-0.40-0.33 ±j0.439 ±j0.97 3-dB ) ripple (ε = 0.998, ε = 0.995). N = 3 4 5 6 7 8 -.00-0.3-0.99-0.085-0.77-0.038-0.6-0.0 ±j0.777 ±j0.946 ±j0.976 ±0.987-0.493-0.06-0.055-0.04-0.08-0.06 ±j0.904 ±j0.39 ±j0.966 ±0.75 ±j0.983 ±j0.836-0.44-0.43-0.079-0.09 ±j0.597 ±j0.6 ±j0.789 ±j0.559 *) See note for Table 4.4. -0.4-0.08 ±j0.437 ±j0.96 3
4..3 The Bessel lter The Bessel lter gives a maximum at group delay. Coecients to the Bessel polynomial. n a 0 a a a 3 a 4 a 5 3 3 3 5 5 6 4 05 05 45 0 5 945 945 40 05 5 6 0395 0395 475 60 0 Rotes to the Bessel polynomial. n.0000.5000 ±j0.8660 3.3.8389 ±j.7544 4.896 ±j0.867.038 ±j.6574 5 3.6467 3.350 ±j.747.347 ±j3.570 6 4.484 ±j0.8675 3.7357 ±j.663.559 ±j4.497 Factorized Bessel polynomial n s s 3s 3 3 3 (s 3.6778s 6.45944)(s.39) 5 4 (s 5.794s 9.403)(s 4.0758s.4878) 05 5 (s 6.7039s 4.75)(s 4.64934s 8.563)(s 3.64674) 945 6 (s 8.4967s 8.803)(s 7.474s 0.858) (s 5.0386s 6.540) 0395 3
4. Frequency transformation of analogous lters. Start with the frequencies from the specication in the analogous high-pass, bandpass or band-stop lter4. In the nal lter, this are Ω Ω = Ω l Ω u.. Transform to the LP-lter frequencies Ω p =, Ω r. 3. Determine the LP-lter coecients. 4. Transform back to ( to HP, BP, BS) by replacing s in H(s) below. For BP, BS it is convenient to transform the poles directly if H(s) should be in a factorized form in :a-order polynomial. Determine a new value of Ω or Ω (if A B) if needed. Α(Ω) LP HP BP BS Α(Ω) Α(Ω) Α(Ω) Ω r Ω Ω r Ω u Ω Ω Ω l Ω uω Ω Ω l Ω Ω Ωu Ω S Ω u s (s Ω l Ω u ) s(ω u Ω l ) s(ω u Ω l ) (s Ω l Ω u ) Forward Backward LP-HP Ω r = Ω u /Ω r Ω r = Ω u /Ω r LP-BP Ω av = (Ω u Ω l )/ Ω r = min( A, B ) Ω = Ω rω av Ω l Ω u Ω av Ω r A = ( Ω Ω l Ω u )/[Ω (Ω u Ω l )] Ω = Ω rω av Ω l Ω u Ω av Ω r B = (Ω Ω l Ω u )/[Ω (Ω u Ω l )] s BP = S LP Ω av ± (S LP Ω av ) Ω u Ω l ) LP-BS Ω av = (Ω u Ω l )/ Ω r = min( A, B ) Ω = Ω av/ω r Ω l Ω u Ω av /Ω r A = Ω (Ω u Ω l )/( Ω Ω l Ω u ) Ω = Ω av/ω r Ω l Ω u Ω av /Ω r B = Ω (Ω u Ω l )/( Ω Ω l Ω u ) s BP = Ω av /S LP ± (Ω av /S LP ) Ω u Ω l ) 33
5 Time discrete lter 5. FIR lters and IIR lters FIR-lter IIR-lter H(z) = b 0 b z... b M z M { bn 0 n M h(n) = 0 otherwise H(z) = b 0 b z... b M z M a z... a N z N h(n) = Z {H(z)} 5. FIR lters using the window method Impulse response h(n) = h d (n) w(n) with desired impulse response h d (n) and spectrum H d (ω) (i 0 ω π) and time window w(n) Low pass: h d (n) = ω c π ( ) sin ω c n M ( ) ω c n M H d (ω) = { e jω (M )/ ω < ω c 0 otherwise Band pass: ( h d (n) = cos (ω 0 n M )) ωc π ( ) sin ω c n M ( ) ω c n M H d (ω) = { e jω (M )/ ω 0 ω c < ω < ω 0 ω c 0 otherwise High pass: ( h d (n) = δ n M ) ω c π ( ) sin ω c n M ( ) ω c n M H d (ω) = { e jω (M )/ ω > ω c 0 otherwise Filter spectrum H(ω) = H d (ω) W (ω) and at the cuto frequency ω c is the attenuation 6dB. For dimension of lters, the approximation below gives an approximation of the length M. 34
Table 5. Size of main lobe and side lobes for same useful window. Table 5. Approximative Highest Window size of the side lobe main lobe (db) Rectangular 4π/M -3 Bartlett 8π/M -7 Hanning 8π/M -3 Hamming 8π/M -43 Blackman π/m -58 Size of width between pass- and stop band main lobe and side lobes for some useful window lters. Window Width between Highest side lobe pass- and stop band (Hz) (db) Rektangular 0.6/M - Hamming.7/M -55 Blackman 3/M -75 A better approximation is to use (f small, M large) sin(πfm) M sin(πf) sin(πfm) πfm (f small, M large.) H(f) as a function of x = (f f c ) M with M = 99, f c = 0. for rectangular window, hamming window and blackman window are found in gure below. 35
Magnitude spectra for some lters using the window method 0 x = { (f fc ) M lågpasslter (f f c ) M högpasslter 3 H(f) /db 4 5 6 0 0 0 7 8 9. 0.8 0.6 0.4 0. 0 0. 0.4 x 0 Dämpning i db 30 40 50 Rektangel 60 70 80 Hamming Blackman 90 0.5 0 0.5.5.5 3 3.5 4 x=(f fc)*m FIR lters using the window method M = 99 and f c = 0.. Scale on the x-axis x = (f f c )M. Higpasslter, use F x = (f f c )M. Window function used are Rectangular, Hamming and Blackmann. 36
5.3 Ekviripple FIR lters Dimensioning of ekviripple lter using the Remez algorithm. Approximatively from Kaiser. H(f) δp - δp δs f p fs f N = D (δ p, δ s ) f f = f s f p D (δ p, δ s ) = 0 log δ p δ s 3 4.6 5.4 FIR lters using Least Squares method Minimizing gives and M n=0 E = n [x(n) h(n) d(n)] h(n)r xx (n l) = r dx (l) l = 0,..., M E min = r dd (0) M k=0 h(k)r dx (k) there r xx (l) is the correlation function for x(n) and r dx (l) is the cross correlation between d(n) and x(n). I matrix form this can be written R xx h = r dx h = R xx r dx E min = r dd (0) h T r dx 37
5.5 IIR-lter Design of IIR-lter from analogous lters. 5.5. The impulse invariance method.. h(n) = h a (nt ) h a (t) = e σ 0t H a (s) = s σ 0 H(z) = e σ 0T z h a (t) = e σ 0t cos Ω 0 t H a (s) = s σ 0 (s σ 0 ) Ω 0 3. H(z) = z e σ 0T cos Ω 0 T z e σ 0T cos Ω 0 T z e σ 0T h a (t) = e σ 0t sin Ω 0 t H a (s) = Ω 0 (s σ 0 ) Ω 0 H(z) = 5.5. Bilinear transformation Frequency transformation (prewarp) z e σ 0T sin Ω 0 T z e σ 0T cos Ω 0 T z e σ 0T F prewarp = T Analogous lter design in the variable Ω prewarp. tan(πf) π H(z) = H a (s) där s = T T is a normalizing factor (can often be chosen =). z z 38
5.5.3 Quantication of the lter coecients Pole movements when the coecients a,..., a k varies a,..., a k p i p i a a p i a k a k For the normal description (direct form II) yields 5.6 Lattice lter p i p k j i = a j (p i p )(p i p )... (p i p k ) }{{} k factors (p i p i ) not included f 0(n) f (n) f (n)... f M-(n) = y(n) x(n) K K K K K z - z - g 0(n) g (n) Lattice FIR... z - g (n) g (n) M- x(n) f N (n) - f N- (n) K N f (n)... f (n) f 0(n) = y(n) - - K K g (n) N K N z -... K z - g (n) Lattice all-pole IIR g (n) K z - g (n) 0 x(n) f N (n) f N- (n) f (n) f (n)... - K - - N K K f (n) 0 g (n) N v N K N z -... g (n) v K z - g (n) v K z - g (n) 0 v 0... y(n) Lattice-ladder 39
A 0 (z) = B 0 (z) = { Am (z) = A m (z) K m z B m (z) B m (z) = K m A m (z) z B m (z) there A m (z) = K m (A m (z) K m B m (z)) A m (z) = Z{α m (n)} med K m = α m (m) B m (z) = Z{β m (n)} Relations between A m (z) and B m (z) B m (z) = z m A m (z ) and β m (k) = α m (m k) Lattice-FIR Lattice-all pole IIR Lattice-ladder there and H(z) = A M (z) H(z) = A N (z) H(z) = C N(z) A N (z) = c 0 c z... c N z N A N (z) C m (z) = C m (z) v m B m (z) c m (m) = v m m = 0,,..., N 40
6 Spectral estimation Spectral estimation γ xx (m) = E{x(n)x(n m)} autocorrelation Γ xx (f) = m= γ xx e jπfm power spectrum The Periodogram r xx (m) = N P xx (f) = N m n=0 x(n)x(n m) 0 m N N r xx (m)e jπfm = N x(m)e jπfm m= N N m=0 power spectrum (estimate) autocorrelation (estimate) E{r xx (m)} = ( m ) N γ xx (m) γ xx (m) when N var(r xx (m)) N n= [γ xx(n) γ xx (n m)γ xx (n m)] 0 when N E{P xx (f)} = / / Γ xx (α)w B (f α)dα there W B (f) is the Fourier transform of the Bartlett window ( ) m N var(p xx (f)) = Γ xx(f) if x(n) Gaussian. The Periodogram using the DFT: ( ) sinπfn Γ Nsinπf xx(f) då N P xx ( k N ) = N N nk jπ x(n)e N n=0 k = 0,..., N 4
Mean of periodogram Quality factor Q = [E{P xx(f)}] var(p xx (f)) Relative variance Q Q time-bandwidth product. Periodogram f = 0.9 M Q = Bartlett (N = K M) f = 0.9 M Q B = N M Rectangular window No overlapping Welch (N = L M) f =.8 M Blackman/Tukey f = 0.6 M f = 0.9 M Q B = 6 9 N M Q B = N M Q B = 3 N M Triangular window 50% overlapping Rectangular window Triangular window Resolution f determined in the -3dB points (main lobe). 4