메뉴 건너뛰기

app

매트랩 소스(함수의 magnitude구하기)

박영식2003.12.19 10:14조회 수 5361댓글 0

    • 글자 크기
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%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
박영식 (비회원)
    • 글자 크기
매트랩2(wav의 sampling 및 fft 후, magnitude) (by 박영식) merge sort (by 박영식)

댓글 달기

이전 1 ... 6 7 8 9 10 11 12 13 14 15다음
첨부 (0)
위로