MPSK通信系统的设计与性能研究-8PSK
  2wN4WcZv6ZCi 2023年11月02日 49 0

文章和代码已经归档至【Github仓库:communication-system-simulation】或者公众号【AIShareLab】回复 通信系统仿真 也可获取。

一、8PSK背景

二、原理概述

2.1 PSK调制

发送端发送的是一连串离散而随机的二进制比特流,使用PSK载波相位调制的方法,这样发送端发送的消息便包含在了相位中,此种调制方法可以十分有效地节约带宽。

MPSK通信系统的设计与性能研究-8PSK_距离度量

其中, MPSK通信系统的设计与性能研究-8PSK_通信系统_02 是发送滤波器的脉冲形状, 传输信号的频谱特性由它决定。A则是信号的幅度。在 MPSK通信系统的设计与性能研究-8PSK_距离度量_03 调制中, 所有的 MPSK通信系统的设计与性能研究-8PSK_距离度量_03 信号对于所有的 MPSK通信系统的设计与性能研究-8PSK_距离度量_05 都具有相同的能量。 能量为:

MPSK通信系统的设计与性能研究-8PSK_8PSK_06

代表每个传输符号的能量。

在本次实验中, 为了方便分析, 我们令 MPSK通信系统的设计与性能研究-8PSK_距离度量_07 , 那么, 相应的 MPSK通信系统的设计与性能研究-8PSK_8PSK_08 调制信号的波形为

MPSK通信系统的设计与性能研究-8PSK_8PSK_09

我们规定:

MPSK通信系统的设计与性能研究-8PSK_距离度量_10

经过上述分析, 我们不难得出, 这样一个相位调制信号可以看作两个正交载波, 因

此, 数字相位调制信号可以在几何上可用二维向量的形式来表示, 即 $$ \vec{s} {m}=(\sqrt{\varepsilon{s}} \cos \frac{2 \pi m}{M}, \sqrt{\varepsilon_{s}} \sin \frac{2 \pi m}{M}) $$

正交基函数为:

MPSK通信系统的设计与性能研究-8PSK_距离度量_11

2.2 信号传输

调制信号在 AWGN 信道传输的时候, 会有噪声混杂进来, 此时输出信号变为: $$ r(t)=u_{m}(t)+n_{c}(t) \cos (2 \pi f_{c} t)-n_{s}(t) \sin (2 \pi f_{c} t) $$

其中, MPSK通信系统的设计与性能研究-8PSK_代码实现_12MPSK通信系统的设计与性能研究-8PSK_代码实现_13 分别是加性噪声的同相分量和正交分量, 之后, 我们将输出信号和 给出的基函数作相关, 则两个相关器的输出为: MPSK通信系统的设计与性能研究-8PSK_8PSK_14 需要注意的是 MPSK通信系统的设计与性能研究-8PSK_代码实现_12MPSK通信系统的设计与性能研究-8PSK_代码实现_13 这两个正交噪声的分量是零均值, 互不相关的高斯随机过程。

2.3 解调方式

(1)最小欧式距离准则判决

最小欧式距离准则判决: 求出接收到的信号向量与 M 个传输向量的欧式距离, 选取 对应的最小欧式距离的向量, 该向量对应的符号即为判决输出符号。此种方法需要掌握 距离度量的概念并熟练运用, 下面给出关于距离度量具体的

理论分析:

在接收消息尚不确定 (即还没有接收到矢量 MPSK通信系统的设计与性能研究-8PSK_代码实现_17 ) 的情况下, 要使得先验概率为最大, 最好的判决方法就是选择具有最高先验概率 MPSK通信系统的设计与性能研究-8PSK_距离度量_18 的信号; 接受到矢量 MPSK通信系统的设计与性能研究-8PSK_代码实现_17 后, 其方法与 前者类似, 前者是寻找先验概率的最大值, 此时是寻找后验概率的最大值, 换言之, 选择使 MPSK通信系统的设计与性能研究-8PSK_代码实现_20 最大的 MPSK通信系统的设计与性能研究-8PSK_通信系统_21 , 这个判决准则称为最大后验概率 (MAP) 准则。

根据贝叶斯公式, 后验概率可表示为: $P(\vec{s} {m} \mid \vec{r})=\frac{f(\vec{r} \mid \vec{s} {m}) P(\vec{s} *{m})}{f(\vec{r})} $ 当 M 个信号先验概率相等, 由于 MPSK通信系统的设计与性能研究-8PSK_8PSK_22MPSK通信系统的设计与性能研究-8PSK_通信系统_23 均为确定的值 MPSK通信系统的设计与性能研究-8PSK_通信系统_24 。则寻找 MPSK通信系统的设计与性能研究-8PSK_代码实现_25 的最大值就等价于寻找 MPSK通信系统的设计与性能研究-8PSK_通信系统_26 的最大值。此时 MAP 准则简化为 ML 准则。

我们不妨对接收到的矢量 MPSK通信系统的设计与性能研究-8PSK_代码实现_17 进行简要的分析, MPSK通信系统的设计与性能研究-8PSK_代码实现_28, MPSK通信系统的设计与性能研究-8PSK_通信系统_21 是信号矢量, MPSK通信系统的设计与性能研究-8PSK_通信系统_30 是 AWGN 信道中的噪声矢量, 噪声矢量的分量 MPSK通信系统的设计与性能研究-8PSK_通信系统_31 服从分布 MPSK通信系统的设计与性能研究-8PSK_代码实现_32 , 则 MPSK通信系统的设计与性能研究-8PSK_代码实现_33 服从分布 MPSK通信系统的设计与性能研究-8PSK_通信系统_34

因此 $$\begin{aligned} f(\vec{r} \mid \vec{s} {m}) & =\prod{k=1}^{N} \frac{1}{\sqrt{\pi N_{0}}} \mathrm{e}^{-\frac{(r_{k}-s_{m k})^{2}}{N_{0}}} \ & =\frac{1}{(\pi N_{0})^{\frac{N}{2}}} e^{\frac{|\vec{r}-\vec{s} {m}|^{2}}{N{0}}}, m=1,2, \ldots, M \end{aligned} $$

右端取对数有:

$\ln f(\vec{r} \mid \vec{s} {m})=-\frac{N}{2} \ln (\pi N{0})-\frac{1}{N_{0}} \sum_{k=1}^{N}(r_{k}-s_{m k})^{2} $

上式若要取得最大值, 显而易见 MPSK通信系统的设计与性能研究-8PSK_距离度量_35 需要取最小值。这也是符合我们直观印象的, 信号空间里两个信号点的欧氏距离越小, 说明它们越接近。

因此, 定义距离度量 MPSK通信系统的设计与性能研究-8PSK_距离度量_36

如下:

MPSK通信系统的设计与性能研究-8PSK_通信系统_37

(2) 最佳检测器

最佳检测器将收到的信号向量 r 投射到 M 个可能的传输信号向量 MPSK通信系统的设计与性能研究-8PSK_通信系统_38 之一上去, 并 选取对应与最大投影的向量。将上述定义的距离度量展开:

MPSK通信系统的设计与性能研究-8PSK_距离度量_39

其中, MPSK通信系统的设计与性能研究-8PSK_8PSK_40项对所有的判决度量是等价的的, 我们忽略这一项, 则得到相关度量:

MPSK通信系统的设计与性能研究-8PSK_代码实现_41

可以看出, 距离度量越小, 则相关度量越大。

上述分析也证明了老师要求证明的内容:即相关度量与距离度量是完全等价的。

2.4 错误概率

理论错误概率:

8PSK: MPSK通信系统的设计与性能研究-8PSK_8PSK_42 ;

QPSK: MPSK通信系统的设计与性能研究-8PSK_距离度量_43

实际错误概率:

误码率: 错误码元/传输总码元

误比特率: 错误比特/传输总比特

三、系统框图

8PSK:

MPSK通信系统的设计与性能研究-8PSK_代码实现_44

图3.1 8PSK系统框图

四、主函数设计

4.1 星座图绘制主函数

1.流程图

MPSK通信系统的设计与性能研究-8PSK_代码实现_45

图4.1 星座图绘制主函数流程图

2.代码实现

clc,clear,close;
% Symbol sequence length
L=100000;
% Generate the original bit sequence
sourceSeq=randnum(L);
[pI,pQ,sourceSeqCode]=Map(sourceSeq,L);
Eb = 1/3;

errbit = zeros(1,26);
errnum = zeros(1,26);
SNR=-5:20;
LS = length(SNR);
for i=1:LS
    % Find the one-sided power spectral density of noise for a given signal-to-noise ratio
    N0=Eb/(10^(SNR(i)/10)); 
    % variance
    var(i)=N0/2  ;      
    [rI,rQ]=noise(var(i),pI,pQ);
    [result,I]=judgment(rI,rQ);
    [errbit(i),errnum(i)]=Count(result,I,sourceSeq,sourceSeqCode);
end
draw(sourceSeqCode,rI,rQ);

4.2 QPSK与8PSK误码率对比主函数

1.流程图

MPSK通信系统的设计与性能研究-8PSK_通信系统_46

图4.2 qpsk与8psk误码率对比主函数流程图

2.代码实现

clc,clear,close;
% Symbol sequence length
L=100000;
% Generate the original bit sequence
sourceSeq=randnum(L);
[pI,pQ,sourceSeqCode]=Map(sourceSeq,L);
Eb = 1/3;

errbit = zeros(1,26);
errnum = zeros(1,26);
SNR=-5:20;
LS = length(SNR);
for i=1:LS
    % Find the one-sided power spectral density of noise for a given signal-to-noise ratio
    N0=Eb/(10^(SNR(i)/10)); 
    % variance
    var(i)=N0/2  ;      
    [rI,rQ]=noise(var(i),pI,pQ);
    [result,I]=judgment(rI,rQ);
    [errbit(i),errnum(i)]=Count(result,I,sourceSeq,sourceSeqCode);
end
% draw(sourceSeqCode,rI,rQ);

% Calculate the theoretical bit error rate using the erfc function
Theory8PSKSER = erfc(sqrt(3*10.^(SNR/10)) * sin(pi/8)); 
% QPSK 
TheoryQPSKSER = erfc(sqrt(10.^(SNR/10))).*(1-0.25*erfc(sqrt(10.^(SNR/10))));;
% Load the SER-SNR curve of QPSK
load('qpsk_errnum');
figure(2);
epskerr = errnum/L;
semilogy(SNR,epskerr,'r-o');hold on;
semilogy(SNR,qpskerr,'b-o');hold on;
semilogy(SNR,Theory8PSKSER,'k-');hold on;
semilogy(SNR,TheoryQPSKSER,'k-');hold on;
ylabel('SER');
xlabel('SNR/dB')
legend('8PSK仿真曲线','QPSK仿真曲线','理论曲线','Location', 'northeast' );
grid on;
axis([-5,20,10e-7,1]);

五、子函数设计

5.1 随机比特序列的产生

代码实现:

function [SourceSeq]=randnum(L)
% L is the length of the generated sequence code
% Since a code is composed of 3 bits, it is generated here with 3*L.
randnum=rand(3*L,1);
% Initialize the original sequence
SourceSeq=zeros(3*L,1);
% The randomly generated sequence is judged
% if the random number is greater than 0.5, it is judged as 1, otherwise it is judged as 0.
for i=1:3*L
    if(randnum(i)>=0.5)
        SourceSeq(i)=1;
    else
        SourceSeq(i)=0;
    end
end

5.2格雷编码序列

代码实现

% Define 8psk mapping function
function [pI,pQ,SourceCode] = Map(SourceSeq,L)
% pI - in-phase component
% pQ - quadrature component
% SourceCode - The size of the binary number of each digit of the sequence
% initialization
pI = zeros(L,1);
pQ = zeros(L,1);
% In order to facilitate subsequent expressions, sqrt(2)/2 is represented here
root =sqrt(2)/2;
% Constructing the mapping matrix according to the Gray code of 8PSK
MappingMat = [[1,0];[root,root];[-root,root];[0,1];[root,-root];[0,-1];[-1,0];[-root,-root]];

SourceCode =zeros(L,1);
% mapping process
for i=1:L
    % Since a source symbol is composed of three bits
    % the low and high bits are read in reverse order here, and expressed in decimal
    SourceCode(i)=SourceSeq(3*i-2)*4+SourceSeq(3*i-1)*2+SourceSeq(3*i)+1;
    % Find the corresponding code through the decimal representation and map it
    pI(i) = MappingMat(SourceCode(i),1);
    pQ(i) = MappingMat(SourceCode(i),2);
end
end

% Octal Gray Code Conversion
function[a1,a2]=Map_other(N)
% a1 is a sequence of random bits in binary
% a2 is a sequence of octal symbols
% Random bit sequence of length 3L
a1=bit(3*N);
% a2 is used to store the code element sequence of length L
a2=zeros(1,N);
for i=1:3:3*N-2
   a2((i+2)/3)=abs(a1(i)*7-abs(a1(i+1)*3-a1(i+2)));
% Converts binary bit sequence Gray-encoded to octal sequence
end 
end

5.3 映射函数

代码实现

% 8PSK coordinate mapping
function [y3]=coordinate(x1,bit)
% x1 is the encoded octal sequence, bit is the originally generated binary random sequence
N=length(x1);
Es=bit*bit'/N;
% The first line of y3 is used to store the abscissa
% the second line is used to store the ordinate
y3=zeros(2,N);
% Coordinate mapping
for i=1:N
    y3(1,i)=sqrt(Es)*cos(pi/4*x1(i)+pi/8);
    y3(2,i)=sqrt(Es)*sin(pi/4*x1(i)+pi/8);
end
end

5.4 噪声生成与叠加输出

代码实现

% Generate Gaussian random noise sub-function , var is the variance
function [rI,rQ] = noise(var,pI,pQ)
L = length(pI);
nc=zeros(L,1);
ns=zeros(L,1);
for k=1:L
u=rand;
z=sqrt(var*2*log(1/(1-u)));
nc(k)=z*cos(2*pi*u);
ns(k)=z*sin(2*pi*u);
end
% Output two mutually orthogonal Gaussian signals
rI = pI+nc;
rQ = pQ+ns;
end

5.5 判决函数

代码实现

% Judgment Criterion: Minimum Euclidean Distance Criterion
function [result,I]=judgment(rI,rQ)
root=sqrt(2)/2;
L = length(rI);
I=zeros(L,1);
mapl = [[1,0];[root,root];[-root,root];[0,1];[root,-root];[0,-1];[-1,0];[-root,-root]];
for i=1:L
    index=0;
    minp=100;
    for j=1:8
        % Traverse each coordinate
        % find the point with the smallest Euclidean distance from the point, and record it.
        if((mapl(j,1)-rI(i))^2+(mapl(j,2)-rQ(i))^2<minp)
            minp=(mapl(j,1)-rI(i))^2+(mapl(j,2)-rQ(i))^2;
            index=j;
        end
    end
    I(i)=index;
end

% According to the judgment point, make the corresponding assignment
result = zeros(3*L,1);
for i=1:L
    switch(I(i))
        case 1
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(0,0,0);
        case 2
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(0,0,1);
        case 3
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(0,1,0);
        case 4
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(0,1,1);
        case 5
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(1,0,0);
        case 6
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(1,0,1);
        case 7
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(1,1,0);
        case 8
            [result(3*i-2),result(3*i-1),result(3*i)]=SetValue(1,1,1);
    end
end

end

SetValue将对应的值进行赋值即可,由于判决函数中调用次数过多,因此抽象封装成一个函数,便于使用。

% SetValue function
function [a,b,c]=SetValue(d,e,f)
a=d;
b=e;
c=f;
end

5.6星座图绘制函数

代码实现

function draw(I,rI,rQ)
figure;
root = sqrt(2)/2;
%映射矩阵
MappingMat = [[1,0];[root,root];[-root,root];[0,1];[root,-root];[0,-1];[-1,0];[-root,-root]];
L=length(I)
for i=1:L
    % Draw points with different colors according to different values
    switch(I(i))
        case 1
            plot(rI(i),rQ(i),'*','color','r');hold on;

        case 2
            plot(rI(i),rQ(i),'*','color','g');hold on;

        case 3
            plot(rI(i),rQ(i),'*','color','b');hold on;

        case 4
            plot(rI(i),rQ(i),'*','color','c');hold on;

        case 5
            plot(rI(i),rQ(i),'*','color','m');hold on;

        case 6
            plot(rI(i),rQ(i),'*','color','y');hold on;

        case 7
            plot(rI(i),rQ(i),'*','color','k');hold on;

        case 8
            plot(rI(i),rQ(i),'*','color','[0.5,0.5,0.5]');hold on;

    end
end
x = -4:0.1:4;
y = -2:0.1:2;
% plot(x,zeros(length(x)),'k');hold on;
% plot(zeros(length(y)),y,'k');hold on;
axis equal
axis([-2,2,-2,2]);
end

5.7误码率及误比特率计算函数

代码实现

function [errbit,errsymbol]=Count(result,I,sourceSeq,sourceSym)
% result: the sequence after the decision
% I: symbol after decision
% sourceSeq: original bit sequence
% sourceSym: original symbol sequence
errbit=0;
errsymbol=0;
for i=1:length(sourceSeq)
    if(sourceSeq(i)~=result(i))
        errbit=errbit+1;
    end
end
for i=1:length(I)
    if(I(i)~=sourceSym(i))
        errsymbol=errsymbol+1;
    end
end
end

六、性能分析与实验结果

6.1 比较8PSK与QPSK的Monte Carlo仿真误符号率曲线、理论误符号率曲线差别

在AWGN信道下,未加信道纠错码的8PSK调制通信系统检测器的判决准则选为最小距离法(星座图上符号间的距离),格雷码映射,比较数据点为100000时8PSK与QPSK的Monte Carlo仿真误符号率曲线,理论误符号率曲线,比较差别(横坐标是SNR=Eb/N0)。(一张图上呈现4条曲线)

MPSK通信系统的设计与性能研究-8PSK_距离度量_47

图6. 1 QPSK与8PSK性能比较

通过Monte Carlo仿真误符号率曲线可以看出,整体仿真结果基本符合理论计算曲线,并且在不同的信噪比下,对应的QPSK的误码率明显小于8PSK的误码率,8PSK的星座图如下:

MPSK通信系统的设计与性能研究-8PSK_通信系统_48

图6. 2 8PSK星座图

6.2 理论分析8PSK性能比QPSK

理论证明如下:

MPSK通信系统的设计与性能研究-8PSK_8PSK_49

假设发送信号的相位为 MPSK通信系统的设计与性能研究-8PSK_8PSK_50 ,那么

MPSK通信系统的设计与性能研究-8PSK_距离度量_51

因为 MPSK通信系统的设计与性能研究-8PSK_8PSK_52MPSK通信系统的设计与性能研究-8PSK_通信系统_53 是联合高斯随机过程

MPSK通信系统的设计与性能研究-8PSK_8PSK_54

检测的测度为相位 MPSK通信系统的设计与性能研究-8PSK_代码实现_55

MPSK通信系统的设计与性能研究-8PSK_代码实现_56

其中 MPSK通信系统的设计与性能研究-8PSK_距离度量_57 . MPSK通信系统的设计与性能研究-8PSK_通信系统_58 是接收矢量 MPSK通信系统的设计与性能研究-8PSK_通信系统_59 的包络. 若 MPSK通信系统的设计与性能研究-8PSK_代码实现_60MPSK通信系统的设计与性能研究-8PSK_通信系统_61

MPSK通信系统的设计与性能研究-8PSK_代码实现_62 若发送相位 0 , 当噪声使接收矢量的相位落在区域 MPSK通信系统的设计与性能研究-8PSK_距离度量_63 之外时会发生判 决错误,即

MPSK通信系统的设计与性能研究-8PSK_代码实现_64

对于 M=4 , 码元错误概率应为:

MPSK通信系统的设计与性能研究-8PSK_通信系统_65

对于 M=8 , 码元错误概率为:

MPSK通信系统的设计与性能研究-8PSK_8PSK_66

很明显, 随着 MPSK通信系统的设计与性能研究-8PSK_8PSK_67 的不断增长, MPSK通信系统的设计与性能研究-8PSK_代码实现_68 也在不断增加。符合实验结果。

七、问题回顾与总结

1.对二进制序列格雷编码的问题

针对二进制序列格雷编码,主要有两种思路,分别是直接法和间接法,直接法是先根据8PSK的格雷码构造映射矩阵,根据该3bit数表示码元的十进制值寻找其在格雷码矩阵中的对应位置,并且进行映射,需要注意的部分是由于一个源码元是由三个bit组成的,因此实际读取中,以3位单位进行遍历,并且通过倒序的方式读取低高位。

2.关于MPSK误符号率的问题

最开始计算误符号率时, 对于 QPSK 的理论误码率, 我最开始采用的是 MPSK 的统一公式:

MPSK通信系统的设计与性能研究-8PSK_通信系统_69

但是在后续的学习中, 才发现上述公式尽可以在 M>4 的情况下才可以使用, 而对于 \mathrm{M}=4 时的系统误码率, 应该采用公式:

MPSK通信系统的设计与性能研究-8PSK_距离度量_70

3.关于星座图绘制的问题

在绘制星座图时,初步想法是对于每一个判决分类的样本点采用不同的颜色绘制,但是对于如何针对点进行颜色,线性的绘制,我的初步想法是建立一个颜色-线性的向量,然后对于每个点判决的具体情况找到对应的样本颜色线型,采用数组引用的形式进行属性的赋值,但是随后发现看似简化了绘制过程,实际却在引用时产生很大的工作量,还可能产生错误绘制,因此综合比较下我选择用switch的方法进行情况判断,并对相应的判决点进行绘制。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

2wN4WcZv6ZCi