⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 psk8_t1_r1.m

📁 8PSK误码率分析 误码率(BER:biterror)是衡量数据在规定时间内数据传输精确性的指标。误码率=传输中的误码/所传输的总码数*100 。如果有误码就有误码率。
💻 M
字号:
close all;clear all;rand('state',sum(100*clock));%Initialize RANDrandn('state',sum(100*clock));%Initialize RANDNpi=3.1415926;PSK8_C=[sqrt(2),1+j,j*sqrt(2),-1+j,-sqrt(2),-1-j,-j*sqrt(2),1-j]; %Signal setPSK8_B=[0 0 0; 0 0 1;0 1 1;0 1 0;1 1 0;1 1 1;1 0 1;1 0 0]; %Binary mappingSizeOfSignalSet=size(PSK8_B,1);%The size of the signal setBitsPerSymbol=size(PSK8_B,2); %number of bits carried by one symbolEs=sum(PSK8_C.*conj(PSK8_C))/length(PSK8_C); %Average symbol energyEb=Es/BitsPerSymbol; %bit energyrecIndex=1;for EbN0=0:2:30    N0=Eb*10^(-EbN0/10); %get the noise power,larger equal to 1,lower equal to 10^-3    testCount=0;    errCount=0;    while(1)        h=(randn(1)+j*randn(1))/sqrt(2);%Generate the channel (Complex gaussian, Rayleigh apmlitude),complex conjugate divide 2        %Randomly generate a source symbol        SrcIndex=floor(rand(1)*SizeOfSignalSet)+1;        x=PSK8_C(SrcIndex); %get the signal symbol        %Generate the noise        n=(randn(1)+j*randn(1))/sqrt(2);        n=n*sqrt(N0); %control the noise power, N0,complex conjugate multiply        %The channel with noise        r=h*x+n;        %Detect the signal        y=r/h;        %Decision        Error=(y-PSK8_C);        Dist=Error.*conj(Error);%calculate distance of every set        [minVlaue DecIndex]=min(Dist);%find minimum distance and set        if(DecIndex ~= SrcIndex)           errBinary=mod(PSK8_B(SrcIndex,:)+PSK8_B(DecIndex,:),3);%calculate difference of set point            errCount=errCount+sum(errBinary);%numbers of real error bit         end        testCount=testCount+1;        testLength=testCount*BitsPerSymbol;%Get the binary length        %stop control        if(testLength<100000) %test length lower bound less than 100/10^-3            continue;        end        BER=errCount/testLength;        if(BER<1e-10)%errCount not equal to naught/zero            continue;        end        testLevel=500.0/BER; %confidence level,errCount >= 10^3 / BitsPerSymbol        if(testLength>testLevel)            break;        end    end    BER_rec(recIndex)=BER;%record the test result    EbN0_rec(recIndex)=EbN0;    recIndex=recIndex+1;        %Display the results    BER_rec    EbN0_recendsemilogy(EbN0_rec,BER_rec,'-');xlabel('Eb/N0 in dB');ylabel('Bit error ratio');title('PSK8 relation of Tx1 Rx1 BER');grid

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -