6. Perform the following properties of DFT- a) Circular shift of a sequence. b) Circular fold of a sequence.

 Code:

//Circular Shift of a sequence

clc;

clear all;

close;

//Circular time shifting property

x=input('Enter the input signal');

l=input('Enter the units of shift');

nx=length(x);

n1=[0:1:nx-1];

n2=pmodulo(n1-l,nx);

y=x(n2+1);

disp('Circularly time shifted signal==>');

disp(y);

Yk=zeros(1,nx);

Xk=fft(x);

for j=0:nx-1

Yk(j+1)=Xk(j+1)*exp((-1*%i*2*%pi*j*l)/nx)

End

disp('DFT of Circularly time shifted signal using the

property==>');

disp(round(Yk));

Yk1=fft(y);

disp('DFT of Circularly time shifted signal is ==>');

disp((Yk1));







Code:

clc;

clear all;

close;

//Circular time reversal property

x=[1 2 3 4 6 8];

disp('Input signal x(n)==>');

disp(x);

Xk=fft(x);

disp('DFT of x(n)==>');

disp(Xk);

nx=length(x);

n1=[0:1:nx-1];

n2=pmodulo(-n1,nx);

y=x(n2+1);

disp('Circularly time reversed signal x(-n)==>');

disp(y);

//DFT of x(-n) is X(-k)

N=length(x);

k=n1;

k1=pmodulo(-k,N);

Yk=Xk(k1+1);

disp('DFT of Circularly time reversed signal using

property is Yk==>');

disp(Yk);

Yk1=fft(y);

disp('DFT of Circularly time reversed signal is ==>');

disp(Yk1);

Comments