Urgent - Need serious help !

Thread Starter

ratel

Joined Jan 30, 2011
8
Project: Simulation of a satellite communication system

I am a newbie, and i would really appriciate the help of you guys. This project is required to my Digital communication course. Due to many issues and the huge projects that im working on i cant finish it, and it need to submit it tomorrow till 11:59PM otherwise i'll fail the course. please help me with the Matlab code.

Here's the Project Details:
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,087
Curious, what day is it where you live? Why didn't you just take the final exam on Saturday? That would have taken only a few hours and not interfered with your other projects.

John
 

Kermit2

Joined Feb 5, 2010
4,162
If someone else does the work...WHO? passes the course.

and you want it for free too?

:)

I guess it never hurts to ask, but judging by the number of responses you have received, I'm struck by the overwhelming chance that you won't understand a word of this diatribe.


Oh, won't someone explain it to me please?

Answer: "Do you want fries with that?"
 

Thread Starter

ratel

Joined Jan 30, 2011
8
I'm sorry for making you so angry guys. I didnt take the final exam because i have 3 exams on the same date and i had the chance to choose between taking a final project or doing a project so i took the project to benefit of the delay. I have 3 more projects that im working on now, related to Networking and Management. Digital Communication is an elective course for me. I don't want to fail the course or get a bad grade, i'm just asking for help or any motivation. I'm sorry again if i made anyone angry with my post.
 

magnet18

Joined Dec 22, 2010
1,227
Hi there ratel
i usually dont answer questions, i do more of the asking, but ive been round here long enough to tell you that you will not receive an answer on this thread

These guys don't do homework, especially not when presented by a panicked procrastinator.

If you want a useful answer, give it your best shot, if you run into problems at least spend an hour trying to fix/find them, and then calmly post about a specific question.

Under these circumstances, the guys on here will provide as much help as they can, and will probably point out other potential problems and their solutions

Under your circumstances, the more desperate you are, the less help you will get.

So give it a shot if you ever want to get it done.
 

Thread Starter

ratel

Joined Jan 30, 2011
8
magnet18 thanks a lot :) i'm working now on a project about routing algorithm, im spending the whole night on it, once i finish i'll start with QAM and i'll see if i would get any help later.
I'll work for the 16 upcoming hours and based on my work i'll ask for help.
Thanks again for everyone
 

thatoneguy

Joined Feb 19, 2009
6,359
Read the Wiki page on QAM if you are totally lost with the acronyms.

That page actually does a pretty good job of explaining things, enough to answer your question if you've got some idea of the basics (decibels, bit error rate, signal to noise, etc).
 

Thread Starter

ratel

Joined Jan 30, 2011
8
I finished my work, please guys let me know if i have any mistakes or give me notes if i can make it better before submitting it.
Thanks for everyone who helped me.
Bertus, Thank you for your precious resources :)

Here's the work:

1 – Generating bits stream

N = 8;
stream = randint(N,1);

2 – Modulating using 4-QAM

for n=1:2:N,
if (stream(n) == 0)
if(stream(n+1) == 0)
x = 1;
y = 1;
else
x = 1;
y = -1;
end
elseif (stream(n) == 1)
if(stream(n+1) == 0)
x = -1;
y = 1;
else
x = -1;
y = -1;
end
end
s = x * cos(2*pi*Fc*Tsym) + y * sin(2*pi*Fc*Tsym);
signal = [signal s];
end

3 – Adding white Gaussian noise

for k=1:1:N/2,
SNR_sample = -2.5 - 10*log10(Tb/Ts);
slot = signal((k-1)*samplesPS+1 : k*samplesPS);
r = awgn(slot,SNR_sample,'measured');
NoisySignal = [NoisySignal r];
end

4 – 4-QAM demodulation

Rx = zeros(1,N/2);
Ry = zeros(1,N/2);
for k=1:1:N/2,
NoisySlot = NoisySignal((k-1)*samplesPS+1 : k*samplesPS);
v = NoisySlot * sqrt(2/(2*Tb)) .* cos(2*pi*Fc*Tsym);
g = NoisySlot * sqrt(2/(2*Tb)) .* sin(2*pi*Fc*Tsym);
Rx(1,k) = sum(v); Ry(1,k) = sum(g);
end

d = zeros(1,4);

for k=1:1:N/2,
d(1,1) = (Rx(1,k)-10^6)^2 + (Ry(1,k)-10^6)^2;
d(1,2) = (Rx(1,k)-10^6)^2 + (Ry(1,k)+10^6)^2;
d(1,3) = (Rx(1,k)+10^6)^2 + (Ry(1,k)-10^6)^2;
d(1,4) = (Rx(1,k)+10^6)^2 + (Ry(1,k)+10^6)^2;
minDistance = min(d);
for i=1:1:4,
if(minDistance == d(1,i))
if(i==1) recvd = [recvd 0 0];
elseif(i==2) recvd = [recvd 0 1];
elseif(i==3) recvd = [recvd 1 0];
elseif(i==4) recvd = [recvd 1 1];
end
break;
end
end
end

5 - Calculating BER (bit error rate)

Errors = symerr(stream,recvd');
BER_Exp = Errors / N;
BER_Theory = 0.5 * erfc(sqrt(10.^(2*(-2.5)/10)));

Tested on 10000 bits, the experimental BER was 22.63% while the theoretical one was 21.32%. The values are close.
 

Thread Starter

ratel

Joined Jan 30, 2011
8
7 – Doppler Effect

We need now to simulation the communication in the presence of Doppler effect. The Doppler shift will be uniform in a certain range that we will calculate like this:
Fd = (Vsat * Fc) / (Ep * C);
Where Vsat is the speed of the satellite (7700 m/s), Fc is the carrier frequency (60 MHz), Ep is the atmosphere constant (0.1) and C (8 * 10^8 m/s) is the speed of light.

The following Matlab code will do the simulation:
close all
clear all

Rb = 10^5;
Fc = 600 * Rb;
Fs = 10 * Fc;
Tb = 1/Rb; Ts = 1/Fs;

Vsat = 7700;
Ep = 0.1;
C = 3 * 10^8;
Fd = (Vsat * Fc) / (Ep * C);

N = 1000;

SNR = [-10:10];
Errors = zeros(1,length(SNR));
ErrorsWD = zeros(1,length(SNR));

stream = randint(N,1);

T = 0:Ts:Tb;
samplesNb = size(T);
samplesNb = samplesNb(2);

Tsym = 0:Ts:2*Tb;
samplesPS = size(Tsym);
samplesPS = samplesPS(2);

bits = [];

for n=1:1:N,
if(stream(n) == 0) bit = zeros(1, samplesNb);
else bit = ones(1, samplesNb);
end
bits = [bits bit];
end
 

Thread Starter

ratel

Joined Jan 30, 2011
8
for counter=1:1:length(SNR),
signal = [];
for n=1:2:N,
if (stream(n) == 0)
if(stream(n+1) == 0)
x = 1;
y = 1;
else
x = 1;
y = -1;
end
elseif (stream(n) == 1)
if(stream(n+1) == 0)
x = -1;
y = 1;
else
x = -1;
y = -1;
end
end
s = x * cos(2*pi*Fc*Tsym) + y * sin(2*pi*Fc*Tsym);
signal = [signal s];
end

NoisySignal = [];
for k=1:1:N/2,
SNR_sample = SNR(counter) - 10*log10(Tb/Ts);
slot = signal((k-1)*samplesPS+1 : k*samplesPS);
r = awgn(slot,SNR_sample,'measured');
NoisySignal = [NoisySignal r];
end
 

Thread Starter

ratel

Joined Jan 30, 2011
8
Rx = zeros(1,N/2);
Ry = zeros(1,N/2);
for k=1:1:N/2,
NoisySlot = NoisySignal((k-1)*samplesPS+1 : k*samplesPS);
v = NoisySlot * sqrt(2/(2*Tb)) .* cos(2*pi*Fc*Tsym);
g = NoisySlot * sqrt(2/(2*Tb)) .* sin(2*pi*Fc*Tsym);
Rx(1,k) = sum(v); Ry(1,k) = sum(g);
end

d = zeros(1,4);
recvd = [];
for k=1:1:N/2,

d(1,1) = (Rx(1,k)-10^6)^2 + (Ry(1,k)-10^6)^2;
d(1,2) = (Rx(1,k)-10^6)^2 + (Ry(1,k)+10^6)^2;
d(1,3) = (Rx(1,k)+10^6)^2 + (Ry(1,k)-10^6)^2;
d(1,4) = (Rx(1,k)+10^6)^2 + (Ry(1,k)+10^6)^2;

minDistance = min(d);

for i=1:1:4,
if(minDistance == d(1,i))
if(i==1) recvd = [recvd 0 0];
elseif(i==2) recvd = [recvd 0 1];
elseif(i==3) recvd = [recvd 1 0];
elseif(i==4) recvd = [recvd 1 1];
end
break;
end
end
end

Errors(1,counter) = symerr(stream,recvd');
end

for counter=1:1:length(SNR),
signalWD = [];
for n=1:2:N,
miu = unifrnd(-Fd,Fd);
if (stream(n) == 0)
if(stream(n+1) == 0)
x = 1;
y = 1;
else
x = 1;
y = -1;
end
elseif (stream(n) == 1)
if(stream(n+1) == 0)
x = -1;
y = 1;
else
x = -1;
y = -1;
end
end
s = x * cos(2*pi*(Fc+miu)*Tsym) + y * sin(2*pi*(Fc+miu)*Tsym);
signalWD = [signalWD s];
end
 

Thread Starter

ratel

Joined Jan 30, 2011
8
NoisySignalWD = [];
for k=1:1:N/2,
SNR_sample = SNR(counter) - 10*log10(Tb/Ts);
slot = signalWD((k-1)*samplesPS+1 : k*samplesPS);
r = awgn(slot,SNR_sample,'measured');
NoisySignalWD = [NoisySignalWD r];
end

RxWD = zeros(1,N/2);
RyWD = zeros(1,N/2);
for k=1:1:N/2,
NoisySlot = NoisySignalWD((k-1)*samplesPS+1 : k*samplesPS);
v = NoisySlot * sqrt(2/(2*Tb)) .* cos(2*pi*Fc*Tsym);
g = NoisySlot * sqrt(2/(2*Tb)) .* sin(2*pi*Fc*Tsym);
RxWD(1,k) = sum(v); RyWD(1,k) = sum(g);
end

dWD = zeros(1,4);
recvdWD = [];
for k=1:1:N/2,

dWD(1,1) = (RxWD(1,k)-10^6)^2 + (RyWD(1,k)-10^6)^2;
dWD(1,2) = (RxWD(1,k)-10^6)^2 + (RyWD(1,k)+10^6)^2;
dWD(1,3) = (RxWD(1,k)+10^6)^2 + (RyWD(1,k)-10^6)^2;
dWD(1,4) = (RxWD(1,k)+10^6)^2 + (RyWD(1,k)+10^6)^2;

minDistance = min(dWD);

for i=1:1:4,
if(minDistance == dWD(1,i))
if(i==1) recvdWD = [recvdWD 0 0];
elseif(i==2) recvdWD = [recvdWD 0 1];
elseif(i==3) recvdWD = [recvdWD 1 0];
elseif(i==4) recvdWD = [recvdWD 1 1];
end
break;
end
end
end
ErrorsWD(1,counter) = symerr(stream,recvdWD');

end

BER_Exp = Errors / (N);
BER_ExpWD = ErrorsWD / (N);
 

magnet18

Joined Dec 22, 2010
1,227
Think you missed the part about a specific question, if theres an area you think is causing trouble, point it out

don't know bout these guys, but i sure wouldn't want to go through all that looking for general mistakes... but i don't now anything about matlab anyway
 
Top