Matlab Program to Perform Time Shifting:
clc
clear all
disp('x(n) Sequence');
x=[1 2 1 2];
disp(x);
y=circshift(x,[0 1]);
disp('Time shifted x(n) seq');
disp(y);
z=fft(y);
disp('FFT of Time shifted x(n) seq');
disp(z);
s=fft(x);
disp('FFT of x(n)');
disp(s);
N=4;
k=0:1:N-1;
p=exp(-j*2*pi*1*k/N);
x2(k+1)=p;
t=s.*x2;
disp('x(n).x2=');
disp(t);
Output:
clc
clear all
disp('x(n) Sequence');
x=[1 2 1 2];
disp(x);
y=circshift(x,[0 1]);
disp('Time shifted x(n) seq');
disp(y);
z=fft(y);
disp('FFT of Time shifted x(n) seq');
disp(z);
s=fft(x);
disp('FFT of x(n)');
disp(s);
N=4;
k=0:1:N-1;
p=exp(-j*2*pi*1*k/N);
x2(k+1)=p;
t=s.*x2;
disp('x(n).x2=');
disp(t);
Output:
0 comments:
Post a Comment