0% found this document useful (0 votes)
29 views24 pages

ECT303 - Module 1 - Part - 3

Uploaded by

np9i64mi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views24 pages

ECT303 - Module 1 - Part - 3

Uploaded by

np9i64mi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

ECT303 DIGITAL SIGNAL

PROCESSING
MODULE 1- PART III

Ms. Neethu Radha Gopan, Asst. Professor, Dept. of ECE, RSET


Circular Convolution

➢ Defined as the convolution of two periodic functions.


➢ The length of the output samples is N= Max(L,M).
𝑁−1

𝑦 𝑛 = 𝑥1 𝑛 𝑥2 𝑛 = ෍ 𝑥1 (𝑘) 𝑥2 ( 𝑛 − 𝑘 )𝑁
𝑘=0
Concentric Circle Method

➢ Given 2 sequences 𝑥1 (𝑛) & 𝑥2 (𝑛) , the circular convolution is obtained as follows:
1. Graph N samples of 𝑥1 (𝑛) as equally spaced points around an outer circle in the
counter clockwise direction.
2. Starting at the same point as 𝑥1 (𝑛), graph N samples of 𝑥2 (𝑛)as equally spaced
points around the inner circle in the clockwise direction.
3. Multiply the corresponding samples on the 2 circles & sum the products to produce
output.
4. Rotate the inner circle one sample at a time in the counter clockwise direction and
repeat step 3 to obtain the next output sample.
5. Repeat step 4 till the inner circle samples line up with the first sample of the exterior
circle once again.
Q. Find the circular convolution of 2 finite duration sequences 𝑥1 (𝑛) =
1, −1, −2,3, −1 & 𝑥2 (𝑛) = {1,2,3} using concentric circle method

Soln:
Both sequences must be of same length N= (max[5,3]) =5. Hence , append 2 zeros to 𝑥2 (𝑛).
𝑥1 𝑛 = 1, −1, −2,3, −1 𝑥2 (𝑛) = {1,2,3,0,0}

𝑦(0) = 1 1 + 0 −1 + 0 −2 + 𝑦(1) = 2 + −1 + 0 + 0 + −3 𝑦(2) = 3 − 2 − 2 + 0 + 0


3 3 + 2 −1 = 8 = -2 = -1
𝑦(3) = 0 − 3 − 4 + 3 + 0 𝑦(4) = 0 + 0 − 6 + 6 − 1
= -4 = -1

𝑦(𝑛) = {8, −2, −1, −4, −1}


Matrix Multiplication Method

➢ In this method, the circular convolution of 𝑥1 𝑛 & 𝑥2 (𝑛), given by 𝑥3 𝑛 =


𝑥1 (𝑛) 𝑥2 (𝑛) can be obtained as follows:
𝑥2 (0) 𝑥2 (𝑁 − 1) 𝑥2 𝑁 − 2 ⋯ 𝑥2 (1) 𝑥1 (0) 𝑥3 (0)
𝑥2 (1) 𝑥2 (0) 𝑥2 𝑁 − 1 ⋯ 𝑥2 (2) 𝑥1 (1) 𝑥3 (1)
𝑥2 (2) 𝑥2 (1) 𝑥2 0 ⋯ 𝑥2 (3) 𝑥1 (2) 𝑥3 (2)
. =
⋮ ⋮ ⋮ ⋮ ⋮ ⋮
𝑥2 (𝑁 − 2) 𝑥2 (𝑁 − 3) 𝑥2 𝑁 − 4 ⋯ 𝑥2 𝑁 − 1 𝑥1 (𝑁 − 2) 𝑥3 (𝑁 − 2)
𝑥2 (𝑁 − 1) 𝑥2 (𝑁 − 2) 𝑥2 𝑁 − 3 ⋯ 𝑥2 (0) 𝑥1 (𝑁 − 1) 𝑥3 (𝑁 − 1)
➢ The sequence 𝑥2 (𝑛)is repeated via circular shift of samples (till the 𝑁 − 1𝑡ℎ
circular shift) and represented as an N×N matrix.
➢ The sequence 𝑥1 (𝑛) is represented as a column matrix . The multiplication of
these 2 matices results in 𝑥3 (𝑛)
Q. Find the circular convolution of 2 sequences 𝑥1 (𝑛) = 1, −1, −2,3, −1 &
𝑥2 (n) = {1,2,3} using Matrix method.

Soln:
To find circular convolution , both sequences must be of same length N= max(5,3)=5.
Hence , append 2 zeros to 𝑥2 (𝑛).
𝑥1 (𝑛) = 1, −1, −2,3, −1 𝑥2 (n) = {1,2,3,0,0}

1 0 0 3 2 1 8
2 1 0 0 3 −1 −2
3 2 1 0 0 . −2 = −1
0 3 2 1 0 3 −4
0 0 3 2 1 −1 −1

y(n)={8, -2, -1, -4, -1}


Linear Filtering Using DFT

➢ Circular convolution cannot be used to determine the output of a linear filter.


➢ Hence we perform linear filtering using DFT (circular convolution).
➢ The length of y(n) after linear convolution is L+M-1.
➢ Hence, increasing the length of x(n) & h(n) by zero padding to L+M-1 and then
circularly convolving the sequences, gives the same result as that of linear
convolution.
Q. Find the output response of a filter using circular convolution if
impulse response h(n)= {1,1,1} and x(n)= {1,2,3,1}

Soln:
Length of h(n)=3, length of x(n)=4, length of linear convolution N= L+M-1=6
Hence zero pad such that x(n) and h(n) are of length 6
x(n) = {1,2,3,1,0,0} h(n) = {1,1,1,0,0,0}. Perform circular convolution.

1 0 0 0 1 1 1 1
1 1 0 0 0 1 2 3 𝑦(𝑛) = {1,3,6,6,4,1}
1 1 1 0 0 0 3 6
. =
0 1 1 1 0 0 1 6
0 0 1 1 1 0 0 4
0 0 0 1 1 1 0 1
Linear Filtering of Long Data Sequences

➢ Practical applications involve filtering of long data sequences.


➢ The block size of the data should be limited in size due to memory constraints of
digital processors.
➢ Hence, the input sequence is segmented to fixed size blocks prior processing.

➢ Successive blocks can be processed one at a time and the output blocks are
concatenated together to form the final response.
➢ There are 2 methods of filtering long data sequences:

1. Overlap Add Method


2. Overlap Save Method
Overlap Add Method

➢ The input data is divided into blocks of size L.


➢ Let M be the length of the impulse response of the filter.
➢ By appending L−1 zeros, the impulse response of FIR filter is increased in length to
N=L+M-1.
➢ M-1 zeros are padded to the L new data points to form a data sequence of length
N=L+M-1.
➢ Perform circular convolution of h(n) and 𝑥𝑘 (𝑛), where k denotes the number of
blocks.
➢ Form y(n) by overlapping the last M − 1 samples of 𝑦𝑘 𝑛 with the first M − 1
samples of 𝑦𝑘+1 (𝑛) and adding the result.
Q. Find the output y(n) of a filter whose impulse response is h(n)={1,1,1} and
input signal x(n)={3,-1,0,1,3,2,0,1,2,1} using overlap add method .

Soln:
Length of impulse response M=3. Let L=3. The data should be divided into blocks of 3.
N=L+M-1=5.
x(n)= { 3 , -1 , 0 , 1 , 3 , 2 , 0 ,1 , 2 , 1 }.
Each block should have M-1=2 zeros padded to the L=3 new data samples. Total length =N=5
𝑥1 𝑛 = { 3, −1, 0, 0, 0 }
𝑥2 (𝑛) = {1 , 3 , 2, 0, 0}
𝑥3 (𝑛) = {0 , 1 , 2, 0, 0}
𝑥4 (𝑛) = {1 , 0, 0 , 0 , 0}

ℎ(𝑛) = {1, 1, 1, 0, 0}. (L-1=2 zeros appended to make length equal to N=5)
➢ Now perform circular convolution of all data sequences with h[n]
𝑦1 (𝑛) = 𝑥1 (𝑛) ℎ(𝑛) = {3 , 2 , 2, −1, 0}
𝑦2 (𝑛) = 𝑥2 𝑛 ℎ(𝑛) = {1 , 4, 6, 5, 2}
𝑦 (𝑛) = 𝑥3 𝑛 ℎ 𝑛 = {0, 1, 3 , 3, 2}
3
𝑦4 (𝑛) = 𝑥4 𝑛 ℎ(𝑛) = {1, 1, 1, 0, 0}
3 2 2 −1 0
add
1 4 6 5 2
add
𝑦(𝑛) = {3, 2, 2, 0, 4, 6, 5, 3, 3, 4, 3, 1} 0 1 3 3 2
add
1 1 1 0 0
Overlap Save Method

➢ The input data is divided into blocks of size L.


➢ Let M be the length of the impulse response of the filter.
➢ By appending L−1 zeros, the impulse response of FIR filter is increased in length to
N=L+M-1.
➢ In order to avoid loss of data due to aliasing, the last M-1 points of each data block
are saved and these points become the first M-1 data points of the subsequent block
followed by L new data points to form a data sequence of length N=L+M-1.
➢ For the first block of data, M-1 zeros are appended at the beginning.
➢ Perform circular convolution of h(n) and each block 𝑥𝑘 (𝑛), k denotes the number of
blocks.
➢ Find y[n] by discarding the first M-1 samples of each output block 𝑦𝑘 (𝑛) and then
concatenating the rest samples.
Q. Find the output y(n) of a filter whose impulse response is h(n)={1,1,1} and
input signal x(n)={3,-1,0,1,3,2,0,1,2,1} using overlap save method .

Soln:
Length of impulse response M=3. Let L=3. The data should be divided into blocks of 3.
N=L+M-1=5.
x(n)= { 3 , -1 , 0 , 1 , 3 , 2 , 0 ,1 , 2 , 1 }.
Each block should have M-1=2 data sequences from the previous block followed by
L=3 new data samples. Total length =N=5
𝑥1 (𝑛) = { 0 , 0, 3, −1, 0 }
𝑥2 (𝑛) = {−1, 0 , 1 , 3 , 2}
𝑥3 (𝑛) = {3 , 2 , 0 , 1 , 2}
𝑥4 (𝑛) = {1 , 2 , 1 , 0 , 0}
ℎ(𝑛) = {1, 1, 1, 0, 0}. (L-1=2 zeros appended to make length equal to N=5)
➢ Now perform circular convolution of all data sequences with h(n)
𝑦1 𝑛 = 𝑥1 𝑛 ℎ(𝑛) = {−1, 0, 3 , 2 , 2}

𝑦2 𝑛 = 𝑥2 𝑛 ℎ(𝑛) = {4 , 1, 0 , 4, 6}

𝑦3 𝑛 = 𝑥3 𝑛 ℎ(𝑛) = {6 , 7, 5 , 3, 3}

𝑦4 𝑛 = 𝑥4 𝑛 ℎ(𝑛) = {1 , 3, 4 , 3, 1}

The first M-1=2 data points are discarded from each output.
𝑦(𝑛) = {3, 2, 2, 0, 4, 6, 5, 3, 3, 4, 3, 1}
HWQ. Find the output y(n) of a filter whose impulse response is h(n) ={1,2}
and input x(n) ={1, 2, -1, 2, 3, -2,-3,-1, 1, 1, 2,-1} using overlap save & overlap
add method .
Soln:
Length of impulse response M=2. Let L=3. The data should be divided into blocks of 3.
N=L+M-1=4.
x(n)= {1, 2, -1 , 2, 3, -2 , -3,-1, 1 , 1, 2,-1}.
Overlap save method
𝑥1 (𝑛) = { 0, 1, 2, −1}
𝑥2 (𝑛) = {−1 , 2 , 3, −2, }
𝑥3 (𝑛) = {−2 , −3 , −1, 1} ℎ(𝑛) = {1, 2, 0, 0}. (L-1=2 zeros appended to
𝑥4 (𝑛) = {1 , 1, 2 , −1} make length equal to N=4)
𝑥5 (𝑛) = −1 , 0, 0, 0
➢ Now perform circular convolution of all data sequences with h(n)
𝑦1 𝑛 = 𝑥1 𝑛 ℎ(𝑛) = {−2, 1 , 4 , 3}

𝑦2 𝑛 = 𝑥2 𝑛 ℎ(𝑛) = { −5, 0 , 7, 4}

𝑦3 𝑛 = 𝑥3 𝑛 ℎ(𝑛) = { 0 , − 7, −7 , −1}

𝑦4 𝑛 = 𝑥4 𝑛 ℎ(𝑛) = {−1 , 3, 4 , 3}

𝑦5 𝑛 = 𝑥5 𝑛 ℎ(𝑛) = {−1 , −2, 0 , 0}

The first M-1=1 data points are discarded from each output.
𝑦(𝑛) = {1, 4, 3, 0, 7, 4, −7, −7, −1,3, 4, 3, −2}
HWQ. Given two sequences x[n] and y[n] such that x[n]=[2 2 0 2] and
the 4 point circular convolution between x[n] and y[n] results in g[n]=[10
10 8 8] . Determine the sequence y[n].

Convolution in time domain property:

𝑦 𝑛 = 𝐼𝐷𝐹𝑇 𝑌 𝑘 = {2,2,1,1}
DFT: 𝑋 𝑘 . 𝑌 𝑘 = 𝐺(𝑘)

𝐺 𝑘
𝑌 𝑘 =
𝑋 𝑘
𝑦 𝑛 = 𝐼𝐷𝐹𝑇{𝑌 𝑘 }
𝑋 𝑘 = 6,2, −2,2
𝐺 𝑘 = 36, 2 − 2𝑗, 0, 2 + 2𝑗

𝐺 𝑘
𝑌 𝑘 = = {6,1 − 𝑗, 0,1 + 𝑗}
𝑋 𝑘
REFERENCES
23

1. Proakis J. G. and Manolakis D. G., Digital Signal Processing, 3/e,


Prentice –Hall India , 2005.
2. P. Ramesh Babu, Digital Signal Processing, Scitech Publications (India)
Pvt Ltd.
24 END of PART -III

THANK YOU!

You might also like