2.DFT PROPERTIES

//PRATEEK KUMAR SINGH

CODE

// symmetry property
clc;
clear;
x=[1 2 3 4 5 3 2 1]
xp=fft(x);
disp("property 1-SYMMETRY PROPERTY");
disp(x,"Origiaal Sequence");
disp(xp', "DFT of Orginal SEquence");
disp("Symmetry Property ie X(N/2-k)=X*((N/2)+k)or X*(k)=X(N-k) is verified as the resulting dft is symmetric about N/2=4");

// Time Reversal Property
clc;
x=[1 2 3 4 5 4 3 2 1]
//l=2
xs=[2 1 1 2 3 4 5 4 3]
x1=fft(x);
xs1=fft(xs);
disp(x,"orignal signal");
disp(x1,"DFT of original signal");
disp(xs,"time shifted signal");
disp(xs1,"DFT of time shifted signakl");

x1_mag=20*log10(abs(x1));
x1_phase=atan(imag(x1),real(x1));
xs1_mag=20*log10(abs(xs1));
xs1_phase=atan(imag(xs1),real(xs1));
title("magnitude plot of original");
subplot(2,1,1);
plot(x1_mag);
xlabel("k");
ylabel("abs k");
title("magnitude plot of time shifted");
subplot(2,1,2);
plot(xs1_mag);
xlabel("k");

//Circular time shifting property
clc;
clear;
x=[1 2 3 4 5 4 3 2 1]
//l=2
xs=[2 1 1 2 3 4 5 4 3]
x1=fft(x);
xs1=fft(xs);
disp(x,"orignal signal");
disp(x1',"DFT of original signal");
disp(xs,"time shifted signal");
disp(xs1',"DFT of time shifted signal");

x1_mag=20*log10(abs(x1));
x1_phase=atan(imag(x1),real(x1));
xs1_mag=20*log10(abs(xs1));
xs1_phase=atan(imag(xs1),real(xs1));
title("magnitude plot of original");
subplot(2,1,1);
plot(x1_mag);
xlabel("k");
ylabel("abs k");
title("magnitude plot of time shifted");
subplot(2,1,2);
plot(xs1_mag);
xlabel("k");
ylabel("abs k")
figure
title("phae plot of original");
subplot(2,1,1);
plot(x1_phase);
xlabel("k");
ylabel("angle");
subplot(2,1,2);
title("phase plot of time shifted");
plot(xs1_phase);
xlabel("k");
ylabel("angle")

//Circular Convolution
clc;
clear;
x1=[1 2 3 4 5]
x2=[5 6 7 8 9]
disp("1st sequence")
disp(x1);
disp("2nd sequence")
disp(x2);
disp("DFT of 1st sequence");
y1=fft(x1);
disp(y1');
disp("DFT of 2st sequence");
y2=fft(x2);
disp(y2');
disp("multiplication result");
mul=y1.*y2
disp(mul');
disp("DFT of multiplication");
z=ifft(mul');
disp(z');

0 Comments