Assignment 3
Assignment 3
(PCCEC592)
ASSIGNMENT: 3
NAME:..................................................................................................................
YEAR : ........................ SEC : ............. ROLL NO.: ......................................
DATE of EXPERIMENT: ………………………….........................................
INSTITUTE OF ENGINEERING & MANAGEMENT
Dept. of Electronics and Comm. Engg, Salt lake, Kolkata
ASSIGNMENT: 3
[1] Find linear convolution between 𝒙(𝒏) and 𝒉(𝒏) using ‘conv’ inbuilt function where
a) 𝒙[𝒏] = [ 𝟏 𝟐 𝟑 𝟒 ] and 𝒉[𝒏] = [ 𝟏 𝟏 𝟏 𝟏 ]
THEORY:
Linear convolution is the basic operation to calculate the output for any linear time invariant system given
its input sequence 𝑥(𝑛) and its impulse response ℎ(𝑛). One dimensional linear discrete convolution is defined
as:
∞
Notice that when ℎ(𝑛) is of length N, and 𝑥(𝑛) is of length L, the linear convolution is of length (N + L – 1).
-: SOURCE CODE:-
[2] Using GRAPHICAL Method, find the linear convolution between 𝒙(𝒏) and 𝒉(𝒏) (use ‘For
Loop’) where
i) 𝒙[𝒏] = [ 𝟏 𝟐 𝟑 𝟒 ] and 𝒉[𝒏] = [ 𝟏 𝟏 𝟏 𝟏 ]
THEORY:
Linear convolution is the basic operation to calculate the output for any linear time invariant system given
its input sequence 𝑥(𝑛) and its impulse response ℎ(𝑛). One dimensional linear discrete convolution is
defined as:
∞
Notice that when 𝑥(𝑛) is of length N, and ℎ(𝑛) is of length L, the linear convolution is of length (N + L –
1).
Steps to follow:
1. List the index ‘k’ covering a sufficient range
2. List the input 𝑥[𝑘]
3. Obtain the reversed sequence ℎ[−𝑘], and align the rightmost element of ℎ[𝑛 − 𝑘] to the leftmost
element of 𝑥[𝑘]
4. Multiply the two sequences 𝑥[𝑘] and ℎ[−𝑘], element by element and sum the products to produce
y[n].
5. Slide h[n-k] to the right by one position
6. Repeat step 4;
7. stop if all the output values are zero or if required.
8. For example if 𝑥(n) ={1, 2,1, 3}, h(n)={1, 2,1,2 }
↑
The sequence 𝑥(𝑛) starts at 𝑛1 =0 and ℎ(𝑛) starts at 𝑛2 =-1. Then the starting time for evaluation
the o/p sequence 𝑦(𝑛) is (𝑛1 + 𝑛2 ) = 0 + (−1) = −1
-: SOURCE CODE:-
[3] Using MATRIX Method, find the linear convolution between 𝒙(𝒏) and 𝒉(𝒏) (use ‘For Loop’)
where 𝒙[𝒏] = [𝟑 𝟐 𝟏 𝟏 ] and 𝒉[𝒏] = [ 𝟏 𝟏 𝟏 ]
THEORY:
y(-1) = h1 x1
y(0) = h2 x1 + h1 x2
-: SOURCE CODE:-
[4] If the Discrete Time Fourier Transform (DTFT) of 𝒙[𝒏] is 𝑿(𝒆𝒋𝝎𝒏) such that:
𝟏, 𝟎≤𝒏≤𝟑 𝒋𝝎𝒏
𝟏 − 𝒆−𝟒𝒋𝝎
𝒙[𝒏] = { 𝐚𝐧𝐝 𝑿(𝒆 )=
𝟎, 𝐨𝐭𝐡𝐞𝐫𝐰𝐢𝐬𝐞 𝟏 − 𝒆−𝒋𝝎
THEORY:
-: SOURCE CODE:-
[5] If the Discrete Time Fourier Transform (DTFT) of 𝒙[𝒏] is 𝑿(𝒆𝒋𝛚 ) such that:
𝟏
𝒙[𝒏] = 𝒂𝒏 𝒖[𝒏] 𝐰𝐡𝐞𝐫𝐞 |𝒂| < 1 𝐚𝐧𝐝 𝑿(𝒆𝒋𝜴 ) =
𝟏 − 𝒂𝒆−𝒋𝝎
Plot the magnitude and phase response of 𝑿(𝒆𝒋𝝎 ). Compare the results.
THEORY:
The Discrete-Time Fourier Transform (DTFT) is a form of Fourier analysis that is applicable to
the uniformly-spaced samples of a continuous function. The term discrete-time refers to the fact
that the transform operates on discrete data (samples) whose interval often has units of time. The
Discrete-Time Fourier transform (DTFT) of 𝑥[𝑛] can be expressed as
where we have used the uppercase omega (𝜔) as the frequency variable to distinguish the
continuous-time and discrete-time cases. 𝑋(𝜔) is referred as the Fourier spectrum of 𝑥[𝑛]
-: SOURCE CODE:-
[6] Find the FOUR point DFT coefficient of 𝒙[𝒏] = [𝟎, 𝟏, 𝟐, 𝟑].
THEORY:
Discrete Fourier Transform (DFT) can be used to represent a discrete sequence into its equivalent
frequency domain representation. The Discrete Fourier Transform is a numerical variant of the Fourier
Transform. It is used to convert a finite discrete-time sequence x(n) to an N –point frequency domain
sequence 𝑋(𝑘), The DFT is defined as such:
𝑁−1
here, 𝑘 is used to denote the frequency domain ordinal, and n is used to represent the time-domain
ordinal. The big "𝑁" is the length of the sequence to be transformed.
-: SOURCE CODE:-
[7] Plot 𝑲-point DFT of question for question no [3] for 𝑲 = 𝟒, 𝟖, 𝟏𝟔 and 𝟑𝟐. Compare the results.
THEORY:
-: SOURCE CODE:-
[8] Find the IDFT of following sequences using inbuilt command and ‘for loop’.
a) 𝑿[𝒌] = [𝟏, 𝟏 − 𝟐𝒋, −𝟏, 𝟏 + 𝟐𝒋]
b) 𝑿[𝒌] = [𝟏, 𝟎, 𝟏, 𝟎]
THEORY:
Discrete Fourier transform (DFT) of x[n] can be expressed as
𝑁−1
An operation that recovers the discrete data sequence from the DFT function is called an inverse
DFT. Inverse DFT is defined by:
𝑁−1
,
𝑥(𝑛) = 1/𝑁 ∑ 𝑋(𝑘) 𝑒 −𝑗2𝜋𝑛𝑘/𝑁, where 0 ≤ 𝑛 ≤ 𝑁 − 1
𝑘=0
-: SOURCE CODE:-
[9] Write a program to find the circular convolution between two sequences 𝒙(𝒏) and 𝒉(𝒏) using
MATLAB in build command.
(a) 𝒙(𝒏) = {𝟏, −𝟏, −𝟐, 𝟑, −𝟏} and 𝒉(𝒏) = {𝟏, 𝟐, 𝟑}
(b) 𝒙(𝒏) = {𝟏, −𝟐, 𝟐, 𝟏} and 𝒉(𝒏) = {𝟏, 𝟐, 𝟑}
THEORY: The circular convolution is very similar to normal convolution apart from that the
signal is shifted using circular shift. If 𝑥1 (𝑛) and 𝑥2 (𝑛) are finite discrete time sequence with
length N then the result of the circular convolution 𝑦(𝑛) can be realized by
𝑁−1
This operation to obtain 𝑦[𝑛] is known as the resultant of circular convolution. This is also termed
as cyclic convolution. The circular convolution is represented by, 𝑦(𝑛) = 𝑥1 (𝑛) 𝑥2 (𝑛)
The shifting in this operation is a circular shifting. Generally, there are two methods, which are
adopted to perform the circular convolution. These are,
(a) Concentric circular convolution method and
(b) Matrix circular convolution method.
-: SOURCE CODE:-
[10] Find the circular convolution using DFT, IDFT methods (using fft, ifft command) between
𝒙(𝒏) = {𝟑, 𝟒, −𝟐, 𝟎, 𝟏, 𝟒} and 𝒉(𝒏) = {𝟏, −𝟑, 𝟎, 𝟒}.
THEORY:
Let us take two finite duration sequences 𝑥1(𝑛) and 𝑥2(𝑛), having integer length as N. Their DFTs are
𝑋1(𝑘) and 𝑋2(𝑘) respectively, which is shown below −
𝑁−1
𝑗2𝜋𝑘𝑛
𝑋1(𝑘) = ∑ 𝑥1(𝑛)𝑒 𝑁 𝑘 = 0,1,2. . . 𝑁 − 1
𝑛=0
𝑁−1
𝑗2𝜋𝑘𝑛
𝑋(𝑘) = ∑ 𝑥2(𝑛)𝑒 𝑁 𝑘 = 0,1,2. . . 𝑁 − 1
𝑛=0
Now, we will try to find the DFT of another sequence 𝑥3(𝑛), which is given as 𝑋3(𝑘)
Where 𝑋3(𝑘) = 𝑋1(𝑘) × 𝑋2(𝑘)
By taking the IDFT of the above we get,
𝑁−1
𝑗2𝜋𝑘𝑛
𝑥3(𝑛) = 1/𝑁 ∑ 𝑋3(𝑘)𝑒 𝑁
𝑛=0
We know, 𝑥3(𝑛) = 𝐼𝐷𝐹𝑇[𝑋3(𝑘)]
𝑥3(𝑛) = IDFT [𝑋1(𝑘) 𝑋2(𝑘)]
= 𝑥1(𝑛) 𝑥2(𝑛)
-: SOURCE CODE:-
[11] Make a comparison between circular and linear convolution for two sequences: 𝒙(𝒏) =
{𝟑, 𝟒, −𝟐, 𝟎, 𝟏, 𝟒} and 𝒉(𝒏) = {𝟏, −𝟑, 𝟎, 𝟒}
THEORY:
3.Finding response
Possible Cannot possible without zero
of a filter
padding
-: SOURCE CODE:-
…….….................................................... …………………………………………………..
(SIGNATURE OF THE
TEACHER-IN-CHARGE) (SIGNATURE OF THE LAB-IN-CHARGE)
WITH DATE)
STUDENT'S NAME:..................................................................................................................