Sie sind auf Seite 1von 5

8/27/2019

Circular Convolution
If x1 (n) and x2 (n) has a DFT X1(k) and X2(k),
then result of multiplication of two DFTs is

𝑋 𝑘 =𝑋 𝑘 𝑋 𝑘 ; 𝑘 = 0,1, … . 𝑁 − 1

Which is equivalent to circular convolution of two sequences in time domain

𝑥 𝑛 = 𝑥 𝑛 𝑥 𝑚−𝑛 ; 𝑚 = 0,1, … . 𝑁 − 1

Digital Signal Processing


CIRCULAR CONVOLUTION

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 1 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 2

Multiplication of two sequences DFT examples


𝑥 𝑛 𝑋 𝑘
𝛿(𝑘) 1/N
𝑥 𝑛 𝑋 𝑘
Then,
N𝛿(𝑘) 1
1
𝑥 𝑛 𝑥 𝑛 (𝑋 𝑘 ⊛ 𝑋 𝑘 )
𝑁
𝑁𝛿(𝑘 − 𝑙) 𝑊

𝐷𝐹𝑇 𝑊 = 𝑁𝛿(𝑘 − 𝑙)

𝑊 𝑊 = 𝑊 = 𝑁𝛿(𝑘 − 𝑙)

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 3 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 4

1
8/27/2019

Example
If
𝑥 𝑛 = 1; 0 ≤ 𝑛 ≤ 7

and,
3𝜋
𝑥 (𝑛) = cos 𝑛 ;0 ≤ 𝑛 ≤ 7
4
find the DFT of
𝑦 𝑛 = 𝑥 (𝑛)𝑥 (𝑛)

Digital Signal Processing


LINEAR CONVOLUTION

𝑦 𝑛 = (0,0,0,4,0,4,0,0)

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 5 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 6

Why Linear Convolution? Linear convolution with Circular convolution

𝑥 𝑛 = 1 2 3 4 5
x(n) y(n)
LTI SYSTEM

Circular shift

𝒚 𝒏 = 𝒙 𝒏 ∗ 𝒉(𝒏) 𝑥( 𝑛 − 1 ) = 5 1 2 3 4
𝑫𝑻𝑭𝑻 ∶ 𝒀 𝝎 = 𝑿 𝝎 𝑯(𝝎)
Linear shift

𝑋 𝜔 , 𝐻 𝜔 𝑎𝑛𝑑 𝑌 𝜔 are functions of continuous variable 𝜔 𝑥 𝑛−1 = 0 1 2 3 4

Computations cannot be done on digital computer.


Using DFT, it can be implemented if the result of Linear convolution and Circular Thus, if we insert proper number of zeros at the end of the original sequence and then
convolution are same compute circular convolution, then Linear convolution and circular convolution will have
the same result.

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 7 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 8

2
8/27/2019

How many zeros to be added? Example


If input to Linear filter 𝑥 𝑛 is of length L ; 0<n<L Determine the response of FIR filter with circular and linear convolution of the input
sequence 𝑥 𝑛 = 1, 2, 2, 1 with the impulse response ℎ 𝑛 = 1, 2, 3
Impulse function of the Linear filter ℎ 𝑛 is of length M ; 0<n<M
Then 𝑦 𝑛 = 𝑥 𝑛 ∗ ℎ(𝑛) is of length L+M-1
Linear Convolution:
Thus , 3
we need to append zeros so that the length of 𝑥 𝑛 and ℎ(𝑛) is not less then L+M-1 2 2 2

1 1 1

n k
0 1 2 3 n-2 n-1 n

Thus, appending zeros to x(n) and h(n) to make its length N and then performing circular
convolution yields the same result as that of linear convolution x(n) h(n-k)

y(n)=(1,4,9,11,8,3)

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 9 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 10

Example Aliasing occurs when N<L+M-1


Circular convolution method: For 𝑁 ≥ 6 Determine the sequence y(n) that results from the use of 4-point DFT
Find 6-point circular convolution for input sequence 𝑥 𝑛 = 1, 2, 2, 1, 0, 0 and 𝑋 𝑘 = 6, −1 − 𝑗, 0, −1 + 𝑗
impulse response ℎ 𝑛 = 1, 2, 3, 0, 0, 0 to get y(n)
𝐻 𝑘 = (6, −2 − 𝑗2, 2, −2 + 𝑗2)
𝑌 𝑘 = 36, 𝑗4,0, −𝑗4
DFT Method: Assume N=8 (FFT algorithm, N is a power of 2)
𝟕 Four point IDFT gives
𝑿 𝒌 = 𝒙[𝒏]𝑾𝒌𝒏
𝟖 = 6, 1.707 − 𝑗4.12, −1 − 𝑗, 0.29 − 𝑗0.12, 0, , −1 + 𝑗, 𝑦 𝑛 = 9,7,9,11 while linear convolution gave 𝑦 𝑛 = (1,4,9,11,8,3,0,0)
𝒏 𝟎
𝑦 4 𝑖𝑠 𝑎𝑙𝑖𝑎𝑠𝑒𝑑 𝑖𝑛𝑡𝑜 𝑦(0)
𝟕

𝑯 𝒌 = 𝒉𝒏 𝑾𝒌𝒏
𝟖
𝑦 0 =𝑦 0 +𝑦 4 =9
𝒏 𝟎
       
𝑦 5 𝑖𝑠 𝑎𝑙𝑖𝑎𝑠𝑒𝑑 𝑖𝑛𝑡𝑜 𝑦 1
= 6, 1+ 2−𝑗 3+ 2 , −2 − 𝑗2, 1 − 2 + 𝑗 3 − 2 , 2, , , ,
𝑦 1 =𝑦 1 +𝑦 5 =7
𝒀 𝒌 = 𝑿 𝒌 𝑯(𝒌)
𝑌 𝑘 = (36, −14.07 − 𝑗17.48, 𝑗4, 0.07 + 0.515, 0, 0.07 − 𝑗0.515, −𝑗4, −14.07 + 𝑗17.48)
8-point IDFT gives y(n) First two points of 𝑦(𝑛) are corrupted by the effect of aliasing !!!!
𝑦 𝑛 = (1,4,9,11,8,3,0,0)

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 11 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 12

3
8/27/2019

Circular convolution using Linear convolution Circular convolution using Linear convolution
Linear Convolution y(n)=(1,4,9,11,8,3,0,0)
y(n)=(1,4,9,11,8,3,0,0) ; N=4
n= 0 1 2 3 4 5 6 7

Circular Convolution y(n) = 1 4 9 11 8 3 0 0

𝑦 𝑛 = (9,7,9,11) y(n-4) = 0 0 0 0 1 4 9 11

𝑦 𝑛 = (9,7,9,11)
Thus, Circular convolution is linear convolution wrapped around a cylinder
y(n+4) = 8 3 0 0 0 0 0 0

y(n+8) = 0 0 0 0 0 0 0 0

𝑥 𝑛 ⊛ℎ 𝑛 =[ 𝑦(𝑛 + 𝑘𝑁)] 𝑅 (𝑛) ; 𝑛 = 0 𝑡𝑜 𝑁 − 1


Circular convolution of two sequences is found by performing linear convolution and
𝑅 𝑛 is a rectangular window function
aliasing the result
Circular convolution = linear convolution + aliasing
27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 13 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 14

Example Verification of the example


Find the 4-point circular convolution of 𝑥 𝑛 = (1,2,3,3) and ℎ 𝑛 = (1, −1, 1)
𝑦 𝑛 = 𝑥 𝑛 ℎ 𝑚−𝑛 ; 𝑚 = 0,1, … . 𝑁 − 1
if the linear convolution is 𝑦 𝑛 = 𝛿 𝑛 + 𝛿 𝑛 − 1 + 2𝛿 𝑛 − 2 + 2𝛿 𝑛 − 3 + 3𝛿(𝑛 − 5)

𝑥 𝑛 ⊛ℎ 𝑛 =[ 𝑦(𝑛 + 𝑘𝑁)] 𝑅 (𝑛) ; 𝑛 = 0 𝑡𝑜 𝑁 − 1 𝐺𝑖𝑣𝑒𝑛 𝑁 = 4 x 𝑛 = (1, 2, 3, 3)


h 𝑛 = (1, −1, 1, 0)
= 𝑦 𝑛 − ∞ + ⋯ + 𝑦 𝑛 − 8 + 𝑦 𝑛 − 4 + 𝑦 𝑛 + 𝑦 𝑛 + 4 + 𝑦 𝑛 + 8 + ⋯ + y(n + ∞) h −𝑛 = (1, 0, 1, −1)

𝑛= 0 1 2 3 h 1 − 𝑛 = (−1, 1, 0, 1)
+
y(n-8) = 0 0 0 0 0 0 0 0 1 h 2 − 𝑛 = (1, −1, 1, 0)
𝐹𝑟𝑜𝑚 𝑘 = −∞ 𝑡𝑜 + ∞

+ h 3 − 𝑛 = (0, 1, −1, 1)
y(n-4) = 0 0 0 0 0 0 0 0 1
+
y(n) = 1 1 2 2 0 3
+ N=4
y(n+4) = 1 1 2 2 0 3 0 0
+
y(n+8) = 1 1 2 2 0 3 0 0 0 0 0 0 𝑦 𝑛 = (1,4,2,2)
+ 𝑦 𝑛 = (1,4,2,2)

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 15 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 16

4
8/27/2019

Summary: Filtering of Long Data Sequence


1. To calculate N-point circular convolution using linear convolution Real time signal processing are often involved with long sequences.
𝑦 𝑛 =𝑥 𝑛 ∗ℎ 𝑛 Length of x(n)=L DFT involves operation on block of data
Length of h(n)=M
Due to limited memory of a digital computer, size of block should be limited
𝑥 𝑛 ⊛ ℎ 𝑛 = 𝑦 𝑛 + 𝑟𝑁 𝑅 (𝑛)
A long sequence is segmented into blocks which is processed one at a time via DFT, and
output blocks are fitted together to form overall signal sequence.
2. To calculate Linear convolution using circular convolution Two methods:
◦ Zero-pad x(n) and h(n) to make its length 𝑁 ≥ 𝐿 + 𝑀 − 1
◦ Apply circular convolution and thus, Overlap-save method
𝑥 𝑛 ∗ ℎ 𝑛 = 𝑥(𝑛) ⊛ ℎ(𝑛) Overlap-add method

3. To calculate Linear convolution using DFT and IDFT


◦ Zero-pad both x(n) and h(n) to make its length 𝑁 ≥ 𝐿 + 𝑀 − 1
◦ Take N-point DFT of x(n) and h(n) Assumption : FIR filter has size M , input data sequence have blocks of length L>>M
◦ 𝑥 𝑛 ∗ ℎ 𝑛 = 𝑥 𝑛 ⊛ ℎ 𝑛 = 𝐼𝐷𝐹𝑇{𝑋 𝑘 𝐻 𝑘 }

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 17 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 18

Overlap-save method for linear filtering Example


Size of input data blocks is made Determine the output y[n] of a filter whose impulse response is

N=L+M-1 ℎ 𝑛 = 2𝛿 𝑛 − 𝛿 𝑛 − 1 + 2𝛿[𝑛 − 2]

Each data block consists of the last M - 1 And input signal is 𝑥 𝑛 = (−2) {𝑢 𝑛 − 𝑢 𝑛 − 8 } using overlap-save method. Take sub-
data points of the previous data block frame length of 4.
followed by L new data points 𝑥 𝑛 = 1, −2,4, −8,16, −32,64, −128 ℎ 𝑛 = [2, −1,2]

N-point DFT is computed for each data 𝑥 𝑛 = 0 0 1 -2 4 -8


block
𝑥 𝑛 = 4 -8 16 -32 64 -128
Impulse response of FIR filter is also
increased in length by appending L-1 zeros 𝑥 𝑛 = 64 -128 0 0 0 0
to make the length L+M-1
𝑦 𝑛 = 16 -16 2 -5 12 -24
N-point DFT of h(n) is computed once and
stored
𝑦 𝑛 = 264 -276 48 -96 192 -384
y(n)=y1(n)+y2(n)+….. After discarding
first M-1 points of each blocks of y(n) i.e 𝑦 𝑛 = 128 -320 256 -256 0 0
y1(n), y2(n) and so on 𝑦 𝑛 = 2 -5 12 -24 48 -96 192 -384 256 -256

27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 19 27-Aug-19 DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING 20

Das könnte Ihnen auch gefallen