?? experiment_3_ctft.m
字號:
%==================================================================
% Name:experiment3_1_ctft
%==================================================================
clear,close all,
p=0.01; % p為時間間隔
t0=5;
t=[-t0:p:t0]; %給t賦值
x=input('Type in the signal x(t)=:');%輸入信號
W1=input('Type in the frequency range(-W1~W1),W1=:');
N=512; %頻率抽樣點數為2N+1=1025點
w1=W1/N;
W=-W1:w1:W1; %給頻率變量W賦值
X=x*exp(-j*t'*W)*p; %進行傅里葉變換
X1=abs(X);
phai=57.3*angle(X);
subplot(211)
plot(t,x),title('The time signal x(t)')
subplot(223)
plot(W/pi,X1),axis([-W1/pi,W1/pi,0,max(X1)])
title('The magnitude spectrum of x(t)')
xlabel('Frequency in pi radians/s')
subplot(224)
plot(W/pi,phai),axis([-W1/pi,W1/pi,-180,180])
title('The phase spectrum of x(t)')
xlabel('Frequency in pi radians/s')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -