8psk误码率仿真程序(共2页).docx
精选优质文档-倾情为你奉上% 2005-3-26% 1 transmit,1 receive(3bit/s/Hz)% 8PSK the total rate is 2bit/s/Hz % uncodedclear allclc%SNR upto 20 dBsEbNo=10 15 20 25 30;%N, M: number of transmit and receive antennasN=1;Num=500;% number of frameK=40; % numver of symbols in a frame% initialize countidx=1;BIT=3;% BIT=2 for QPSK% BIT=3 for 8PSK% BIT=4 for 16QAM%wait=0;% the total bit is K*BITfor 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('SNRdB');%ylabel('SER');hold on;title('8PSK性能曲线');semilogy(EbNo,BER,'ro-');grid on;%ylabel('BER');legend('误符号率','误比特率');专心-专注-专业