title('加噪声信号') %相干解调
st1=fsk.*s1;%与载波1相乘
[f,sf1] = T2F(t,st1);%通过低通滤波器
[t,st1] = lpf(f,sf1,2*fm);
figure(3);
subplot(311);
plot(t,st1);
title('与载波1相乘后波形');
st2=fsk.*s2;%与载波2相
[f,sf2] = T2F(t,st2);%通过低通滤波器
[t,st2] = lpf(f,sf2,2*fm);
subplot(312);
plot(t,st2);
title('与载波2相乘后波形');
for m=0:i-1; %抽样判决
if st1(1,m*500+250)<0.25;
for j=m*500+1:(m+1)*500;
at(1,j)=0;
end
else
for j=m*500+1:(m+1)*500;
at(1,j)=1;
end
end
end;
subplot(313);
plot(t,at);
axis([0,5,-1,2]);
title('抽样判决后波形')
4. 2PSK
2PSK以载波的相位变化作为参考基准的,当基带信号为0时相位相对于初始相位为0,当基带信号为1时相 对于初始相位为180°。
clear all
close all
i=10;
j=5000;
fc=4;
fm=i/5;
B=2*fm;