Experiment - 4: Aim: To Compute DFT of The Signal Given Below Using Matrix Method in MATLAB: X (N) (1 2 3 4)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Saloni Varshney

189202011
ECE-C
Due: 22 Apr. 21
EXPERIMENT – 4

Aim: To compute DFT of the signal given below using matrix method in MATLAB:
x(n) = [1 2 3 4]
Display the DFT result in common window as a matrix

Software Used: MATLAB (R2021_a) by MathWorks

Theory: To compute DFT of given signal, we must first define length


of given discrete time signal as N (in this case, N=4). After this, we
have to define twiddle factor for DFT which is WN=exp(-j*2*pi/N);
To obtain correct output, we must first raise the twiddle factor to exponent
power of “n’*k” as: WN_n=WN.^(n'*k); After these steps, simply input
discrete time signal and multiply with above Twiddle Factor to obtain DFT.

Code:
Saloni Varshney
189202011
ECE-C
Due: 22 Apr. 21

Result/Output:

Conclusion: In this experiment, we successfully computed DFT of


x(n)=[1 2 3 4] in MATLAB. To compute DFT we first had to define the
length of our DFT as ‘N’ and ‘n’ and ‘k’ which are the values of Input
Signal matrix and DFT signal matrix, after that we initialised our
twiddle factor matrix. To make matrix multiplication possible we had
to multiply our twiddle factor matrix and raise it to the power of
(n'*k) where n’ is the transpose of n. We finally computed DFT of
given signal by multiplying x(n) by twiddle factor matrix and plotted
using ‘stem’ command.
Saloni Varshney
189202011
ECE-C
Due: 22 Apr. 21
EXPERIMENT – 5

Aim: To compute IDFT of the signal given below using matrix method in MATLAB:
X(K) = [6, -2+j2, -2, -2-j2]
Display the IDFT result in common window as a matrix

Software Used: MATLAB (R2021_a) by MathWorks

Theory: To compute IDFT of given signal, we must first define


length of given discrete time signal as N (in this case, N=4). After this,
we have to define twiddle factor for IDFT which is
WN=exp(j*2*pi/N); (Complex conjugate of Twiddle
factor of DFT). To obtain correct output, we must first raise the twiddle
factor to exponent power of “-n’*k” as: WN_n=WN. ^(-n'*k); After these
steps, simply input discrete time signal and multiply with above Twiddle Factor
to obtain DFT.

Code:
Saloni Varshney
189202011
ECE-C
Due: 22 Apr. 21
Result/Output:

Conclusion: In this experiment, we successfully computed IDFT of


X(K)=[6,-2+j2,-2,-2-j2] in MATLAB. To compute IDFT we first had to
define the length of our DFT as ‘N’ and ‘n’ and ‘k’ which are the
values of Input Signal matrix and DFT signal matrix , after that we
initialised our twiddle factor matrix. (This matrix is complex
conjugate of twiddle factor matrix of DFT.) To make matrix
multiplication possible we had to multiply our twiddle factor matrix
and raise it to the power of (-n'*k) where n’ is the transpose of n. We
finally computed IDFT of given signal by multiplying X(K) by twiddle
factor matrix and dividing by ‘N’ and plotted using ‘stem’ command

You might also like