Professional Documents
Culture Documents
Exp No.3. To Study Properties of DFT: 1) Complex Conjugate Property
Exp No.3. To Study Properties of DFT: 1) Complex Conjugate Property
Command Window:
Enter the no of samples:4
Enter the original sequence:[1 2 3 4]
xk =
>>
Output:
2) Periodicity
MATLAB Code:
clc;
close all;
clear all;
%%DFT
N=input('Enter the no of samples:');
xn=input('Enter the original sequence:');
xn=[xn xn xn]
xk=fft(xn,N)
k=0:1:N-1;
subplot(2,1,1);
stem(k,abs(xk));
title('Magnitude Plot');
xlabel('k');
ylabel('|xk|');
subplot(2,1,2);
stem(k,angle(xk));
title('Phase Plot');
xlabel('k');
ylabel('Angle|xk|');
Command Window:
Enter the no of samples:4
Enter the original sequence:[1 2 3 4]
xk =
>>
Output:
3) Linearity:
MATLAB Code:
clc;
close all;
clear all;
%%DFT Linearty
N=input('Enter the no of samples');
xn1=input('Enter the 1st sequence');
xn2=input('Enter the 2nd sequence');
a1=input('Enter the value of constant a1:');
a2=input('Enter the value of constant a2:');
y=(a1*xn1)+(a2*xn2);
z=fft(y,N)
xk1=fft(xn1,N)
xk2=fft(xn2,N)
z1=a1*xk1+a2*xk2
--------------------------------------------------------------------------
Command Window:
Enter the no of samples4
Enter the 1st sequence[1 0 1 1]
Enter the 2nd sequence[1 1 1 1]
Enter the value of constant a1:2
Enter the value of constant a2:3
z=
xk1 =
xk2 =
4 0 0 0
z1 =
>>