Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2009-05-18, 16:48   #1
xiaoke
初级会员
 
注册日期: 2009-05-18
年龄: 39
帖子: 1
声望力: 0
xiaoke 正向着好的方向发展
默认 线性无失真仿真

clear all;
close all;
Ts=1;
N_sample=8;
dt=Ts/N_sample;
N=1000;
t=0:dtN*N_sample-1)*dt;
gt1=ones(1,N_sample);
gt2=ones(1,N_sample/2);
gt2=[gt2 zeros(1,N_sample/2)];
mt3=sinc((t-5)/Ts);
gt3=mt3(1:10*N_sample);
d=(sign(randn(1,N)+1)/2;
data=sige×pand(d,N_sample);
st1=conv(data,gt1);
st2=conv(data,gt2);
d=2*d-1;
data=sige×pand(d,N_sample);
st3=conv(data,gt3);
xt=st1;
[f,xf]=T2F(t,xt);
hf1=exp(-j*pi*f);
yf1=xf.*hf1;
[t1,yt1]=F2T(f,yf1);
hf2=sinc(f)* exp(-j*pi*f);
yf2=xf.*hf2;
[t2,yt2]=F2T(f,yf2);
%hf3=exp(j*pi*f+j*0.1*pi);
f1=find(f<0);
hf3=exp(-j*pi*f+j*pi);
hf3(f1)=exp(-j*pi*f(f1)-j*pi);
yf3=xf.*hf3;
[t3,yt3]=F2T(f,yf3);
hf4= exp(-j*pi*f.*f-j*pi*f+j*pi);
yf4=xf.hf4;
[t4,yt4]=F2T(f,yf40;s
figure(1)
subplot(221)
plotyy(f,abs(hf1),f,angle(hf1)/pi);ylabel(‘幅频、相频特性’);
title(‘线性无失真信道’);grid on;
subplot(222)
plot (t1,real(yt1));title(‘经过信道后的输出信号’);
axis([0,20,-1.2 1.2]); grid on;
subplot(223)
plotyy(f,abs(hf2),f,angle(hf2)/pi);ylabel(‘幅频、相频特性’);
title(‘幅频失真信道’);grid on;xlabel(‘f’)
subplot(224)
plot (t2,real(yt2));
axis([0,20,-1.2 1.2]); grid on; xlabel(‘t’);
figure(2)
subplot(221);
plotyy(f,abs(hf3),f,angle(hf3)/pi);ylabel(‘幅频、相频特性’);
title(‘相频失真、群时延无失真信道’);grid on;
subplot(222);
plot (t3,real(yt3));title(‘经过信道后的输出信号’);
axis([0,20,-1.2 1.2]); grid on;
subplot(223)
plotyy(f,abs(hf4),f,angle(hf4)/pi);ylabel(‘幅频、相频特性’);
title('相频失真、群时延无失真信道’;grid on;xlabel(‘f’)
subplot(224);
plot (t4,real(yt4));
axis([0,20,-1.2 1.2]); grid on; xlabel(‘t’);
麻烦帮我看下这个程序为生命运行不了 帮我改下
xiaoke 当前离线   回复时引用此帖
回复

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 12:41


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.