MATLAB周期信号的频谱分析
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
x=x+sin(k*t)/k; y((k+1)/2,:)=x; end MATLAB在信号与y系=统y课*4程/中p的i;应用
11
EE of BUPT
12
figure(1); plot(t,y); grid; line([0,pi+0.5],[1,1]); text(pi+0.5,1,'1'); figure(2); halft=ceil(length(t)/2); mesh(t(1:halft),[1:(K+1)/2],y(:,1:halft)); max_y=max(y((K+1)/2,:)); gibbs=(max_y-1)/2
直流分量 余弦分量的幅度 正弦分量的幅度
a0
1 T1
t0 T1 f (t ) d t
t0
2
an T1
t0 T1 t0
f (t)cos
n1t
dt
2
bn T1
t0 T1 tTLAB在信号与系统课程中的应用
EE of BUPT
余弦形式
5
f (t ) a0 an cos n1t bn sin n1t 1 n1
f (t ) c0 cn cos n1t n
2
n1
c0 cn cosn1t cos n sinn1t sin n
n1
a0 : 直流,平均值
n 1 基波 (fundament al signal)
有的文献上也称为1 次谐波
n
n次谐波 (harmonic signal)
MATLAB在信号与系统课程中的应用
MATLAB在信号与系统课程中的应用
EE of BUPT
8
help pause
PAUSE Wait for user response. PAUSE(n) pauses for n seconds before continuing, where n can also be a fraction. The resolution of the clock is platform specific. Fractional pauses of 0.01 seconds should be supported on most platforms.
EE of BUPT
6
例7-1 周期矩形脉冲信号的频谱
直流为0 奇函数 余弦项的系数为0,
xt
1
1
2
T
an 1
0
0 2 3 4
t
1
4
bn T
0 1 sin n1tdt
0
2
n
1
cos n1
4
n
n 2,4,6 n 1,3,5
奇谐函数
x
t
4
sin
t
1 3
sin
3t
1 sin2k 1 t
MESH(X,Y,Z) uses C = Z, so color is proportional to mesh height.
MATLAB在信号与系统课程中的应用
EE of BUPT
MATLAB实现
% fourier analysis % square_wave2.m t=0:0.01:2*pi; K=99; % maximum harmonic y=zeros((K+1)/2,length(t)); x=zeros(size(t)); for k=1:2:K
第七章 周期信号的频谱分析
尹霄丽
Electronic Engineer School of BUPT
1
2
7.1 引言
成谐波关系的信号就是它们的频率互成整数倍的信号, 连续时间傅里叶级数将周期信号表示成成谐波关系的信号 的加权和。
本章主要内容:
•周期信号的傅里叶级数的系数:三角函数形式; 指数函数形式; •用数值计算的方式来综合信号; •用符号函数表示傅里叶级数。
PAUSE causes a procedure to stop and wait for the user to strike any key before continuing.
MATLAB在信号与系统课程中的应用
EE of BUPT
9
结果显示
1.5
1
0.5
0
-0.5
-1
-1.5
0
1
2
3
4
5
6
MATLAB在信号与系统课程中的应用
EE of BUPT
3
7.2 三角函数形式的傅里叶级数
1.三角函数集
cosn1t ,sinn1t 是一个完备的正交函数集
由积分可知
t在一个周期内,n=0,1,...
T
2 T
cos
n1t
sin
m1
dt
0
T 2 T 2
2
cos
n1t
cos
m1t
dt
T
,
2
0,
mn mn
7
MATLAB在信号与系统课程中的应用
EE of BUPT
10
绘制三维曲线图
MESH 3-D mesh surface.
MESH(X,Y,Z,C) plots the colored parametric mesh defined by four matrix arguments. The view point is specified by VIEW.
T 2 T 2
sin
n1t
sin
m1t
dt
T
,
2
0,
mn mn
MATLAB在信号与系统课程中的应用
EE of BUPT
级数形式
4
周期信号 f t , 周期为T1 , 基波角频率为 1
在满足狄氏条件时,可展成
2
T1
f (t ) a0 an cosn1t bn sinn1t
1
n1
称为三角形式的傅里叶级数,其系数
The axis labels are determined by the range of X, Y and Z,
or by the current setting of AXIS. The color scaling is determined by the range of C, or by the current setting of CAXIS. The scaled color values are used as indices into the current COLORMAP.
2k 1
,k
1,
2
MATLAB在信号与系统课程中的应用
EE of BUPT
7
MATLAB实现
% Fourier analysis % square_wave1.m t=0:0.01:2*pi; y=sin(t);y=y*4/pi;plot(t,y);pause y=sin(t)+sin(3*t)/3;y=y*4/pi;plot(t,y);pause y=sin(t)+sin(3*t)/3+sin(5*t)/5+sin(7*t)/7+sin(9*t)/9; y=y*4/pi; plot(t,y);pause
11
EE of BUPT
12
figure(1); plot(t,y); grid; line([0,pi+0.5],[1,1]); text(pi+0.5,1,'1'); figure(2); halft=ceil(length(t)/2); mesh(t(1:halft),[1:(K+1)/2],y(:,1:halft)); max_y=max(y((K+1)/2,:)); gibbs=(max_y-1)/2
直流分量 余弦分量的幅度 正弦分量的幅度
a0
1 T1
t0 T1 f (t ) d t
t0
2
an T1
t0 T1 t0
f (t)cos
n1t
dt
2
bn T1
t0 T1 tTLAB在信号与系统课程中的应用
EE of BUPT
余弦形式
5
f (t ) a0 an cos n1t bn sin n1t 1 n1
f (t ) c0 cn cos n1t n
2
n1
c0 cn cosn1t cos n sinn1t sin n
n1
a0 : 直流,平均值
n 1 基波 (fundament al signal)
有的文献上也称为1 次谐波
n
n次谐波 (harmonic signal)
MATLAB在信号与系统课程中的应用
MATLAB在信号与系统课程中的应用
EE of BUPT
8
help pause
PAUSE Wait for user response. PAUSE(n) pauses for n seconds before continuing, where n can also be a fraction. The resolution of the clock is platform specific. Fractional pauses of 0.01 seconds should be supported on most platforms.
EE of BUPT
6
例7-1 周期矩形脉冲信号的频谱
直流为0 奇函数 余弦项的系数为0,
xt
1
1
2
T
an 1
0
0 2 3 4
t
1
4
bn T
0 1 sin n1tdt
0
2
n
1
cos n1
4
n
n 2,4,6 n 1,3,5
奇谐函数
x
t
4
sin
t
1 3
sin
3t
1 sin2k 1 t
MESH(X,Y,Z) uses C = Z, so color is proportional to mesh height.
MATLAB在信号与系统课程中的应用
EE of BUPT
MATLAB实现
% fourier analysis % square_wave2.m t=0:0.01:2*pi; K=99; % maximum harmonic y=zeros((K+1)/2,length(t)); x=zeros(size(t)); for k=1:2:K
第七章 周期信号的频谱分析
尹霄丽
Electronic Engineer School of BUPT
1
2
7.1 引言
成谐波关系的信号就是它们的频率互成整数倍的信号, 连续时间傅里叶级数将周期信号表示成成谐波关系的信号 的加权和。
本章主要内容:
•周期信号的傅里叶级数的系数:三角函数形式; 指数函数形式; •用数值计算的方式来综合信号; •用符号函数表示傅里叶级数。
PAUSE causes a procedure to stop and wait for the user to strike any key before continuing.
MATLAB在信号与系统课程中的应用
EE of BUPT
9
结果显示
1.5
1
0.5
0
-0.5
-1
-1.5
0
1
2
3
4
5
6
MATLAB在信号与系统课程中的应用
EE of BUPT
3
7.2 三角函数形式的傅里叶级数
1.三角函数集
cosn1t ,sinn1t 是一个完备的正交函数集
由积分可知
t在一个周期内,n=0,1,...
T
2 T
cos
n1t
sin
m1
dt
0
T 2 T 2
2
cos
n1t
cos
m1t
dt
T
,
2
0,
mn mn
7
MATLAB在信号与系统课程中的应用
EE of BUPT
10
绘制三维曲线图
MESH 3-D mesh surface.
MESH(X,Y,Z,C) plots the colored parametric mesh defined by four matrix arguments. The view point is specified by VIEW.
T 2 T 2
sin
n1t
sin
m1t
dt
T
,
2
0,
mn mn
MATLAB在信号与系统课程中的应用
EE of BUPT
级数形式
4
周期信号 f t , 周期为T1 , 基波角频率为 1
在满足狄氏条件时,可展成
2
T1
f (t ) a0 an cosn1t bn sinn1t
1
n1
称为三角形式的傅里叶级数,其系数
The axis labels are determined by the range of X, Y and Z,
or by the current setting of AXIS. The color scaling is determined by the range of C, or by the current setting of CAXIS. The scaled color values are used as indices into the current COLORMAP.
2k 1
,k
1,
2
MATLAB在信号与系统课程中的应用
EE of BUPT
7
MATLAB实现
% Fourier analysis % square_wave1.m t=0:0.01:2*pi; y=sin(t);y=y*4/pi;plot(t,y);pause y=sin(t)+sin(3*t)/3;y=y*4/pi;plot(t,y);pause y=sin(t)+sin(3*t)/3+sin(5*t)/5+sin(7*t)/7+sin(9*t)/9; y=y*4/pi; plot(t,y);pause