- 43
- 0
- 约 12页
- 2017-03-18 发布于湖北
- 举报
信号与系统
实验报告
实验三 周期信号的频谱分析
实验
其中,0? ?0.5π,要求将一个图形窗口分割成四个子图,分别绘制cos ?0t 、cos 3?0t 、cos 5?0t ?和x t ?的波形图,给图形加title,网格线和x坐标标签,并且程序能够接受从键盘输入的和式中的项数。
程序如下:
clear,%Clear all variables
close all,%Close all figure windows
dt 0.00001; %Specify the step of time variable
t -2:dt:4; %Specify the interval of time
w0 0.5*pi; x1 cos w0.*t ; x2 cos 3*w0.*t ; x3 cos 5*w0.*t ;
N input Type in the number of the harmonic components N ;
x 0;
for q 1:N;
x x+ sin q* pi/2 .*cos q*w0*t /q;
end
subplot 221
plot t,x1 %Plot x1
axis [-2 4 -2 2] ;
grid on,
title signal cos w0.*t
subplot 222
plot
原创力文档

文档评论(0)