Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

BME 302 Bioinstrumentation

LTI, CONVOLUTION AND FIR FILTER

1
LTI, Convolution and FIR Filter
• Can you recognize the difference between convolution and cross-correlation

2
Convolution

Reverse in time axis Move by


𝑔 (𝜏 ) 𝑔 (−𝜏 ) 𝑔 (−(𝜏 − 𝑡 ))

𝑔 (𝜏 ) 𝑔(−𝜏) 𝑔 (−(𝜏 − 𝑡))

𝜏 𝜏 𝑡 𝜏
Convolution

• : a signal
• : a filter
Decomposed
𝑓 (𝑡 ) ( 𝑓 ∗ 𝑔)(𝑡) Transformed
Filtered * Wikipedia
Ex) Five-term Average Filter

𝑥 [ 𝑛 ] + 𝑥 [ 𝑛 −1 ] + 𝑥 [ 𝑛 − 2 ] + 𝑥 [ 𝑛 −3 ] + 𝑥 [ 𝑛 − 4 ]
𝑦 [ 𝑛 ]=
5

1 1 1 1 1
𝑦 [ 𝑛 ] = 𝑥 [ 𝑛 ] + 𝑥 [ 𝑛 −1 ] + 𝑥 [ 𝑛 −2 ] + 𝑥 [ 𝑛 −3 ] + 𝑥 [ 𝑛 − 4 ]
5 5 5 5 5

𝑦 [ 𝑛 ] =h [ 0 ] 𝑥 [ 𝑛 ] +h [ 1 ] 𝑥 [ 𝑛− 1 ] +h [ 2 ] 𝑥 [ 𝑛−2 ] +h [ 3 ] 𝑥 [ 𝑛− 3 ] +h [ 4 ] 𝑥 [ 𝑛− 4 ]

: Filter coefficients

5
Convolution with Filter Coefficients
n=0

h[𝑛]
Filter coefficients

𝑥[𝑛] 𝑦 [ 𝑛 ] =h [ 0 ] 𝑥 [ 𝑛 ] +h [ 1 ] 𝑥 [ 𝑛− 1 ] + ⋯

6
Convolution

• A function of time t
• At a certain time of t, two functions are multiplied and the area under the
multiplied functions is calculated.
• For all time interval t, the area values are expressed by time t

• A function of time n
• At a certain time of n, two functions are multiplied and the area under the
multiplied functions is calculated.
• For all time interval n, the area values are expressed by time n
FIR Filter is Convolution

𝑁 −1
𝑦 [ 𝑛 ]= ∑ h [ 𝑘 ] 𝑥 [𝑛 − 𝑘]
𝑘= 0

𝑁 −1
𝑦 [ 𝑛 ]= ∑ 𝑥 [ 𝑘 ] h [𝑛 − 𝑘]
𝑘= 0

8
Impulse Response
• Dirac delta function (continuous domain)

• Kronecker delta function (discrete


domain)

9
Linear Time-Invariant system (LTI)
• Linear: scaling and additivity

x[n] y[n]

kx[n] ky[n] scaling

x1[n] y1[n]

x2[n] y2[n]

x1[n]+x2[n] y1[n]+y2[n] additivity


Linear Time-Invariant system (LTI)
• Linear: scaling and additivity

x1[n] y1[n]

x2[n] y2[n]

kx1[n]+ px2[n] ky1[n]+ py2[n]


Linear Time-Invariant system (LTI)
• Time-invariant: shifting

x[n] y[n]

x[n-k] y[n-k]
System Definition

[n] h[n] Impulse response

Why [n] ???

Signal x[n] can be expressed by [n]

Ex) x[0] = 3, x[1] = -1, x[2] = 2 [n]+ x[1] [n-1]+x[2][n-2]

[n] h[n]
𝛿[n-1] h[n-1] scaling and shifting
𝛿[n-2] h[n-2]
additivity
[n]+ [n-1]+ [n-2] [n]+ [n-1]+[n-2]
= [n]- [n-1]+ [n-2]
System Definition

[n] h[n] Impulse response

f(x[n], h[n]) = +[n]+ [n-1]+[n-2] +

f(x[n], h[n]) = f*h =


MATLAB

(C/C++, Java, Python)


b = fir1(34,0.48,'high’) h[n] Copy the array and do
convolution
y = conv (x, b) or y = filter(b, 1, x)
Low Pass Filter

x[n] h[n] x[n]*h[n]

IDFT

X[k] H[k] X[k]H[k]


Ideal Low Pass Filter

IDFT

17
END

You might also like