Demo entry 6780099

hicug.cn

   

Submitted by anonymous on Dec 22, 2018 at 16:05
Language: Matlab. Code size: 997 Bytes.

%设置调制信号的抽样间隔
xSampleTime=1/100000;
%仿真时间设置为10秒
xSimulationTime=10;
%设置随机数产生器的初始化种子
xInitialSeed=[61;71];
%设置QPSK调制的初始相位
xPhaseOffset=pi/4;
%x表示信噪比的范围
x=0:10;
%y表示信号的误符号率,它与x有相同的长度
y=x;
hold off;
for index=1:4
    %设置QPSK调制信号的抽样个数
    xSamplesPerSymbol=index;
    %设置绘图颜色和误码率计算模块的接收时延
    %当xSamplesPerSymbol不等于1时误码率计算模块有一个符号的接收时延
    switch index
       case 1
         xReceiveDelay=0;
         color='r';
       case 2
         xReceiveDelay=30; 
         color='g';
       case 3
         xReceiveDelay=50; 
         color='b';
       case 4
         xReceiveDelay=100; 
         color='m';
    end
       %循环执行仿真程序
        for i=1:length(x)
            %信道的信噪比依次取x中的元素
            xSNR=x(i);
            %运行仿真程序
            sim('clover8_2');
            %从xErrorRate中获得调制信号的误码率
            y(i)=xErrorRate(1);
        end
     %绘制x和y的关系曲线图,纵坐标采用对数坐标
     semilogy(x,y,color);
     grid on;xlabel('SNR');ylabel('Symbol Error Rate')
     hold on;
end

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).