Docsity

MATLAB Simulation and Frequency Diversity - Lecture Slides | ECE 732, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download MATLAB Simulation and Frequency Diversity - Lecture Slides | ECE 732 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

MATLAB Simulation Frequency Diversity: Wide-Band Signals

Simulation of Wireless Communication

Systems using MATLAB

Dr. B.-P. Paris

Dept. Electrical and Comp. Engineering

George Mason University

Fall 2007

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Outline

MATLAB Simulation

Frequency Diversity: Wide-Band Signals

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

System to be Simulated

× p(t )

∑ δ (t − nT )

×

A

h(t ) +

N(t )

Π Ts (t )

Sampler, rate fs

to DSP

bn s(t^ )^ R(t^ )^ R[n]

Figure: Baseband Equivalent System to be Simulated.

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

From Continuous to Discrete Time

I The system in the preceding diagram cannot be simulated

immediately.

I Main problem: Most of the signals are continuous-time

signals and cannot be represented in MATLAB.

I Possible Remedies:

1. Rely on Sampling Theorem and work with sampled

versions of signals.

2. Consider discrete-time equivalent system.

I The second alternative is preferred and will be pursued

below.

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Discrete-Time Equivalent System

I The discrete-time equivalent system

I is equivalent to the original system, and

I contains only discrete-time signals and components.

I Input signal is up-sampled by factor fsT to make input and

output rates equal.

I Insert fsT − 1 zeros between input samples.

×

A

↑ fs T h[n] +

N[n]

to DSP

bn R[n]

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Components of Discrete-Time Equivalent System

I Question: What is the relationship between the

components of the original and discrete-time equivalent

system?

× p(t )

∑ δ (t − nT )

×

A

h(t ) +

N(t )

Π Ts (t )

Sampler, rate fs

to DSP

bn s(t^ )^ R(t^ )^ R[n]

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Discrete-time Equivalent Impulse Response

Time/T

Figure: Discrete-time Equivalent Impulse Response (fsT = 8)

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Discrete-Time Equivalent Noise

I To determine the properties of the additive noise N[n] in

the discrete-time equivalent system,

I Set input signal to zero,

I let continuous-time noise be complex, white, Gaussian with

power spectral density N 0 ,

I output signal is discrete-time equivalent noise.

I Procedure yields: The noise samples N[n]

I are independent, complex Gaussian random variables, with

I zero mean, and

I variance equal to N 0 /Ts.

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Simulating Transmission of Symbols

I We are now in position to simulate the transmission of a

sequence of symbols.

I The MATLAB functions previously introduced will be used

for that purpose.

I We proceed in three steps:

1. Establish parameters describing the system,

I By parameterizing the simulation, other scenarios are easily

accommodated.

2. Simulate discrete-time equivalent system,

3. Collect statistics from repeated simulation.

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Listing : SimpleSetParameters.m 3 % This script sets a structure named Parameters to be used by % the system simulator.

%% Parameters % construct structure of parameters to be passed to system simulator 8 % communications parameters Parameters.T = 1/10000; % symbol period Parameters.fsT = 8; % samples per symbol Parameters.Es = 1; % normalize received symbol energy to 1 Parameters.EsOverN0 = 6; % Signal-to-noise ratio (Es/N0) 13 Parameters.Alphabet = [1 -1]; % BPSK Parameters.NSymbols = 1000; % number of Symbols

% discrete-time equivalent impulse response (raised cosine pulse) fsT = Parameters.fsT; 18 tts = ( (0:fsT-1) + 1/2 )/fsT; Parameters.hh = sqrt (2/3) (^) * ( 1 - cos (2* pi tts) sin ( pi /fsT)/( pi /fsT));

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Simulating the Discrete-Time Equivalent System

I The simulation of the discrete-time equivalent system uses

toolbox functions RandomSymbols, LinearModulation, and

addNoise.

A = sqrt (Es/T); % transmitter gain N0 = Es/EsOverN0; % noise PSD (complex noise) NoiseVar = N0/TfsT; % corresponding noise variance N0/Ts Scale = Ahh*hh’; % gain through signal chain 34 %% simulate discrete-time equivalent system % transmitter and channel via toolbox functions Symbols = RandomSymbols( NSymbols, Alphabet, Priors ); Signal = A (^) * LinearModulation( Symbols, hh, fsT ); 39 if ( isreal (Signal) ) Signal = complex(Signal);% ensure Signal is complex-valued end Received = addNoise( Signal, NoiseVar );

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

Digital Matched Filter

I The vector Received contains the noisy output samples from

the analog front-end.

I In a real system, these samples would be processed by

digital hardware to recover the transmitted bits.

I Such digital hardware may be an ASIC, FPGA, or DSP chip.

I The first function performed there is digital matched

filtering.

I This is a discrete-time implementation of the matched filter

discussed before.

I The matched filter is the best possible processor for

enhancing the signal-to-noise ratio of the received signal.

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

MATLAB Code for Digital Matched Filter

I The signature line for the MATLAB function implementing

the matched filter is:

function MFOut = DMF( Received, Pulse, fsT )

I The body of the function is a direct implementation of the

structure in the block diagram above.

% convolve received signal with conjugate complex of % time-reversed pulse (matched filter) Temp = conv ( Received, conj ( fliplr (Pulse) ) ); 21 % down sample, at the end of each pulse period MFOut = Temp( length (Pulse) : fsT : end );

MATLAB Simulation Frequency Diversity: Wide-Band Signals Digital Matched Filter and Slicer Monte Carlo Simulation

DMF Input and Output Signal

0 1 2 3 4 5 6 7 8 9 10 −

−

0

200

400

Time (1/T)

DMF Input

0 1 2 3 4 5 6 7 8 9 10 −

−

0

500

1000

1500

Time (1/T)

DMF Output