%Part of Telecommunication simulations course, Spring 2006 %Harri Saarnisaari, CWC



Similar documents
PHASE ESTIMATION ALGORITHM FOR FREQUENCY HOPPED BINARY PSK AND DPSK WAVEFORMS WITH SMALL NUMBER OF REFERENCE SYMBOLS

Solving Systems of Linear Equations Using Matrices

ADVANCED APPLICATIONS OF ELECTRICAL ENGINEERING

Digital Modulation. David Tipper. Department of Information Science and Telecommunications University of Pittsburgh. Typical Communication System

Log-Likelihood Ratio-based Relay Selection Algorithm in Wireless Network

BER Performance Analysis of SSB-QPSK over AWGN and Rayleigh Channel

Capacity Limits of MIMO Channels

MIMO CHANNEL CAPACITY

ISI Mitigation in Image Data for Wireless Wideband Communications Receivers using Adjustment of Estimated Flat Fading Errors

Implementation of Digital Signal Processing: Some Background on GFSK Modulation

MODULATION Systems (part 1)

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

Lezione 6 Communications Blockset

NRZ Bandwidth - HF Cutoff vs. SNR

Teaching Convolutional Coding using MATLAB in Communication Systems Course. Abstract

Adaptive Equalization of binary encoded signals Using LMS Algorithm

Module 13 : Measurements on Fiber Optic Systems

Deterministic Formulization of SNR for Wireless Multiuser DS-CDMA Networks

RADIO FREQUENCY INTERFERENCE AND CAPACITY REDUCTION IN DSL

DVB-T. The echo performance of. receivers. Theory of echo tolerance. Ranulph Poole BBC Research and Development

System Identification for Acoustic Comms.:

A SIMULATION STUDY ON SPACE-TIME EQUALIZATION FOR MOBILE BROADBAND COMMUNICATION IN AN INDUSTRIAL INDOOR ENVIRONMENT

Communication on the Grassmann Manifold: A Geometric Approach to the Noncoherent Multiple-Antenna Channel

Application Note Noise Frequently Asked Questions

The Effect of Network Cabling on Bit Error Rate Performance. By Paul Kish NORDX/CDT

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

Solutions to Exam in Speech Signal Processing EN2300

IN current film media, the increase in areal density has

Propagation Channel Emulator ECP_V3

Appendix D Digital Modulation and GMSK

QAM Demodulation. Performance Conclusion. o o o o o. (Nyquist shaping, Clock & Carrier Recovery, AGC, Adaptive Equaliser) o o. Wireless Communications

CBS RECORDS PROFESSIONAL SERIES CBS RECORDS CD-1 STANDARD TEST DISC

Jitter Measurements in Serial Data Signals

Lab 1. The Fourier Transform

Time and Frequency Domain Equalization

ADVANCED ALGORITHMS FOR EQUALIZATION ON ADSL CHANNEL

Module: Digital Communications. Experiment 784. DSL Transmission. Institut für Nachrichtentechnik E-8 Technische Universität Hamburg-Harburg

INTER CARRIER INTERFERENCE CANCELLATION IN HIGH SPEED OFDM SYSTEM Y. Naveena *1, K. Upendra Chowdary 2

HD Radio FM Transmission System Specifications Rev. F August 24, 2011

IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 55, NO. 1, JANUARY

A WEB BASED TRAINING MODULE FOR TEACHING DIGITAL COMMUNICATIONS

How To Understand The Quality Of A Wireless Voice Communication

How To Understand The Theory Of Time Division Duplexing

Principles of Digital Communication

10.2 ITERATIVE METHODS FOR SOLVING LINEAR SYSTEMS. The Jacobi Method

5 Signal Design for Bandlimited Channels

5.5. Solving linear systems by the elimination method

Digital Baseband Modulation

Question 2: How do you solve a matrix equation using the matrix inverse?

DVB-T. C/N in a static Rayleigh channel. C/N values for portable single and diversity reception. Measurement method.

AP Physics 1 and 2 Lab Investigations

Non-Data Aided Carrier Offset Compensation for SDR Implementation

Abstract. 1. Introduction

Radio Transmission Performance of EPCglobal Gen-2 RFID System

Lecture 8: Signal Detection and Noise Assumption

Bit Error Rate Performance Analysis on Modulation Techniques of Wideband Code Division Multiple Access

RF Measurements Using a Modular Digitizer

MIMO detector algorithms and their implementations for LTE/LTE-A

PAPR and Bandwidth Analysis of SISO-OFDM/WOFDM and MIMO OFDM/WOFDM (Wimax) for Multi-Path Fading Channels

Performance of Quasi-Constant Envelope Phase Modulation through Nonlinear Radio Channels

Digital Communications

Adjacent Channel Interference. Adaptive Modulation and Coding. Advanced Mobile Phone System. Automatic Repeat Request. Additive White Gaussian Noise

Computer exercise 2: Least Mean Square (LMS)

Probability and Random Variables. Generation of random variables (r.v.)

Time Domain and Frequency Domain Techniques For Multi Shaker Time Waveform Replication

Wireless Remote Monitoring System for ASTHMA Attack Detection and Classification

CHAPTER 8 FACTOR EXTRACTION BY MATRIX FACTORING TECHNIQUES. From Exploratory Factor Analysis Ledyard R Tucker and Robert C.

Java Modules for Time Series Analysis

Chapter 1 Introduction

CONTRIBUTION ABSTRACT

CDMA Performance under Fading Channel

Optimum Frequency-Domain Partial Response Encoding in OFDM System

MASTER'S THESIS. Improved Power Control for GSM/EDGE

An Improved b Interference Model for Network Simulation

Signal Detection C H A P T E R SIGNAL DETECTION AS HYPOTHESIS TESTING

Experiment 3: Double Sideband Modulation (DSB)

MSB MODULATION DOUBLES CABLE TV CAPACITY Harold R. Walker and Bohdan Stryzak Pegasus Data Systems ( 5/12/06) pegasusdat@aol.com

8.2. Solution by Inverse Matrix Method. Introduction. Prerequisites. Learning Outcomes

A New Digital Communications Course Enhanced by PC-Based Design Projects*

Enhancing the SNR of the Fiber Optic Rotation Sensor using the LMS Algorithm

CDMA TECHNOLOGY. Brief Working of CDMA

CHAPTER 6 Frequency Response, Bode Plots, and Resonance

Nonlinear Iterative Partial Least Squares Method

MATLAB and Big Data: Illustrative Example

Loop Bandwidth and Clock Data Recovery (CDR) in Oscilloscope Measurements. Application Note

Intro to Practical Digital Communications

6 Scalar, Stochastic, Discrete Dynamic Systems

1) Write the following as an algebraic expression using x as the variable: Triple a number subtracted from the number

5 Capacity of wireless channels

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

User Cooperation Diversity Part I: System Description

Optimal Transmit Spectra for Communication on Digital Subscriber Lines

Experiment 7: Familiarization with the Network Analyzer

Fundamental to determining

Course Curriculum for Master Degree in Electrical Engineering/Wireless Communications

Performance Improvement of DS-CDMA Wireless Communication Network with Convolutionally Encoded OQPSK Modulation Scheme

Keysight Technologies Understanding the Fundamental Principles of Vector Network Analysis. Application Note

TCOM 370 NOTES 99-4 BANDWIDTH, FREQUENCY RESPONSE, AND CAPACITY OF COMMUNICATION LINKS

Jitter Transfer Functions in Minutes

MUSICAL INSTRUMENT FAMILY CLASSIFICATION

Transcription:

%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'), leg('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 again and again for each MC trial - %totally Ns * Nmax symbols, if 100*1000 = 100 000 %results rather reliable down to 1e-4 %plot data %we plot/see things only once, at the first round plot(data),title('data'),axis([0 Ns -1.1 1.1]),pause,

%MODULATION %BPSK signal bpsk=data; %DS spread signal DS=kron(data,ds); %length Ns*Nc ( kron: Kronecker product, element matrices of kron(a,b) are A(i,j)B ) ---------------------------------------------- %plot first 2 symbols of ds-modulated signal if l==1 & k==1 plot([real(ds) imag(ds)]),title('2 symbols of DS modulated signal'), axis([0 2*Nc -1/sqrt(Nc) 1/sqrt(Nc)]),pause, %CHANNELS %This is the place to set SNR. %Since symbol energy is 1 and noise variance is 1, %SNR of symbol/noise sample is 0 db. %Thus, we have to multiply symbol or divide noise to obtain desired SNR. %Since snr is power variable we have to multiply/divide by %sqrt(snr) to have amplitude coefficient. ------------------------------------------------

%noise gereration %for BPSK n=1/sqrt(2)*(randn(ns,1)+j*randn(ns,1)); %Since complex noise is generated by two real noise sequences the %total variance is 2 x variance of one sequence (now 1). If we multiply %by 1/sqrt(2) the total variance of noise becomes 1. %This is two sided noise spectral density No in BER equations. %we check this var_n=norm(n)^2, pause %This should be Ns since we sum Ns variables. %Since n is a realization of a random process, %the result is not exact. %Average of repeated trials gives more exact result. -- %noise for DS-BPSK %Since signal is longer (by factor Nc) we need different noise. n2=1/sqrt(2)*(randn(ns*nc,1)+j*randn(ns*nc,1)); %noise is random and we generate it again and again for each MC trial --

%AWGN BPSK Bpsk=sqrt(snr(k))*data+n; %snr is Eb/N0 in BER equations plot([real(bpsk) data]) leg('real part of signal','data'), title('bpsk signal in noise'),pause -------------------------------------------- %AWGN DS-BPSK Ds=sqrt(snr(k))*DS+n2; (this works since DS energy is normalized to 1) --------------------------------------------- %Rayleigh fading BPSK signal %first we create taps for each symbol taps=1/sqrt(2)*(randn(ns,1)+j*randn(ns,1)); %these are zero mean unit variance complex Gaussian variables Bpsk_r=sqrt(snr(k))*abs(taps).*data+n; %SIGNAL %notice usage of elementwise vector or matrix product.* plot([real(bpsk_r) data]) leg('real part of signal','data'), title('bpsk signal in noise & fading channel'),pause

%difference between AWGN and Rayleigh channel plot(abs([bpsk Bpsk_r])) leg('awgn','rayleigh'), title('bpsk in AWGN & Rayleigh fading channel'),pause %variations on envelope are larger in fading channels %deeper nulls and also higher peaks -- %DEMODULATION %you have to know how these signals are demodulated %coherent + synchronized reception -- %BPSK r1=real(bpsk); %demodulated signal, soft decision %because phase is 0, if phase is h %r1=real(bpsk*exp(-j*2*pi*h)); i.e., phase is cancelled - %BPSK in fading channel r2=real(bpsk_r); ------------------------------------------------

%DS-BPSK %here we need MF to the DS code before taking the real part %different ways to do it %we select correlation approach where each code length block is %multiplied by complex conjugate of the code for v=1:ns, %we have Ns blocks r3(v)=real(ds'*ds((v-1)*nc+1:v*nc)); r3=r3(:); -- %demodulated symbols are actually MF output peaks %separated by Nc samples plot(real(filter(conj(ds(nc:-1:1)),1,ds))) leg('without noise') title('ds-bpsk signal after MF over 6 symbols'), axis([0 6*Nc -3 3]),pause

%different demodulated symbols plot([r1 r2 r3]) leg('awgn','rayleigh','ds'), title('demodulated symbols'),pause %BPSK and DS are close (as they should be) %we can run this at high SNR to see it closely --------------------------------------------- %hard decisions, converts soft demodulated symbols to sequence of +-1 %AWGN d1=find(r1>=0);d2=find(r1<0); r1(d1)=1;r1(d2)=-1; %Rayl d1=find(r2>=0);d2=find(r2<0); r2(d1)=1;r2(d2)=-1; %DS d1=find(r3>=0);d2=find(r3<0); r3(d1)=1;r3(d2)=-1; %plot example plot([r1 r2 r3]) leg('awgn','rayleigh','ds'), axis([0 Ns -1.1 1.1]), title('demodulated symbols after hard decisions') pause -

%BER analysis %errors in the current MC run Ber1=length(find((data-r1)~=0)); %number of errors in AWGN Ber2=length(find((data-r2)~=0)); %number of errors in Rayleigh Ber3=length(find((data-r3)~=0)); %number of errors in DS-BPSK if k==1 & l==1, errors=[ber1 Ber2 Ber3],pause -- %we add errors to previous error counts, initially zero %index k is for SNRs BER1(k)=BER1(k)+Ber1; %AWGN BER2(k)=BER2(k)+Ber2; %Rayleigh BER3(k)=BER3(k)+Ber3; %DS-BPSK %we stop MC trials if minimum number of errors is %obtained in all systems if BER1(k)>Nerr & BER2(k)>Nerr & BER3(k)>Nerr, break %terminates the innermost loop % MC ------------------------------------------------

%we calculate BER by dividing number of successful trials %by their total number BER1(k)=BER1(k)/Ns/l; BER2(k)=BER2(k)/Ns/l; BER3(k)=BER3(k)/Ns/l; %s SNR loop - %all simulated BERs and corresponding SNR in a matrix BER=[SNR BER1 BER2 BER3] ------------------------------------------------ %finally we compute theoretical values and compare them to simulation results %AWGN BER is function of sqrt(2*snr) The_awgn=.5*erfc(sqrt(2*snr)/sqrt(2)); %Rayleigh BER is different function of SNR The_rayl=.5*(1-sqrt(snr./(1+snr))); %note elementwise division./

%logarithmic plot (y-axis) semilogy(snr,[the_awgn The_rayl BER1 BER2 BER3]) xlabel('snr [db]') ylabel('ber') axis([0 SNR(length(SNR)) 1e-6.5]) grid on leg('theor AWGN','Theor Rayl.','AWGN','Rayl.','DS-BPSK') %simulated and theoretical results are close, especially if total number of %symbols is large enough %BPSK and DS-BPSK perform similarly (as they should now) %Rayleigh fading channel is much more difficult environment than AWGN %over 10 db extra power is needed in transmission to have equal results (BER) %10 db more = 10 times higher power, e.g., from 1 W to 10 W