Presentation is loading. Please wait.

Presentation is loading. Please wait.

Communication Systems Simulation - III Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course.

Similar presentations


Presentation on theme: "Communication Systems Simulation - III Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course."— Presentation transcript:

1 Communication Systems Simulation - III Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course

2 2 Random Number Generation Many simulators include random number generators –you can use those These should be validated –If not already accepted by your community –But you always can questionnaire those, especially new generators Here we consider some aspects of validation

3 3 Random Number Generation Complex additive white Gaussian noise is usually met in communication simulations Used to model thermal noise Properties: –I and Q channels (real and imaginary part) –Zero mean –I and Q independent –White Flat power spectrum density (PSD) Impulsive autocorrelation (impulse at zero flag) –I and Q are Gaussian

4 4 RNG example We use MATLAB to do some tests MATLAB has randn m-file that generates zero mean, unit variance random variables RNGs use an initial value (state, seed) from which they start –This should be randomized In MATLAB (5) you may add command RANDN('state',sum(100*clock)) to your startup file to set the generator to a different state each time you start

5 5 RNG example %create complex white Gaussian signal with N elements N=10000; n=randn(N,1)+j*randn(N,1); Is it zero mean? %check mean MEAN=mean(n) plot([real(n) imag(n)]) legend('real','imag') title('mean of real and imaginary part')

6 6 The larger N is the close zero the mean is N=1000, mean 0.0177 + 0.0263i N=10 000, mean 0.0044 - 0.0017i However, if you repeat the trial several times and calculate the average the result is zero.

7 7 RNG example %check variance, should be 2 now since %we have a sum of two Gaussian processes with var 1 VAR=var(n) –N=1000, VAR=1.9617 –N=10 000, VAR=2.0292 –The larger N is, the closer VAR is 2

8 8 RNG example I and Q independent, how it is measured? Cross correlation should be zero Cross correlation coefficient should be zero %check independency of I and Q %since maximum is N (if fully correlated sequences %the result is scaled by N plot(xcorr(real(n),imag(n))/N) %same is verified by calculating correlation coefficient, where %results are normalized by standard deviations XCORR=corrcoef(real(n),imag(n))

9 9 N=1000 XCORR = 1.0000 -0.0600 -0.0600 1.0000 Correlation 6 % N= 10 000 XCORR = 1.0000 0.0296 0.0296 1.0000 Correlation 3 % The larger N the Closer independency I and Q are

10 10 RNG example Whiteness? –Autocorrelation impulsive –PSD flat %check whiteness, %maximum autocorrelation 2N plot(abs(xcov(n))) title('autocorrelation') psd(n) %uses Welch method title('PSD')

11 11 Quite impulsive

12 12 Quite flat

13 13 RNG example Gaussianity? –Histogram –Statistical tests (not considered herein) %check Gaussianity hist([real(n) imag(n)],50) %50 bars legend('real','imag') title('histograms')

14 14 Quite Gaussian shapes

15 15 Fading channels To create fading channels you have to understand what they are In fading channels signal and possibly its delayed versions are multiplied by random (tap) coefficients Rayleigh fading channel –Taps are zero mean, complex Gaussian variables with a variance set so that SNR is what is wanted –Equally, amplitude is Rayleigh distributed and phase is uniformly distributed between 0 and 2

16 16 Fading channels Rician fading channels –Taps are non-zero mean complex Gaussian variables with a variance and amplitude set so that SNR is what is wanted – Alternatively, amplitude is Rician distributed and phase is uniformly distributed between 0 and 2 Also other fading channels exist

17 17 Fading channels Changing mean and variance of a zero mean unit variance complex Gaussian variance x to m and  2 Multiply by  and add m, i.e., new x = x+m In fading channels one is usually interested the amplitude of the tap, not the phase –Create taps as rayleigh * exp(j*2*pi*rand) –Or rician * exp(j*2*pi*rand) –Some MATLAB toolboxes include generation of Rayleigh and Rician variables, otherwise you may create them from two Gaussian variables


Download ppt "Communication Systems Simulation - III Harri Saarnisaari Part of Simulations and Tools for Telecommunication Course."

Similar presentations


Ads by Google