MATLAB周期信号的频谱分析.pptVIP

  • 90
  • 0
  • 约8.88千字
  • 约 69页
  • 2021-11-04 发布于广东
  • 举报
目的 用符号运算的方法生成傅里叶级数的系数(一个积分); 用有限项综合原信号: * (a) 解: * int 函数 INT Integrate. INT(S) is the indefinite integral (不定积分)of S with respect to its symbolic variable as defined by FINDSYM. S is a SYM (matrix or scalar). If S is a constant, the integral is with respect to x. INT(S,v) is the indefinite integral of S with respect to v (对v积分). v is a scalar SYM. INT(S,a,b) is the definite integral (定积分)of S with respect to its symbolic variable from a (下限)to b(上限). a and b are each double or symbolic scalars. INT(S,v,a,b) is the definite integral of S with respect to v from a to b. * 编程实现 % exe3_12_a.m clear all; syms t x T n; x=1; integrand=x*exp(-i*n*2*pi/T*t)/T; Xn=int(integrand,t,-T/4,T/4); T=2; n=-10:10; Xn_N=subs(Xn); Xn_N((length(n)+1)/2)=0.5; h=stem(n,Xn_N); set(h,linewidth,2); 被积函数 * * (b) 分析: ·上例已得到Xn语句,利用subs给出各系数: * 产生并画出合成后的信号波形 xN=0; for n=-10:10 xN=xN+Xn_N(n+11)*exp(i*n*2*pi/T*t); end T=2; subs(xN); ezplot(xN,[-T,T]); * 思考题 * 例题 半波整流信号的频谱 % exercise_halfwave_cos.m x=cos(2*pi/T*t); integrand=x*exp(-i*n*2*pi/T*t)/T; %被积函数 Xn=int(integrand,t,-T/4,T/4); %积分 * 结果显示 * 分析 * 例题 奇谐函数的频谱图 * 代码 % exe_zheng_3_7_c.m clear all;close all;clc; syms t x T n; integrand1=(-2*(t+1)/T)*exp(-i*n*2*pi/T*t); integrand2=(2*t/T)*exp(-i*n*2*pi/T*t); Xn=int(integrand1,t,-T/2,0)/T+int(integrand2,t,0,T/2)/T; Xn_N=subs(Xn,T,5); Xn_N=[subs(Xn_N,n,-10:-1) 0 subs(Xn_N,n,1:10)]; n=-10:10; h=stem(n,abs(Xn_N)); set(h,linewidth,2); * 频谱图 奇谐函数含有基波(n=1)及奇次(n=3,5,7…)谐波分量 * step=0.01; x=0:step:10*pi; y=sinc(x/pi); subplot(2,1,1); h=plot(x,y);set(h,LineWidth,2); Si_wave=cumsum(y)*step; subplot(2,1,2); h=plot(x,Si_wave);set(h,LineWidth,2) * 正弦函数的泰勒级数展开 x=0:0.01:2*pi; y=x; K=100 for ii=2:1:K y_add=power(-1,ii+1)*power(x,ii*2-1)/prod(1:(ii*2-1)); y=y+y_add; plot(x,y,k,x,sin(x),y:); end * 画Si函数波形 syms x y si_func=int(sin(x)/x,0,y); * y=sawtooth(t,0.2) See also square, sin, cos, chirp, diric, gauspuls, pulstran, rectpuls, sinc and tripuls. * 7.3 指数函数形式的傅里叶级数 1.复指数正交函数集 2.级数形

文档评论(0)

1亿VIP精品文档

相关文档