資源簡介
通原軟件實驗代碼--數字信號基帶調制PAM
代碼片段和文件信息
clear?all
%close?all
L=64;???%每個碼元間隔內的采樣點數
N=2^13;??%總采樣點數
M=N/L;??%總碼元數
Rs=5;??%kbit/s
Ts=1/Rs;??%碼元間隔
T=M*Ts;
fs=N/T;
Bs=fs/2;
t=-T/2+(0:N-1)/fs;
f=-Bs+(0:N-1)/T;??
L1=L*0.25;??%占空比25%
L2=L*0.5;??%占空比50%
L3=L*0.75;?%占空比75%
figure(3)
a=(randn(1M)>0);??%產生單極性數據
subplot(221)
tmp=zeros(LM);?
tmp((1:L1):)=ones(L11)*a;
s=tmp(:)‘;
S=t2f_1(sfs);
plot(ts);
grid?on
axis?([-1?1?0?1.5]);
title(‘單極性,占空比25%‘)
subplot(223)
EP=spb(LNMfsTL1);
plot(f10*log10(EP))
grid?on
title(‘功率譜圖形‘)
xlabel(‘f(KHz)‘)
ylabel(‘功率譜密度(dB)‘);
axis?([-50?50?-60?0]);
b=sign((rand(1M)>0.5)-0.5);?
tmp=zeros(LM);?
tmp((1:L1):)=ones(L11)*b;
s=tmp(:)‘;
S=t2f_1(sfs);
subplot(222)
plot(ts);
grid?on
axis?([-1?1?-1.5?1.5]);
title(‘雙極性占空比25%‘);
subplot(224)
EP=dpb(LNMfsTL1);
plot(f10*log10(EP));grid?on
title(‘功率譜圖形‘)
axis?([-50?50?-60?0]);
xlabel(‘f(KHz)‘)
ylabel(‘功率譜密度(dB)‘);
figure(4)
a=(randn(1M)>0);??%產生單極性數據
subplot(221)
tmp=zeros(LM);?
tmp((1:L2):)=ones(L21)*a;
s=tmp(:)‘;
S=t2f_1(sfs);
plot(ts);
grid
axis?([-1?1?0?1.5]);
title(‘單極性,占空比50%‘)
subplot(223)
EP=spb(LNMfsTL2);
plot(f10*log10(EP));
grid;
title(‘功率譜圖形‘)
xlabel(‘f(KHz)‘)
ylabel(‘功率譜密度(dB)‘);
axis?([-50?50?-60?0]);
b=sign((rand(1M)>0.5)-0.5);?
tmp=zeros(LM);?
tmp((1:L2):)=ones(L21)*b;
s=tmp(:)‘;
S=t2f_1(sfs);
subplot(222)
plot(ts);
grid
axis?([-1?1?-1.5?1.5]);
title(‘雙極性占空比50%‘);
subplot(224)
EP=dpb
評論
共有 條評論