By Di Zhang zhdizhan@student.jyu.fi 07102016 TIES328:Matlab exercise 1 By Di Zhang zhdizhan@student.jyu.fi.

Slides:



Advertisements
Similar presentations
Outline Transmitters (Chapters 3 and 4, Source Coding and Modulation) (week 1 and 2) Receivers (Chapter 5) (week 3 and 4) Received Signal Synchronization.
Advertisements

Communication System Overview
Welcome to MATLAB DigComm LAB
Chapter 3. Noise Husheng Li The University of Tennessee.
Lab5 (Signal & System) Instructor: Anan Osothsilp Date: 20 Feb 07 Due Date 09 March 07.
1. INTRODUCTION In order to transmit digital information over * bandpass channels, we have to transfer the information to a carrier wave of.appropriate.
S Digital Communication Systems Bandpass modulation II.
The Impact of Channel Estimation Errors on Space-Time Block Codes Presentation for Virginia Tech Symposium on Wireless Personal Communications M. C. Valenti.
Diversity techniques for flat fading channels BER vs. SNR in a flat fading channel Different kinds of diversity techniques Selection diversity performance.
Optimization of pilot Locations in Adaptive M-PSK Modulation in a Rayleigh Fading Channel Khaled Almustafa Information System Prince Sultan University.
Digital Data Transmission ECE 457 Spring Information Representation Communication systems convert information into a form suitable for transmission.
Communication Systems Simulation - I Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course.
Communication Systems Simulation - II Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course.
Communication Systems Simulation - III Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course.
School of Electrical, Electronics and Computer Engineering University of Newcastle-upon-Tyne Baseband Digital Modulation Baseband Digital Modulation Prof.
Digital Communications I: Modulation and Coding Course
Cellular System Capacity Maximum number of users a cellular system can support in any cell. Can be defined for any system. Typically assumes symmetric.
1 Lecture 9: Diversity Chapter 7 – Equalization, Diversity, and Coding.
Carrier-Amplitude modulation In baseband digital PAM: (2d - the Euclidean distance between two adjacent points)
A FREQUENCY HOPPING SPREAD SPECTRUM TRANSMISSION SCHEME FOR UNCOORDINATED COGNITIVE RADIOS Xiaohua (Edward) Li and Juite Hwu Department of Electrical and.
64-QAM Communications System Design and Characterization Project #1 EE283
Random Processes and LSI Systems What happedns when a random signal is processed by an LSI system? This is illustrated below, where x(n) and y(n) are random.
Modulation, Demodulation and Coding Course
ECE 4371, Fall, 2014 Introduction to Telecommunication Engineering/Telecommunication Laboratory Zhu Han Department of Electrical and Computer Engineering.
1 Secure Cooperative MIMO Communications Under Active Compromised Nodes Liang Hong, McKenzie McNeal III, Wei Chen College of Engineering, Technology, and.
Lecture II Introduction to Digital Communications Following Lecture III next week: 4. … Matched Filtering ( … continued from L2) (ch. 2 – part 0 “ Notes.
Coding No. 1  Seattle Pacific University Modulation Kevin Bolding Electrical Engineering Seattle Pacific University.
I. Previously on IET.
A Soft Decision Decoding Scheme for Wireless COFDM with Application to DVB-T Advisor : Yung-An Kao Student : Chi-Ting Wu
Recap Script M-file Editor/Debugger Window Cell Mode Chapter 3 “Built in MATLAB Function” Using Built-in Functions Using the HELP Feature Window HELP.
Spread Spectrum Modulation Dr. Teerasit Kasetkasem.
Performance analysis of channel estimation and adaptive equalization in slow fading channel Chen Zhifeng Electrical and Computer Engineering University.
CHAPTER 5 SIGNAL SPACE ANALYSIS
Additive White Gaussian Noise
ECE 4710: Lecture #31 1 System Performance  Chapter 7: Performance of Communication Systems Corrupted by Noise  Important Practical Considerations: 
1 Lab. 3 Digital Modulation  Digital modulation: CoderDAC Transmit filter Up- conversion Channel Down- conversion Receive filter ADC ProcessingDetectionDecoder.
Coherent Detection Primary Advantage Primary Disadvantage
Outline Transmitters (Chapters 3 and 4, Source Coding and Modulation) (week 1 and 2) Receivers (Chapter 5) (week 3 and 4) Received Signal Synchronization.
CHAPTER 6 PASS-BAND DATA TRANSMISSION
Matthew Valenti West Virginia University
EEE-752 Emerging Wireless Networks MIMO Simulation Riaz Hussain FA08-PCE-003 Ph.D. Student Department of Electrical Engineering.
1 Channel Coding: Part III (Turbo Codes) Presented by: Nguyen Van Han ( ) Wireless and Mobile Communication System Lab.
Institute for Experimental Mathematics Ellernstrasse Essen - Germany DATA COMMUNICATION introduction A.J. Han Vinck May 10, 2003.
GUIDED BY:- Mr. ABHAY GOEL (ET DEPT) SUBMITTED BY:- Amit Krishna Dwivedi(ET VII-A) Ankita Gupta(ET VII-A) Chanchal Singh(ET VII-A) Anuj Kumar(ET VII-A)
Fundamentals of Communications. Communication System Transmitter: originates the signal Receiver: receives transmitted signal after it travels over the.
Báo cáo đồ án Thông Tin Số (CT386) Nhóm 2: 1.Cao Kim Loan Lâm Quốc Sự Bộ môn Điện Tử Viễn Thông GVHD : TS.Lương Vinh Quốc Danh.
Linear Algebra Review.
Principios de Comunicaciones EL4005
OptiSystem applications: SER & BER analysis of QAM-PSK-PAM systems
Hui Ji, Gheorghe Zaharia and Jean-François Hélard
I. Previously on IET.
Subject Name: Digital Communication Subject Code: 10EC61
디지털통신 Bandpass Modulation 1 임 민 중 동국대학교 정보통신공학과.
OptiSystem applications: BER analysis of BPSK with RS encoding
64-QAM Communications System Design and Characterization
Outline Introduction Signal, random variable, random process and spectra Analog modulation Analog to digital conversion Digital transmission through baseband.
Unit 5 The Fourier Transform.
Advanced Wireless Networks
Sampling rate conversion by a rational factor
Coding for Noncoherent M-ary Modulation
Coding and Interleaving
Telecommunications Engineering Topic 2: Modulation and FDMA
HDR a solution using MIMO-OFDM
Error control coding for wireless communication technologies
Chen Zhifeng Electrical and Computer Engineering University of Florida
Submission Title: FPP-SUN Bad Urban GFSK vs OFDM
Digital communication (Band pass signals)
II. Modulation & Coding.
On the Design of RAKE Receivers with Non-uniform Tap Spacing
EE 6332, Spring, 2017 Wireless Telecommunication
Presentation transcript:

By Di Zhang zhdizhan@student.jyu.fi 07102016 TIES328:Matlab exercise 1 By Di Zhang zhdizhan@student.jyu.fi

Matlab exercise Introduction Link level simulation (07102016) System level simulation (21102016) Home assignment (Extra Credits)

Matlab for if rand: randn: round: sqrt: norm: abs: real: find: length: erfc: for if Check the Matlab documentation for explanation. e.g. https://se.mathworks.com/help/search.html?submitsearch=&qdoc=real

Link Level Simulation (BPSK case) We simulate uncoded BER of BPSK modulate data as a function of SNR in an AWGN channel in a Rayleigh fading channel Plot and see the signals from Tx, passing through different channels, and BER at Rx.

Introduction -- Link

Introduction -- Data

data=2*round(rand(Ns,1))-1 Introduction -- Data data=2*round(rand(Ns,1))-1

Introduction -- Data

Introduction -- Data

Introduction -- Modulation Modulation Types (Binary ASK, FSK, PSK)

Introduction -- Modulation Modulation Types (Binary ASK, FSK, PSK)

Introduction -- Modulation Modulation Types – 4 Level ASK, FSK, PSK

Introduction -- Modulation Modulation Types – 4 Level ASK, FSK, PSK

Introduction – After Modulation Bpsk=sqrt(snr(k))*data

Introduction -- Noise

Introduction – Channel AGWN Additive white Gaussian noise (AWGN) is a basic noise model used in Information theory to mimic the effect of many random processes that occur in nature. The modifiers denote specific characteristics: Additive because it is added to any noise that might be intrinsic to the information system. White refers to the idea that it has uniform power across the frequency band for the information system. It is an analogy to the color white which has uniform emissions at all frequencies in the visible spectrum. Gaussian because it has a normal distribution in the time domain with an average time domain value of zero. n=1/sqrt(2)*(randn(Ns,1)+j*randn(Ns,1)); Bpsk=sqrt(snr(k))*data+n

Introduction – Channel AGWN

Introduction – Channel Rayleigh

Introduction – Channel 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 Rayleigh Rayleigh fading is a statistical model for the effect of a propagation environment on a radio signal, such as that used by wireless devices. Rayleigh fading models assume that the magnitude of a signal that has passed through such a transmission medium (also called acommunications channel) will vary randomly, or fade, according to a Rayleigh distribution — the radial component of the sum of two uncorrelatedGaussian random variables. taps=1/sqrt(2)*(randn(Ns,1)+j*randn(Ns,1)); Bpsk_r=sqrt(snr(k))*abs(taps).*data + n

Introduction – Channel Rayleigh

Introduction – Demodulation Bpsk=sqrt(snr(k))*data+n Bpsk_r=sqrt(snr(k))*abs(taps).*data+n

Introduction – Rx Rayleigh

Introduction – Demodulation r1=real(Bpsk); %demodulated signal, soft decision r2=real(Bpsk_r);

Introduction – Demodulation

Introduction – Demodulation hard decision d1=find(r1>=0); d2=find(r1<0); r1(d1)=1;r1(d2)=-1; d1=find(r2>=0); d2=find(r2<0); r2(d1)=1;r2(d2)=-1; ADWG Rayleigh

Introduction – Demodulation

Introduction – BER Ber1=length(find((data-r1)~=0)); %number of errors in AWGN Ber2=length(find((data-r2)~=0)); %number of errors in Rayleigh BER1(k)=BER1(k)+Ber1; %AWGN BER2(k)=BER2(k)+Ber2; %Rayleigh BER1(k)=BER1(k)/Ns/l; BER2(k)=BER2(k)/Ns/l;

Introduction – received BER

Introduction – theoritical BER %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)));

Introduction – compare

The code in Matlab

Link Level Simulation %Before any simulation, please use clear all; close all;clc %set used SNR values (SNR =Eb/No) values in decibels SNR=[0:1: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;

Link Level Simulation %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 Do remember every ”for” needs a ”end”

Link Level Simulation %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 if l==1 & k==1 %we plot/see things only once, at the first round plot(data);title('data');axis([0 Ns -1.1 1.1]); pause end %MODULATION %BPSK signal bpsk=data;

Link Level Simulation %------------------------------------------------- %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.

Link Level Simulation (BPSK case) %we check this if l==1 & k==1 var_n=norm(n)^2; end %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. %AWGN BPSK Bpsk=sqrt(snr(k))*data+n; %snr is Eb/N0 in BER equations plot([real(Bpsk) data]); legend('real part of signal','data'); title('BPSK signal in noise'); pause

Link Level Simulation (BPSK case) %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 .* if l==1 & k==1, plot([real(Bpsk_r) data]) legend('real part of signal','data'), title('BPSK signal in noise & fading channel'); pause end

Link Level Simulation (BPSK case) %difference between AWGN and Rayleigh channel if l==1 & k==1, plot(abs([Bpsk Bpsk_r])) legend('AWGN','RAYLEIGH'); title('BPSK in AWGN & Rayleigh fading channel'); pause end

Link Level Simulation (BPSK case) %--------------------------------------------------- %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); %different demodulated symbols if l==1 & k==1 plot([r1 r2]) legend('AWGN','Rayleigh'); title('demodulated symbols');pause; end

Link Level Simulation (BPSK case) %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; %plot example if l==1 & k==1 plot([r1 r2]) legend('AWGN','Rayleigh'); axis([0 Ns -1.1 1.1]); title('demodulated symbols after hard decisions') pause end

Link Level Simulation (BPSK case) %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 if k==1 & l==1, errors=[Ber1 Ber2]; end %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 %we stop MC trials if minimum number of errors is %obtained in all systems if BER1(k)>Nerr & BER2(k)>Nerr break %terminates the innermost loop End end % end of MC

Link Level Simulation (BPSK case) %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; end % end SNR loop %all simulated BERs and corresponding SNR in a matrix BER=[SNR BER1 BER2]; %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))); %logarithmic plot (y-axis) semilogy(SNR,[The_awgn The_rayl BER1 BER2]) xlabel('SNR [dB]') ylabel('BER') axis([0 SNR(length(SNR)) 1e-4 .5]) grid on legend('Theor AWGN','Theor Rayl.','AWGN','Rayl.')