Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Discrete Fourier Transform in MATLAB

For DFT
x_n=[1/3,1/3,1/3,zeros(1,13)];
N=16;
K=0:15;
X_K=fft(x_n,N);
subplot(2,1,1);
stem(K,abs(X_K));
ylabel('Magnitude part');
subplot(2,1,2);
stem(K,angle(X_K));
ylabel('Phase part');

Code for the second question:
x_n=[2,1,2,1,1,2,1,2];
N=8;
K=0:7;
X_K=fft(x_n,N);
subplot(2,1,1);
stem(K,abs(X_K));
ylabel('Magnitude part');
subplot(2,1,2);
stem(K,angle(X_K));
ylabel('Phase part');


No comments

Popular Posts

Followers