?? example4_5.m
字號:
%==========================================================================
% 程序名:example4_5
%
%==========================================================================
% 下段程序?yàn)槌跏蓟?%==========================================================================
clear;close all
p=0.01;
w=-5:p:5;
X=input('Input the expression of X(jw):');
t1=4*pi; %確定信號的頻率范圍
N=512;
k=-N:N; %對信號的角頻率進(jìn)行采樣的點(diǎn)數(shù)為2N+1點(diǎn)
t=k*t1/N; %計算頻率的采樣間隔
%==========================================================================
% 下段程序計算信號的傅里葉變換,包括幅度譜和相位譜計算
%==========================================================================
x=X*exp(j*w'*t)*p/(2*pi);
%==========================================================================
% 下段程序繪制圖形
%==========================================================================
subplot(2,2,1);plot(w,X);grid on;
xlabel('w');
title('The spectrum of x(t)');
subplot(2,2,2);plot(t,x);grid on;axis([-4*pi,4*pi,-0.4*max(x),1.2*max(x)])
xlabel('t');
title('The inverse transform of X(jw) ');
%ylabel('幅度譜——F(w)');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -