?? main3.m
字號:
%部分響應系統
global dt t df N
N=2^13; %采樣點數
L=32; %每碼元的采樣點數
M=N/L %碼元數
Rb=2; %碼速率是2Mb/s
Ts=1/Rb; %碼元間隔
dt=Ts/L; %時域采樣間隔
df=1/(N*dt) %頻域采樣間隔
T=N*dt %截短時間
Bs=N*df/2 %系統帶寬
Na=4; %示波器掃描寬度為4個碼元
t=[-T/2+dt/2:dt:T/2]; %時域橫坐標
f=[-Bs+df/2:df:Bs]; %頻域橫坐標
x=input('請輸入部分響應系統的類別(1-5):');
switch(x);
case 1
R=[0 0 0 1 1];
case 2
R=[0 0 1 2 1];
case 3
R=[0 0 -1 1 2];
case 4
R=[0 0 -1 0 1];
case 5
R=[-1 0 2 0 -1];
end
g=R(1)*sinc(pi*t/Ts)+R(2)*sinc(pi*(t-Ts)/Ts)+R(3)*sinc(pi*(t-2*Ts)/Ts)+R(4)*sinc(pi*(t-3*Ts)/Ts)+R(5)*sinc(pi*(t-4*Ts)/Ts);%部分響應系統波形
G=t2f(g);%傅里葉變換
EP=zeros(size(f))+eps;
for ii=1:100
a=sign(randn(1,M));
imp=zeros(1,N); %產生沖激序列
imp(L/2:L:N)=a/dt;
S=t2f(imp).*G;
s=f2t(t2f(imp).*G);
s=real(s);
P=S.*conj(S)/T;
EP=(EP*(ii-1)+P+eps)/ii;
subplot(212)
plot(f,30+10*log10(EP));
grid on %繪制部分響應系統頻譜圖
axis([-1,1,0,30])
xlabel('f (MHz)')
ylabel('Ps(f) (dBm/MHz)')
title('第x類部分響應系統頻譜圖')
end
subplot(211)
plot(t,g);%繪制部分響應系統時域特性曲線
grid on
hold on
line([-4*pi 4*pi],[0 0])
axis([-6 6 -0.4 1.3])
title('第x類部分響應系統的沖擊響應')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -