📄 bpskshurujitiaozhi.m
字号:
clear all;
close all;
A = 1;
fc = 2; %2Hz
N_sample = 8;
N = 500; %码元数
Ts = 1; %1Baud/s
dt = Ts/fc/N_sample; %波形采样间隔
t = 0:dt:N*Ts-dt;
Lt = length(t);
%产生二进制信源
d = sign(randn(1,N));
dd = sigexpand((d + 1)/2,fc*N_sample);
gt = ones(1,fc*N_sample); %NRZ波形
figure(1)
subplot(211); %输入NRZ信号波形(单极性)
d_NRZ = conv(dd,gt);
plot(t,d_NRZ(1:length(t)));
axis([0 10 0 1.2]);
ylabel('输入信号');
subplot(212); %输入NRZ频谱
[f,d_NRZf] = T2F(t,d_NRZ(1:length(t)));
plot(f,10*log10(abs(d_NRZf).^2/Ts));
axis([-2 2 -50 30]);
ylabel('输入信号功率谱密度(dB/Hz)');
figure(2)
%2PSK信号
ht = A*cos(2*pi*fc*t);
d_2psk = 2*d_NRZ-1;
s_2psk = d_2psk(1:Lt).*ht;
subplot(211)
plot(t,s_2psk);
axis([0 10 -1.2 1.2]);
ylabel('2psk');
subplot(212)
[f,s_2pskf] = T2F(t,s_2psk);
plot(f,10*log10(abs(s_2pskf).^2/Ts));
axis([-fc-4 fc+4 -50 30]);
ylabel('2psk功率谱密度(dB/Hz)');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -