8psk误码率仿真程序 下载本文

内容发布更新时间 : 2024/4/18 20:54:22星期一 下面是文章的全部内容请认真阅读。

%% 2005-3-26

% 1 transmit,1 receive(3bit/s/Hz)

% 8PSK the total rate is 2bit/s/Hz % uncoded clear all clc

%SNR upto 20 dBs

EbNo=[10 15 20 25 30];

%N, M: number of transmit and receive antennas N=1;

Num=500;% number of frame

K=40; % numver of symbols in a frame

% initialize count idx=1; BIT=3;

% BIT=2 for QPSK % BIT=3 for 8PSK % BIT=4 for 16QAM

%wait=0;

% the total bit is K*BIT for en=1:length(EbNo)

sigma=0.5/(10^(EbNo(en)/10));

% Num -> number of packets for packet_count=1:Num

%waitbar(wait/(Num*length(EbNo))); %wait=wait+1;

data=randint(1,K*BIT);%randint(1,K*BIT); %%%%%%%%%%%%%%%%%%%%%%%%%%********************************************************** temp=EN_8PSK(data);

x_time=temp; %存点

H=(randn(1,1)+j*randn(1,1))/sqrt(2);

r_time=H*x_time+sqrt(sigma)*(randn(1,K)+j*randn(1,K));

[x_est_bit x_est_symbol]=DE_8PSK(H,r_time);

error_bit(packet_count)=sum(x_est_bit~=data);

error_symbol(packet_count)=sum(x_est_symbol~=temp);

end

BER(idx)=sum(error_bit)/(Num*K*BIT); SER(idx)=sum(error_symbol)/(Num*K); idx=idx+1 end

% *************************************************** figure(1);

semilogy(EbNo,SER,'bo-'); grid on;

xlabel('SNR[dB]'); %ylabel('SER'); hold on;

title('8PSK性能曲线');

semilogy(EbNo,BER,'ro-'); grid on;

%ylabel('BER');

legend('误符号率','误比特率');