我把代码贴下
%%%%%%%%%%%三角脉冲
i=1;
for t=-51.2:0.1:51.1 %采样间隔0.1 注意这里,下面这个信号x的采样频率是10吗??
if(abs(t)<=5)
x(i)=(1-abs(t)./5);
i=i+1;
end
if(abs(t)>5)
x(i)=0;
i=i+1;
end
end
我把验证代码贴出来,和大家分享
%%%%%%%%%%%三角脉冲
i=1;
%设定三角脉冲宽度tal=10
for t=-51.2:0.1:51.1 %采样间隔0.1
if(abs(t)<=5)
x(i)=(1-abs(t)./5);
i=i+1;
end
if(abs(t)>5)
x(i)=0;
i=i+1;
end
end