Download presentation
Presentation is loading. Please wait.
1
Lowpass Filter and Highpass Filter 指導老師 : 黃貞瑛老師 報 告 : 林 文 彬
2
2007/03/092 Outline Filter Lowpass Filter = Moving Average Lowpass Filter - Frequency Response Highpass Filter = Moving Difference Highpass Filter - Frequency Response Reference Book
3
2007/03/093 Filter Linear time-invariant operator x : input vector y : output vector Output vector y is the convolution of x with a fixed vector h Vector h: filter coefficients Ex: h(0), h(1), h(2), h(3), h(4), ….. Filters are digital, not analog h(n) come at discrete times t = nT, n=0, ±1, ±2, … Sampling period T is assumed to be 1 => t=0, ±1, ±2, …
4
2007/03/094 Filter Input x(n) and output y(n) come at all times t = 0, ±1, ±2, ….. y(n) = = convolution h * x in time domain Unite Impulse at time zero Input x = (…., 0, 1, 0, ….) x(n-k) = 0 at n ≠ k x(n-k) = x(k-k) = x(0) = 1 at n = k Output y(n) = = h(n)x(0) = h(n) Impulse response h(0), h(1), h(2), ….
5
2007/03/095 Filter Every linear operator acting on the signal vector x can be represented by a matrix Infinitely many components in x and y mean infinitely many entries in the filter matrix H Constant-diagonal matrix
6
2007/03/096 Lowpass Filter = Moving Average The simplest lowpass filter : y(n) = ½ x(n) + ½ x(n-1) Its output at time t=n is the average of input x(n) at that time and the input x(n-1) at previous time The filter coefficients : h(0) = ½ h(1)= ½ Standard form : Σh(k)x(n-k) with only two terms k=0 and k=1
7
2007/03/097 Lowpass Filter = Moving Average Suppose the input is the unit impulse x = (…,0,0,1,0,0,…) Output vector has y(0)=1/2 and y(1)=1/2 Only two nonzero components in the output The impulse response is the vector y = (…,0,0,1/2,1/2,0,…)
8
2007/03/098 Lowpass Filter = Moving Average Averaging filter = ½ (identity) + ½ (delay) y=Hx H: filter matrix The main diagonal comes from ½(identity) The subdiagonal comes from ½ (delay)
9
2007/03/099 Lowpass Filter = Moving Average y(n) = Σ k h(k)x(n-k) = …+ h(-2)x(n+2) + h(-1)x(n+1) +h(0)x(n) + h(1)x(n-1) + h(2)x(n-2) + … To see a filter as a constant-diagonal matrix The coefficient h(0) in the main diagonal It represents h(0) times the identity matrix [ h(0)x(n) ] The coefficient h(1) in the first subdiagonal It represents h(1) times a delay [ h(1)x(n-1) ] The coefficient h(2) in the next subdiagonal It represents h(2) times a two-step delay [ h(2)x(n-2) ]
10
2007/03/0910 Lowpass Filter = Moving Average When we deal with causal filters h(n) = 0 for negative n The filter matrix is lower triangular Our simple lowpass filter is a causal filter Our example has only a finite number(two) of nonzero filter coefficient h(n) We call the filter has a Finite impulse response (FIR filter) In other words, a causal FIR filter h(n) = 0 for all negative n and for large positive n The filter matrix is banded and lower triangular
11
2007/03/0911 Lowpass Filter - Frequency Response x(n) = e inw have pure frequency w The output vector y is a multiple (depending on w) of the input vector x y(n) = ½ x(n) + ½ x(n-1) = ½ e inw + ½ e i(n-1)w = ( ½ + ½ e -iw ) e inw = H(w) e inw = H(w)x(n) H(w) = ½ + ½ e -iw is frequency response function
12
2007/03/0912 Lowpass Filter - Frequency Response x(n) = e inw y(n) = h(0)e inw + h(1)e i(n-1)w + … H(w) = h(0) + h(1)e -iw + h(2) e -2iw + … = Σh(n) e -inw H(w+2π) = H(w) H(w+2π) = Σh(n) e -in(w+2π) When we add 2π to the freqency w, we add 2πn to the angle nw The e -inw = cos nw – i sin nw are not changed
13
2007/03/0913 Lowpass Filter - Frequency Response Some formula:
14
2007/03/0914 Lowpass Filter - Frequency Response H(w) = |H(w)|e iψ(w) |H(w)| : magnitude ψ(w) : phase angle Ex: H(w)= ½ + ½ e -iw So |H(w)| = cos(w/2), ψ(w)= -w/2 Because of ψ(w)= -w/2 the filter is linear in the phase
15
2007/03/0915 Lowpass Filter - Frequency Response y(n) = ½ x(n) + ½ x(n-1) H(w) = ½ + ½ e -iw H = ½ + ½ = 1 when w = 0 At zero frequency(direct current) the signal x = (…,1,1,1,…) output is y = (…,1,1,1,…) Thus the name “lowpass filter” When w=π,input vector x(n)=e iπn =(-1) n x = (…,1,-1,1,-1,1,…) H(π)=0 and y = Hx So y = (…,0,0,0,0,0,…)
16
2007/03/0916 Lowpass Filter - Frequency Response
17
2007/03/0917 Highpass Filter = Moving Difference A lowpass filter takes “averages” Outputs the moving average For example: ½ ( x(n)+x(n-1) ) A highpass filter takes “differences” Outputs the moving difference For example: ½ ( x(n)-x(n-1) ) The filter coefficients h(0)= ½ and h(1) = - 1/2 h = (…,0,0,1/2,-1/2,0,…) y(n) = ½ x(n) – ½ x(n-1)
18
2007/03/0918 Highpass Filter = Moving Difference y(n) = ½ ( x(n)-x(n-1) ) We can rewrited to the matrix form : y = Hx Highpass filter = ½ (identity) – ½ (delay) This is also a causal FIR filter
19
2007/03/0919 Highpass Filter – Frequency Response The input vector is x(n) = e inw The highpass output is y(n) = ½ e inw – ½ e i(n-1)w = ( ½ - ½ e -iw ) e inw = H 1 (w) e inw Recall that the lowpass frequency response function is H 0 (w) = ½ (1+ e -iw ) The highpass frequency response function is H 1 (w) = ½ (1- e -iw )
20
2007/03/0920 Highpass Filter – Frequency Response H 1 (w)= ½ (e iw/2 - e -iw/2 ) e -iw/2 = sin(w/2)i e -iw/2 The magnitude is |H 1 (w)| = |sin(w/2)| Since the sine function can be negative, we must take its absolute value The zero response at direct current [sin0 =0 ] The unit response at the highest frequency w = π [sin π/2 =1 ]
21
2007/03/0921 Highpass Filter – Frequency Response We see a discontinuity in the phase At other point the graph is linear, so we turn a blind eye to this discontinuity and say that the filter is still linear phase It’s the zero at w=0 that causes this discontinuity in phase
22
2007/03/0922 Reference Book G. Strang and T. Nguyen, Wavelets and Filter Banks, Wellesley-Cambridge Press, 1997. Chapter 1.2 Lowpass Filter Chapter 1.3 Highpass Filter
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.