Wednesday 15 May 2013

Modelling a Communication System and Bit Error Rate

In this example, we will see how we can model a simple communication channel. We will consider two cases : A simple Additive Gaussian noise channel and Rayleigh fading channel. Our signals are complex variables here which signifies both I and Q components.
Fig1: Communication System
Channel
A channel is the medium between the transmitter and receiver. The signals (for example electromagnetic waves) transmitted from the source face different materials in the medium (air, water, buildings, dust or static charges around) it may increase the signal strength or decrease it by some random factor. This is called fading and this factor is called fading variable.
It can also add some random component to the transmitted signal. We can see this as additive noise. When this component follows a Gaussian distribution we call it additive Gaussian Noise.

Signal Modelling
Let us generate a random bit stream which signifies the date need to be sent. We choose the probability of 1 occurring is 0.6. First we generate a random uniform random vector.
u=rand(1000,1)           
Now let us turn  all the elements bigger than 0.4 to 1 and rest to 0. Note that since the original vector is uniform between 0 and 1, the output vector will have 1 with 0.6 probability.
d=zeros(1000,1);
u(d>0.4)=1;
Modulation:

We can further modulate this signal using any modulation scheme. Let us choose few of modulation schemes and compare their outputs. 

a) BPSK
This means -1 denotes 0 bit and +1 denotes 1 bit. let us change all the 0s to -1 and 1s to +1. The transmitted signal can we written as
y=zeros(1000,1);
y(d==0)=-1;
y(d==1)=+1;
Note that each -1 and 1 denotes a sin pulse with phase -180 and +180 with time length equal to symbol duration . We will not consider the anolog signal which is in form concatenated sin signals. The receiver considers whole duration pulse as one and decide the phase. This requires synchronization which is not covered in this tutorial.

B) QPSK or QAM
Let us first divide the signal into I and Q data streams components. Each even numbered data bit is for Q.
dI=d(1:2:999);
dQ=d(2:2:1000);
The transmitted signal can we written as
x=zeros(500,1);x(dI==0 && dQ==0)=sqrt(1/2)*(1+1j);
x(dI==0 && dQ==1)=sqrt(1/2)*(-1+1j);
x(dI==1 && dQ==1)=sqrt(1/2)*(-1-1j);
 x(dI==1 && dQ==0)=sqrt(1/2)*(1-1j);


Channel Modeling
1. Additive gaussian Noise
Let us first consider the simple channel which just adds the Gaussian noise. noise vector is of the same dimension , one noise value for each symbol duration and each noise value  is independent of  previous
symbol. We choose the noise variance as 0.01 and mean as 0.
m=0;
s=sqrt(.01);
N=size(x);
n=m+s*rand(N);
So the output signal which is received at receiver is 
y=x+n;
2. Fading
Let us consider the fading which multiplies to the transmitted signal. As previous, here also each value is independent. We consider Rayleigh fading which means each symbol is Rayleigh distributed. .
h=sqrt(1/2)(randn(N,1)+1j*randn(N,1));
y=h*x+n; 
Receiver Model
We implement simple decoder which computes the phase of signal (as both of them are PSK) and decide upon this. For BPSK, it is equivalent to the following rule

dhat= 1 if y >0
dhat =0 if y<0

for QPSK, the rule is 
dIhat = 1 if imaginary part of y<0 otherwise dIhat=1;
dQhat = 1 if real part of y<0 otherwise dQhat=1;  

Let us implement both of these
BPSK:
dhat=zeros(1000,1);
dhat(y>0)=1;
QPSK:
dIhat=zeros(500,1);
dIhat(imag(y)<0)=1;
dQhat=zeros(500,1);
dQhat(real(y)<0)=1;
dhat=zeros(1000,1);
dhat(1:2:999)=dIhatl
dhat(2:2:1000)=dQhat;

BER performance
Now let us compare the bit error rate which is defined as the ratio of error bit to the total bits transmitted.

e=(d!=dhat);
ber=sum(e)/1000; 

41 comments:

  1. https://www.youtube.com/watch?v=frq4xElV4vU&list=PLT9Fml21iFqNmKkkZrrtgXngneurFRhp0&index=1

    ReplyDelete
  2. http://np-software.blogspot.com

    ReplyDelete
  3. I just found a website who give 74% OFF coupon to Learn Matlab Udemy course
    https://www.udemy.com/learn-matlab/?couponCode=MATLAB25

    ReplyDelete
  4. Thanks for the code... and let tell you that i have also write code for fft matlab not even that you will also find some useful tuts for Radix-2 fft and Radix-4 fft.

    ReplyDelete
  5. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging.
    online Python certification course | python training in OMR | Python training course in Chennai

    ReplyDelete
  6. Hello I am so delighted I found your blog, I really found you by mistake, while I was looking on Yahoo for something else, anyways I am here now and would just like to say thanks for a tremendous post. Please do keep up the great work.

    Java training in Tambaram | Java training in Velachery

    Java training in Omr | Oracle training in Chennai

    ReplyDelete
  7. You got an extremely helpful website I actually have been here reading for regarding an hour. I’m an initiate and your success is incredibly a lot of a concept on behalf of me.
    Data Science course in Indira nagar
    Data Science course in marathahalli
    Data Science Interview questions and answers




    ReplyDelete
  8. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 

    best rpa training in chennai | rpa online training |
    rpa training in chennai |
    rpa training in bangalore
    rpa training in pune
    rpa training in marathahalli
    rpa training in btm

    ReplyDelete
  9. Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.

    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

    ReplyDelete
  10. Nice Blog Quickbooks is the one of the best accounting software. We are providing technical support in Quickbooks Support Phone Number 1800 -986-4607. if you are facing any trouble in Quickbooks dial our Toll free number +1-800-986-4607 for quick response. Our executive is available 24*7.

    ReplyDelete
  11. We have a panel of Quickbooks Support Phone Number 800-986-4607 experts who can help you to solve your Quickbooks related issues. The solutions we deliver will take only few seconds of you. We have the availability 365 days a year and 24 hours a day!

    ReplyDelete
  12. Is error trouble, worries you much? Then, simply call on the Quickbooks Payroll Desktop Support Number 800-986-4591. Here, you can easily resolve your issues & queries. Our Quickbooks payroll support provide you immediate assistance for your issues.

    ReplyDelete
  13. Are you looking for some expert help to fix your Quickbooks issue? Get instant solutions by contacting us at our toll free number Quickbooks Support Phone Number 800-986-4591. We are ensuring to deliver the best solutions that suits your business needs. Do not waste your precious time by wandering here and there.

    ReplyDelete
  14. We have a panel of QuickBooks Proadvisor Support Phone Number experts who can help you to solve your QuickBooks related issues. The solutions we deliver will take only few seconds of you. We have the availability 365 days a year and 24 hours a day!

    ReplyDelete
  15. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome
    Delhi University BCOM 1st, 2nd & Final Year Time Schedule 2020

    ReplyDelete
  16. If you ever struggle with errors or other issues in QuickBooks, you can dial our QuickBooks Customer Service Phone Number 1-833-325-0220 and receive instant help from our QB experts.

    ReplyDelete
  17. nice post!
    Worried About QuickBooks Error ?Get in touch with QuickBooks expert for instant solution.
    Click Here to know how to fix QuickBooks POS Support Phone Number +1-888-603-9404

    ReplyDelete
  18. Worried About QuickBooks Error ?Get in touch with QuickBooks expert for instant solution. Mustache Transplantation Cost

    ReplyDelete
  19. Enterprice social networking Chatting Software
    Enterprise Social Networking is a platform in which your workplace communicates. This incorporates team messaging, project management, collaboration tools, and more. The world is getting social, and your business is too.

    ReplyDelete
  20. Digital Adoption Platform Software

    A digital adoption platform (DAP) is a software layer integrated on top of another software application or website to guide users through tasks and functions. ... These tools are also commonly used to train new employees on software used in-house

    ReplyDelete
  21. Lead Management Software

    Lead management is a systematic process in which incoming leads are qualified, analyzed, and nurtured so that they can be converted into new business opportunities.
    In a typical sales process, leads from multiple channels enter your lead management system, and the sales-ready leads are converted into deals.


    HR Management Software

    It is a software application designed for streamlining the Human Capital Management process in one database. It is also called as Human Resource Information System (HRIS) or Human Resource Management System (HRMS).

    ReplyDelete
  22. Publication and printing software

    Desktop publishing software can turn copy and media files into publishable layouts, for things such as newspapers, magazines, brochures, flyers, and books. Completed layouts can be uploaded onto a website or exported and printed onto paper or similar materials. Users can use prepackaged templates or build pages from scratch, and edit individual pages to meet the needs of each projects. Desktop publishing tools may integrate with drawing or photo editing tools, and are commonly used by the editorial and layout staff within an organization. Completed layouts can be uploaded onto a website or exported and printed onto paper or similar materials.

    ReplyDelete
  23. Auto dialer software
    An auto dialer software is an outbound dialer software that helps businesses to automatically dial out a huge set of leads and saves significant time for your agents. It enables you to connect a customer to a live agent once the call has been patched up at the customer end. This leads to high productivity and efficiency.

    ReplyDelete
  24. Finance and accounting outsorcing companies

    Finance and Accounting Outsourcing (FAO) is: 'The outsourcing of one or more finance and accounting activities or processes. ... The real value to be gained is that the retained finance function can focus on working more closely with the business to provide business partnering and help improve decision making.

    ReplyDelete
  25. If you unregister Bandicam or your computer is broken, you can re-use the license on another computer. Unregister Bandicam. 3) How to change the email address Bandicam Register Key

    ReplyDelete
  26. Portraiture Plugin For Photoshop Cc Crack Torrent Portraiture is one of the most popular plugins for Adobe Photoshop Imagenomic Portraiture Crack

    ReplyDelete