基带信号的眼图实验
基帶信號的眼圖實(shí)驗(yàn)
?
提示:
%需要用到sigexpand這個(gè)函數(shù)程序
% sigexpand.m
%
% Simulation program to expand the symbol sequence
%
% Programmed by Y.S. Cui and H.Harada
%
function [out]=sigexpand(d,M) ?
N=length(d); ????????????%基帶信號碼元長度
out=zeros(M,N); ?????????%矩陣M為采樣點(diǎn) ?N為基帶信號碼元數(shù)量
out(1,:)=d; ????????????%將零矩陣第一行換成基帶信號中的8個(gè)碼元
????out=reshape(out,1,M*N); ?% 1行 m*n 列
?
%基帶信號眼圖,
clear all;
close all;
Ts=1;
N_sample=17;
eye_num=7;
alpha=1;
N_data=1000;
dt=Ts/N_sample;
t=-3*Ts:dt:3*Ts;
%產(chǎn)生雙極性數(shù)字信號
d=sign(randn(1,N_data));
dd=sigexpand(d,N_sample);
%基帶系統(tǒng)沖擊響應(yīng)(升余弦)
ht=sinc(t/Ts).*(cos(alpha*pi*t/Ts))./(1-4*alpha^2*t.^2/Ts^2+eps);
st=conv(dd,ht);
st=conv(dd,ht);
tt=-3*Ts:dt:(N_data+3)*N_sample*dt-dt;
figure(1)
subplot(211);
plot(tt,st);
axis([0 20 -1.2 1.2]);
xlabel(t/Ts);ylabel('部分響應(yīng)基帶信號');
subplot(212)
%畫眼圖
ss=zeros(1,eye_num*N_sample);
ttt=0:dt:eye_num*N_sample*dt-dt;
for?k=3:52
????ss=st(k*N_sample+1:(k+eye_num)*N_sample);
????drawnow;
????plot(ttt,ss);
????hold on;
end?
%plot(ttt,ss);
xlabel('t/Ts');ylabel('部分響應(yīng)基帶信號');
%需要用到sigexpand這個(gè)函數(shù)程序
% sigexpand.m
%
% Simulation program to expand the symbol sequence
%
% Programmed by Y.S. Cui and H.Harada
%
function?[out]=sigexpand(d,M) ?
N=length(d); ????????????%基帶信號碼元長度
out=zeros(M,N); ?????????%矩陣M為采樣點(diǎn) ?N為基帶信號碼元數(shù)量
out(1,:)=d; ????????????%將零矩陣第一行換成基帶信號中的8個(gè)碼元
????out=reshape(out,1,M*N); ?% 1行 m*n 列
?
?
?
%示意雙極性NRZ基帶信號經(jīng)過帶寬受限信號造成的碼間干擾影響及其眼圖
clear all;
close all;
N=1000;
N_sample=8;
%每碼元抽樣點(diǎn)數(shù)
Ts=1;
dt=Ts/N_sample;
t=0:dt:(N*N_sample-1)*dt;
gt=ones(1,N_sample);%數(shù)字基帶波形
d=sign(randn(1,N));%輸入數(shù)字序列
a=sigexpand(d,N_sample);
st=conv(a,gt);%數(shù)字基帶信號
ht1=5*sinc(5*(t-5)/Ts);
rt1=conv(st,ht1);
ht2=sinc((t-5)/Ts);
rt2=conv(st,ht2);
eyediagram(rt1+j*rt2,40,5);
%調(diào)用Matlab畫眼圖的函數(shù),行40點(diǎn),表示5只眼
基帶信號的眼圖實(shí)驗(yàn)
?
提示:
%需要用到sigexpand這個(gè)函數(shù)程序
% sigexpand.m
%
% Simulation program to expand the symbol sequence
%
% Programmed by Y.S. Cui and H.Harada
%
function [out]=sigexpand(d,M) ?
N=length(d); ????????????%基帶信號碼元長度
out=zeros(M,N); ?????????%矩陣M為采樣點(diǎn) ?N為基帶信號碼元數(shù)量
out(1,:)=d; ????????????%將零矩陣第一行換成基帶信號中的8個(gè)碼元
????out=reshape(out,1,M*N); ?% 1行 m*n 列
?
%基帶信號眼圖,
clear all;
close all;
Ts=1;
N_sample=17;
eye_num=7;
alpha=1;
N_data=1000;
dt=Ts/N_sample;
t=-3*Ts:dt:3*Ts;
%產(chǎn)生雙極性數(shù)字信號
d=sign(randn(1,N_data));
dd=sigexpand(d,N_sample);
%基帶系統(tǒng)沖擊響應(yīng)(升余弦)
ht=sinc(t/Ts).*(cos(alpha*pi*t/Ts))./(1-4*alpha^2*t.^2/Ts^2+eps);
st=conv(dd,ht);
st=conv(dd,ht);
tt=-3*Ts:dt:(N_data+3)*N_sample*dt-dt;
figure(1)
subplot(211);
plot(tt,st);
axis([0 20 -1.2 1.2]);
xlabel(t/Ts);ylabel('部分響應(yīng)基帶信號');
subplot(212)
%畫眼圖
ss=zeros(1,eye_num*N_sample);
ttt=0:dt:eye_num*N_sample*dt-dt;
for?k=3:52
????ss=st(k*N_sample+1:(k+eye_num)*N_sample);
????drawnow;
????plot(ttt,ss);
????hold on;
end?
%plot(ttt,ss);
xlabel('t/Ts');ylabel('部分響應(yīng)基帶信號');
%需要用到sigexpand這個(gè)函數(shù)程序
% sigexpand.m
%
% Simulation program to expand the symbol sequence
%
% Programmed by Y.S. Cui and H.Harada
%
function?[out]=sigexpand(d,M) ?
N=length(d); ????????????%基帶信號碼元長度
out=zeros(M,N); ?????????%矩陣M為采樣點(diǎn) ?N為基帶信號碼元數(shù)量
out(1,:)=d; ????????????%將零矩陣第一行換成基帶信號中的8個(gè)碼元
????out=reshape(out,1,M*N); ?% 1行 m*n 列
?
?
?
%示意雙極性NRZ基帶信號經(jīng)過帶寬受限信號造成的碼間干擾影響及其眼圖
clear all;
close all;
N=1000;
N_sample=8;
%每碼元抽樣點(diǎn)數(shù)
Ts=1;
dt=Ts/N_sample;
t=0:dt:(N*N_sample-1)*dt;
gt=ones(1,N_sample);%數(shù)字基帶波形
d=sign(randn(1,N));%輸入數(shù)字序列
a=sigexpand(d,N_sample);
st=conv(a,gt);%數(shù)字基帶信號
ht1=5*sinc(5*(t-5)/Ts);
rt1=conv(st,ht1);
ht2=sinc((t-5)/Ts);
rt2=conv(st,ht2);
eyediagram(rt1+j*rt2,40,5);
%調(diào)用Matlab畫眼圖的函數(shù),行40點(diǎn),表示5只眼
?
總結(jié)
- 上一篇: 一文读懂TDengine的窗口查询功能
- 下一篇: html5 商品分类页面效果zepto