%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%20022191 박영식 project #1%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
n=[0:31];
x=cos(3*pi*n/4)-cos(2*pi*n/4)+cos(pi*n/4)-1;
figure(1), plot(x); grid
set(gca,'color','n');
axis([-0,32,-1,1]);
xlabel('n'); ylabel('x[n]');
title('20022191_1 [x=cos(3*pi*n/4)-cos(2*pi*n/4)+cos(pi*n/4)-1]의 그래프');
X21=abs(fftshift(fft(x,21)));
%21point DTFS
X128=abs(fftshift(fft(x,128)));
%60point DTFS
X256=abs(fftshift(fft(x,256)));
%256point DTFS
x_fft=zeros(256); x_fft=x;
X256=abs(fftshift(fft(x_fft,256)));
W21=[-10:10]*2*pi/21;
W128=[-64:63]*2*pi/128;
W256=[-128:127]*2*pi/256;
figure(2),
SUBPLOT(3,1,1); hold on;
title('20022191_1 1)주기 21 magnitude');
ylabel('N|X[k]|');
stem(W21,X21,'p'); plot(W256,X256, 'c'); grid
set(gca,'color','n');
hold off;
SUBPLOT(3,1,2); hold on;
title('20022191_1 2)주기 128 magnitude');
ylabel('N|X[k]|');
stem(W128,X128,'p'); plot(W256,X256, 'c'); grid
set(gca,'color','n');
hold off;
SUBPLOT(3,1,3); hold on;
title('20022191_1 3)주기 256 magnitude');
ylabel('N|X[k]|');
set(gca,'color','n');
stem(W256,X256,'p');
plot(W256,X256,'c'); grid
%%%%%20022191 박영식 project #1%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
n=[0:31];
x=cos(3*pi*n/4)-cos(2*pi*n/4)+cos(pi*n/4)-1;
figure(1), plot(x); grid
set(gca,'color','n');
axis([-0,32,-1,1]);
xlabel('n'); ylabel('x[n]');
title('20022191_1 [x=cos(3*pi*n/4)-cos(2*pi*n/4)+cos(pi*n/4)-1]의 그래프');
X21=abs(fftshift(fft(x,21)));
%21point DTFS
X128=abs(fftshift(fft(x,128)));
%60point DTFS
X256=abs(fftshift(fft(x,256)));
%256point DTFS
x_fft=zeros(256); x_fft=x;
X256=abs(fftshift(fft(x_fft,256)));
W21=[-10:10]*2*pi/21;
W128=[-64:63]*2*pi/128;
W256=[-128:127]*2*pi/256;
figure(2),
SUBPLOT(3,1,1); hold on;
title('20022191_1 1)주기 21 magnitude');
ylabel('N|X[k]|');
stem(W21,X21,'p'); plot(W256,X256, 'c'); grid
set(gca,'color','n');
hold off;
SUBPLOT(3,1,2); hold on;
title('20022191_1 2)주기 128 magnitude');
ylabel('N|X[k]|');
stem(W128,X128,'p'); plot(W256,X256, 'c'); grid
set(gca,'color','n');
hold off;
SUBPLOT(3,1,3); hold on;
title('20022191_1 3)주기 256 magnitude');
ylabel('N|X[k]|');
set(gca,'color','n');
stem(W256,X256,'p');
plot(W256,X256,'c'); grid
댓글 달기