Preview

Simulation Example with Matlab

Good Essays
Open Document
Open Document
1227 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Simulation Example with Matlab
%Part of Telecommunication simulations course, Spring 2006 %Harri Saarnisaari, CWC

%We simulate uncoded BER of BPSK modulated data as a function of SNR
%-in an AWGN channel %-in a Rayleigh fading channel %-in an AWGN channel when direct sequence spreading is used

%and compare results to the theoretical ones.
%We assume coherent receiver and perfect synchronization. ------------------------------------------------%set used SNR values %SNR (Eb/No) values in decibels SNR=[0:2:14]'; %column vector %SNR in linear scale snr=10.^(SNR/10); ------------------------------------------------%we create initial zero vectors for BER BER1=zeros(length(SNR),1); BER2=BER1; BER3=BER1; -----------------------------------------------

%we need a DS-code, we create a random, complex one, length Nc %elements +-1 +- j*1 Nc=32; %note that all parameters are defined as variables %their change afterwards is easy %(no need to change it every place, just once) ds=(2*round(rand(Nc,1))-1)+j*(2*round(rand(Nc,1))1); %ds-code %plot the ds signal plot([real(ds) imag(ds)]), axis([0 Nc -1.1 1.1]) title('real and imaginary parts of DS code'), legend('real','imag'),pause -------------------------------------------------%we use symbol energy normalized to 1 %thus, DS energy is normalized to 1 (it is a pulse waveform) ds=ds/norm(ds); %check this ds_energy=norm(ds)^2,pause (NOTE: normalization is a usual trick) -------------------------------------------------%Monte Carlo loop starts here %some initial values %totally Nmax symbols Nmax=1000; %maximum number of iterations Nerr=100; %minimum number of errors for k=1:length(SNR), %we do MC trials for each SNR for l=1:Nmax, %MC loop

-------------------------------------------------

%DATA %we create data as vectors of length Ns symbols %and thus use MATLAB's vector processing capabilities %in addition to for loops (since too long vectors are problems %to some versions of MATLAB) Ns=100; data=2*round(rand(Ns,1))-1; %data is random and generated

You May Also Find These Documents Helpful

  • Good Essays

    Nt1310 Unit 1 Lab Report

    • 2556 Words
    • 11 Pages

    Change the Repetition block to 1x as the signal will be upsampled in the filter block. c. Run the simulation and observe the frequency domain on spectrum analyzer. Under the Trace Menu, select Trace 2 on the spectrum analyzer and press the Clear/Write key. This will allow a comparison between the two signals. What is the approximate null-to-null bandwidth? Are the sidelobe power levels noticeably reduced? Save a copy for submission. d. Reduce the RRC filter bandwidth by changing the Roll-off Factor to 0.2. Click Visualize filter with FVTool to view the magnitude response. Save a copy of the filter response. Run the simulation. What is the approximate null-to-null bandwidth? Are the sidelobe power levels noticeably reduced? Save a copy of the spectrum analyzer display for submission. Stop the simulation. I. 8-PSK Transmitter In this step, we will change the number of data bits transmitted per symbol by increasing the number of phase states. An 8-PSK modulation scheme uses 8 phase states separated by 45degrees (pi/4) to transmit 3-bits per symbol. Change the M-PSK Modulator Baseband to the following parameters. i. M-ary number: 8 ii. Phase Offset: pi/4 a. Run the simulation and observe the 8-PSK frequency response on spectrum analyzer. Trace 2 will be the 8-PSK spectrum and Trace 1 should be original unfiltered BPSK spectrum. What is the approximate null-to-null bandwidth for the 8PSK signal? Compare the bandwidth of the 8-PSK signal to the bandwidth of the filtered BPSK…

    • 2556 Words
    • 11 Pages
    Good Essays
  • Good Essays

    The process of re-collecting a spread signal spreads out the interfering signal, causing it to recede into the background.…

    • 606 Words
    • 3 Pages
    Good Essays
  • Good Essays

    SCI 362: Energy Simulation

    • 755 Words
    • 22 Pages

    In this simulation we were to review the pros and cons of allowing a foreign pharmaceutical company, Colney & Pitts located in California, to be able to harvest the rainforests tree’s bark, and build a manufacturing plant in the Kenyan highlands, to help in finding medication or herbal remedies for patients, by using the harvested bark to create synthetic medication. This particular simulation was going to affect the rainforest in the Kenya highlands where Kikuyu tribe inhabits the land.…

    • 755 Words
    • 22 Pages
    Good Essays
  • Good Essays

    The matrix elements are complex numbers that correspond to the attenuation and phase shift that the wireless communication channel introduces to the signal reaching the receiver with delay τ.…

    • 674 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Math 533

    • 16737 Words
    • 67 Pages

    0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 0.00 0.0000 0.0398 0.0793 0.1179 0.1554 0.1915 0.2257 0.2580 0.2881 0.3159 0.3413 0.3643 0.3849 0.4032 0.4192 0.4332 0.4452 0.4554 0.4641 0.4713 0.4772 0.4821 0.4861 0.4893 0.4918 0.4938 0.4953 0.4965 0.4974 0.4981 0.4987 0.01 0.0040 0.0438 0.0832 0.1217 0.1591 0.1950 0.2291 0.2611 0.2910 0.3186 0.3438 0.3665 0.3869 0.4049 0.4207 0.4345 0.4463 0.4564 0.4649 0.4719 0.4778 0.4826 0.4864 0.4896 0.4920 0.4940 0.4955 0.4966 0.4975 0.4982 0.4987…

    • 16737 Words
    • 67 Pages
    Good Essays
  • Satisfactory Essays

    Homework Week 2

    • 743 Words
    • 3 Pages

    c. Design an algorithm in pseudocode to solve this problem. Make sure to include steps to get each input and generate each output.…

    • 743 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 6 assignment

    • 378 Words
    • 2 Pages

    Nonoverlapping channels- In wireless LANs channels used for sending data which the frequencies do not overlap which allows multiple devices to send data at the same time in the same space…

    • 378 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Spread Spectrum Transmission is a technique used for transmitting radio signals and other telecommunications signals. It is a modern component of CMDA technology used for cellphone signals,…

    • 642 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    a&p review questions

    • 716 Words
    • 3 Pages

    4. List the different types of channels and indicate what causes each one to open.…

    • 716 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Study Guide

    • 1194 Words
    • 5 Pages

    Direct sequence spread spectrum (DSSS), frequency hopping spread spectrum (FHSS), infrared, and orthogonal frequency division multiplexing (OFDM).…

    • 1194 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Week 1 Homework

    • 843 Words
    • 5 Pages

    c. Design an algorithm in pseudocode to solve this problem. Make sure to include steps to get each input and generate each output.…

    • 843 Words
    • 5 Pages
    Good Essays
  • Good Essays

    I began year three with $1,120.28, which was more money than I have ever had in the whole simulation. The first event that took place was the government event. I was very apprehensive because we had just elected a new president, Jacob, and had new house members, so I was unsure how they would feel about the laws that we would try to pass. Jacob also started out his presidency by saying that everyone will be able to have free healthcare, even though that is impossible, so the government had to figure out a fair way to allow the most people possible to have free healthcare. We agreed that we give first 15 people that had the lowest amount of money free healthcare. The government also decided that it was legal to have two jobs. Another goal of…

    • 865 Words
    • 4 Pages
    Good Essays
  • Good Essays

    The key area, and one that is easily overlooked, is the return route from the receiver back to the transmitter.…

    • 499 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Producer vs Consumer

    • 590 Words
    • 3 Pages

    Comments are available in the code that will provide a full understanding of the program itself; however abstraction of the problem will be featured in this lab report. In the abstraction of this problem I had to reference…

    • 590 Words
    • 3 Pages
    Good Essays
  • Better Essays

    Cmos

    • 7550 Words
    • 31 Pages

    As UWB has very large instantaneous bandwidth hence it offers substantial increase in channel capacity,which can be perceived from Shannon link formula:…

    • 7550 Words
    • 31 Pages
    Better Essays

Related Topics