Simulation of BPSK modulation with MATLAB

Source: Internet
Author: User

This is my maiden post, will also write more ICT blog. Today for everyone presented MATLAB simulation BPSK modulation of the codes:

Clear ALL;CLC;
Snr_db=1:1:9;
snr=10.^ (SNR_DB./10);
Size=length (snr_db);
A=ones (1,size);% fixed a, variable sigma defined
Sigma=sqrt (1./(2*snr));%a=1
n=10000;
S=randi ([0,1],1,n);
s1=2*s-1;
S2=zeros (1,n);
N_errb=zeros (1,size);
For I=1:1:size
N=sigma (i). *RANDN (1,n);
Y=s1+n;
For J=1:1:n
If Y (j) >0
S2 (j) = 1;
Else Y (j) <=0
S2 (j) = 0;
End
End
For K=1:1:n
If S2 (k) ~=s (k)
N_ERRB (i) =N_ERRB (i) +1;
End
End
End
ber=n_errb./n;
T_ber=qfunc (sqrt (2*snr));
Semilogy (Snr_db,ber,snr_db,t_ber);
Legend (' Simulated BER ', ' theoretical ber ');
Hold on; Grid on;

If you have any questions about this code, you can call my email address: [email protected].

Next period for everyone to bring with MATLAB simulation QPSK modulation. Like can pay attention to me ~ Thank you.

Simulation of BPSK modulation with MATLAB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.