matlab通信原理仿真 %周期信号(方波)的展开,fb_jinshi.m close all; clear all; N=100; %取展开式的项数为2N+1项 T=1; fs=1/T; N_sample=128; %为了画出波形,设置每个周期的采样点数 dt = T/N_sample; t=0:dt:10*T-dt; n=-N:N; Fn = sinc(n/2).*exp(-j*n*pi/2); Fn(N+1)=0; ft = zeros(1,length(t)); for m=-N:N ft = ft + Fn(m+N+1)*exp(j*2*pi*m*fs*t); end plot(t,ft)