Find the discrete-time Fourier transform of the signal given below mathematically
using formula.
CODE:
x = [0 1 1 1 1 0];
k = -300:300;
w = (pi/200)*k;
n= 0:5;
X = x*(exp(-1i*pi/100)).^(n'*k);
magX = abs(X);
angX = angle(X);
realX = real(X);
imagX = imag(X);
subplot(2,2,1);
plot(w/pi,magX, 'r');
grid on;
xlabel('Time');
ylabel('Amplitude');
title('Task1');
legend('Magnitude')
subplot(2,2,3);
plot(w/pi,angX, 'b');
grid on;
xlabel('Time');
ylabel('Amplitude');
title('Task1');
legend('Angle ')
subplot(2,2,2);
plot(w/pi,realX, 'k');
grid on;
xlabel('Time');
ylabel('Amplitude');
title('Task1');
legend(' Real parts')
subplot(2,2,4);
plot(w/pi,imagX, 'g');
grid on;
xlabel('Time');
ylabel('Amplitude');
title('Task1');
legend('Imaginary parts')
Result:
0 Comments