Gaussian and Laplacian Random Variables

조회 수: 3 (최근 30일)
James Hayek
James Hayek 2015년 8월 7일
편집: James Hayek 2015년 8월 8일
I am unsure how to start this problem, any help will be much appreciated.
"Generate a Gaussian random variable, and a Laplacian random variable. Choose a = 0 (zero mean)
Transmit the sequence using the following cases:
Gaussian noise (variance 0.1 and 1) and use two comparators: the first one will compare one single sample to 0, and the second one where you will compare the average of 100 samples (assumed to have been taken within the bit interval) and compare to 0 again.
If greater than 0, the bit should have been 1 and 0 otherwise. The comparison will be repeated for the case of unequal probability and the same threshold 0 (which may not be optimum).
Laplacian noise (variance 0.1 and 1) is to be the underlying contamination. Repeat the process.
Note that the detector will not be optimum in this case regardless of equal or unequal probabilities. The sequences are
Equal probabilities: 10001011000111101001­­ Unequal probabilities: 11001111011011101101"
Any advice as to where to start?
Edited to include progress done:
%%Delevoped by Group 03
%James Hayek, Ashas Pathan, Paul Kieliszek
%Matlab Group Project
%Professor Mohammed Feknous
%NJIT ECE 321 Random Signals and Noise
%%Clearing and closing all other open programs withing MatLab
close all
clc
%%Generation of a signal bpsk modulation
%This takes a set of random numbers and converts them to bits 0's & 1's
%The 2*X-1 will create -1's in place of the 0's from the bit conversion.
signal_i = 2*(rand(1,10^5)>0.5)-1;
signal_q = zeros(1,10^5);
%In communication systems we have two components
%which is why we have singal i and q
scatterplot(signal_i + 1i*signal_q);
%%Combining for complex representation
signal = complex(signal_i, signal_q);
p_signal = mean(abs(signal).^2) %Power of the signal
e_signal = (abs(signal).^2); %Energy of the signal
%%Adding some noise of a known variance
for var = 1/50:1/10:0.5
noise = 1/sqrt(2)*(randn(1,10^5)+j*randn(1,10^5))*sqrt(var);
addNoise = signal + noise;
%Plotting the above conditions to a graph
figure(1);
plot(real(addNoise),imag(addNoise),'*');
drawnow('expose');
end
for snr = 0:1:10 %dB
snr_lin = 10^(snr/10);
ebno_lin = 10^((snr-3)/10);
var = p_signal/snr_lin; %This is how we are finding noise variance
var_ebno = p_signal/ebno_lin;
noise = 1/sqrt(2)*(randn(1,10^5)+j*randn(1,10^5))*sqrt(var_ebno);
addNoise02 = signal + noise; %We have now averaged/esimated
%the noise to remove it from the signal plotting it to a second graph.
%Plotting the above conditions to a graph
figure(2);
plot(real(addNoise02),imag(addNoise02),'*');
drawnow('expose');
end
%By pressing run, you will see an animation of the generated Gaussian
%Randon signal with noise for graph 1, and the estimated noise removed for
%graph 2.
%Comparing the two signals
signalEqualProb = [1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 0 1 0 0 1];
tf = isequal(addNoise02,signalEqualProb);
figure(3);
stem(tf);
signalUnEqualProb = [1 1 0 0 1 1 1 1 0 1 1 0 1 1 1 0 1 1 0 1]
tf = isequal(addNoise02,signalUnEqualProb);
figure(4);
stem(tf);
If the signal generation is correct, is this the correct way to compare the transmuted signal to the generated one?
Btw my hint given by a classmate was: For the detection scheme, we want to compare the signal+noise to the original signal of 1s and 0s. Then, compare this with what was transmitted.
  댓글 수: 1
james hayek
james hayek 2015년 8월 7일
편집: james hayek 2015년 8월 8일
Does anyone know where I can begin? Any help/advice would be appreciated.

댓글을 달려면 로그인하십시오.

답변 (1개)

David Young
David Young 2015년 8월 8일
You can generate random values from a Gaussian distribution with the randn function. This Wikipedia article tells you how you can generate random values from a Laplacian distribution.
The rest of the instructions don't seem very clear, I'm afraid.
  댓글 수: 1
James Hayek
James Hayek 2015년 8월 8일
Thanks, I think I was able to generate the random Gausian numbers and introduce some noise. I also belive I was able to add the noise and estimate its removial. I updated the question to reflect the coding.
Will you be able to tell me if this is correct so far?
Yes, the whole scope of the problem is unclear even to me, and I am taking the class.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by