• 大小: 4KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Matlab
  • 标签: 2DPSK  

资源简介

二进制差分相移键控 涉及其编码和相干解调的matlab实现,以及每部分的仿真波形

资源截图

代码片段和文件信息

%-------2DPSK调制与解调--------
fs=30000;
Time_Hold_On=0.1;
Num_Unit=fs*Time_Hold_On;
High_Level=ones(1Num_Unit);
Low_Level=zeros(1Num_Unit);
f=10;
A=1;

%>>>>>>>>>>>码型变换>>>>>>>>>>>
sign_absolute=randsrc(18[01]);%随机产生绝对码
sign_ar=zeros(19);
%sign_relative=zeros(18);%相对码
%delay_relative=zeros(18);%延时一个周期的相对码
for I=1:8
    sign_ar(I+1)=xor(sign_ar(I)sign_absolute(I));
end
sign_relative=sign_ar([2:9]);%相对码的产生
delay_relative=sign_ar([1:8]);%延时后的相对码的产生

%>>>>>>>>>>>initial_the_signal>>>>>>>>>>>>>>>>>>>>
Lenth_Of_Sign=length(sign_relative);
st=zeros(1Num_Unit*Lenth_Of_Sign);%调制后的信号
signal_absolute=zeros(1Num_Unit*Lenth_Of_Sign);%基带信号(绝对码波形)
signal_relative=zeros(1Num_Unit*Lenth_Of_Sign);%相对码波形
signal_delay_relative=zeros(1Num_Unit*Lenth_Of_Sign);%延时相对码波形
signal_result=zeros(1Num_Unit*Lenth_Of_Sign);%解调后的信号
Na=zeros(1Num_Unit*Lenth_Of_Sign);%高斯白噪声
Nb=zeros(1Num_Unit*Lenth_Of_Sign);%高斯白噪声
t=0:1/fs:Lenth_Of_Sign*Time_Hold_On-1/fs;

%>>>>>>>>>>>>>>>>高斯白噪声>>>>>>>>>>>>>>>>>>>>>>>
Na=normrnd(00.31Num_Unit*Lenth_Of_Sign);
Nb=normrnd(00.21Num_Unit*Lenth_Of_Sign);

%>>>>>>>>>>>>>>>基带信号(绝对码波形)>>>>>>>>>>>>>>>>>>>>
for I=1:Lenth_Of_Sign
    if sign_absolute(I)==1
        signal_absolute((I-1)*Num_Unit+1:I*Num_Unit)=High_Level;
    else
        signal_absolute((I-1)*Num_Unit+1:I*Num_Unit)=Low_Level;
    end
end


%>>>>>>>>>>>>>>>相对码波形>>>>>>>>>>>>>>>>>>>>
for I=1:Lenth_Of_Sign
    if sign_relative(I)==1
        signal_relative((I-1)*Num_Unit+1:I*Num_Unit)=High_Level;
    else
        signal_relative((I-1)*Num_Unit+1:I*Num_Unit)=Low_Level;
    end
end



%>>>>>>>>>>>>>>>>信号的调制>>>>>>>>>>>>>>>>>>>>>>
for I=1:Lenth_Of_Sign
    if sign_relative(I)==1
        st((I-1)*Num_Unit+1:I*Num_Unit)=A*sin(2*pi*f*t((I-1)*Num_Unit+1:...
            I*Num_Unit)+pi);
    else
        st((I-1)*Num_Unit+1:I*Num_Unit)=A*sin(2*pi*f*t((I-1)*Num_Unit+1:...
            I*Num_Unit));
    end
e

评论

共有 条评论