Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Htlp me matlab code for performace of multihop with fixed relay

Status
Not open for further replies.

robintane

Junior Member level 1
Junior Member level 1
Joined
Nov 10, 2012
Messages
15
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,375
Help me matlab code for performace of multihop with fixed relay

I'm working to evaluate performace of multihop with fixed relay.

Source --> Relay1 --> Relay2 --> Relay3 ...--> RelayN --> Dest

I need matlab code for simulate this problem ( evaluate BER, Pout)
Please see this paper : https://pelopas.uop.gr/~nsagias/Files...04/C2_2004.pdf

Anybody can share me matlab code for this problem ?

Thank
you
 
Last edited:

Re: Help me matlab code for performace of multihop with fixed relay

What is the relaying mode of the relays?
 

Re: Help me matlab code for performace of multihop with fixed relay

Do you know how to do simulation for two hops?
 

Re: Help me matlab code for performace of multihop with fixed relay

Do you know how to do simulation for two hops?

Yes, I know
I can simulate BER for 1 hop, two hops, ...
But I don't know how to simulate Outage Probability for 1 hop , 2 hops .... Can you help me this problem
Can you talk with me via gmail chat : nguyenkimhieuha
 

Re: Help me matlab code for performace of multihop with fixed relay

Outage is defined as following: the instantaneous SNR drops below a certain threshold. So, you need two things: the instantaneous SNR and the threshold. The threshold is predetermined, say 0 dB. Now you need to find the instantaneous SNR, which in your case will be the equivalent SNR of all hops. I do not remember it, but in the literature you can find the formula of the equivalent SNR of a multihop relaying system in terms of the SNR of individual hops. So, now all you need to do is to generate the individual hops' SNRs. For example, in case of Rayleigh fading, the instantaneous per hop SNR is exponentially distributed. So, generate L (number of hops) exponential random variables, and substitute them in the equivalent SNR. Then compare the equivalent SNR with the threshold. Repeat this process for a number of iterations to get smooth curve. For example for the case of two hops I would write the following code

Code:
clear all;
clc;

SNRdB=0:20;
SNR=10.^(SNRdB./10);

N=10;%Number of outages to find at each SNR point
ythdB=0;% Threshold in dB
yth=10.^(ythdB./10);

Out1=zeros(length(SNR),1);
Count1=zeros(length(SNR),1);

Out2=zeros(length(SNR),1);
Count2=zeros(length(SNR),1);

for ii=1:length(SNR)
    while Out1(ii)<=N || Out2(ii)<=N
        Count1(ii)=Count1(ii)+1;
        Count2(ii)=Count2(ii)+1;
        
        y1=exprnd(SNR(ii),1,1);%SNR of the first hop
        y2=exprnd(SNR(ii),1,1);%SNR of the second hop
        y0=exprnd(SNR(ii),1,1);%SNR of the direct link

        yeq1=y0+(y1*y2/(y1+y2+1));%Equivalent SNR in the presence of direct link with MRC at D
        yeq2=(y1*y2/(y1+y2+1));% Equivalent SNR in the absence of direct link

        if yeq1<=yth
            Out1(ii)=Out1(ii)+1;
        end
        if yeq2<=yth
            Out2(ii)=Out2(ii)+1;
        end
    end
end
semilogy(SNRdB,Out1./Count1,SNRdB,Out2./Count2)
axis([0 20 10^-5 1])
legend('With Direct Link','Without Direct Link')
 

Re: Help me matlab code for performace of multihop with fixed relay

Outage is defined as following: the instantaneous SNR drops below a certain threshold. So, you need two things: the instantaneous SNR and the threshold. The threshold is predetermined, say 0 dB. Now you need to find the instantaneous SNR, which in your case will be the equivalent SNR of all hops. I do not remember it, but in the literature you can find the formula of the equivalent SNR of a multihop relaying system in terms of the SNR of individual hops. So, now all you need to do is to generate the individual hops' SNRs. For example, in case of Rayleigh fading, the instantaneous per hop SNR is exponentially distributed. So, generate L (number of hops) exponential random variables, and substitute them in the equivalent SNR. Then compare the equivalent SNR with the threshold. Repeat this process for a number of iterations to get smooth curve. For example for the case of two hops I would write the following code

Thank you for your guide. It is very detail.
You made a code for dual hop with cooperative relay.
I need simulate Outage probability with increase number of hop in multihop sytem without cooperative relay as this paper:

https://www.dropbox.com/s/kqciazqjg...SMISSION OVER LOGNORMAL SHADOWED CHANNELS.pdf

https://www.dropbox.com/s/05969insdrpovxg/Pout.JPG

Can you help me this problem
 

Re: Help me matlab code for performace of multihop with fixed relay

You have the equivalent SNR as in eq. 2. Just follow the same procedure as I did but for N hops. Generate N exponential random variables (if your channel is Rayleigh) as
Code:
y=exprnd(SNR(ii),N,1)
and then compute (2). It is straightforward.
 

Re: Help me matlab code for performace of multihop with fixed relay

Outage is defined as following: the instantaneous SNR drops below a certain threshold. So, you need two things: the instantaneous SNR and the threshold. The threshold is predetermined, say 0 dB. Now you need to find the instantaneous SNR, which in your case will be the equivalent SNR of all hops. I do not remember it, but in the literature you can find the formula of the equivalent SNR of a multihop relaying system in terms of the SNR of individual hops. So, now all you need to do is to generate the individual hops' SNRs. For example, in case of Rayleigh fading, the instantaneous per hop SNR is exponentially distributed. So, generate L (number of hops) exponential random variables, and substitute them in the equivalent SNR. Then compare the equivalent SNR with the threshold. Repeat this process for a number of iterations to get smooth curve. For example for the case of two hops I would write the following code

Code:
clear all;
clc;

SNRdB=0:20;
SNR=10.^(SNRdB./10);

N=10;%Number of outages to find at each SNR point
ythdB=0;% Threshold in dB
yth=10.^(ythdB./10);

Out1=zeros(length(SNR),1);
Count1=zeros(length(SNR),1);

Out2=zeros(length(SNR),1);
Count2=zeros(length(SNR),1);

for ii=1:length(SNR)
    while Out1(ii)<=N || Out2(ii)<=N
        Count1(ii)=Count1(ii)+1;
        Count2(ii)=Count2(ii)+1;
        
        y1=exprnd(SNR(ii),1,1);%SNR of the first hop
        y2=exprnd(SNR(ii),1,1);%SNR of the second hop
        y0=exprnd(SNR(ii),1,1);%SNR of the direct link

        yeq1=y0+(y1*y2/(y1+y2+1));%Equivalent SNR in the presence of direct link with MRC at D
        yeq2=(y1*y2/(y1+y2+1));% Equivalent SNR in the absence of direct link

        if yeq1<=yth
            Out1(ii)=Out1(ii)+1;
        end
        if yeq2<=yth
            Out2(ii)=Out2(ii)+1;
        end
    end
end
semilogy(SNRdB,Out1./Count1,SNRdB,Out2./Count2)
axis([0 20 10^-5 1])
legend('With Direct Link','Without Direct Link')

Hi David, Why curve is not smooth ? incisor
https://www.dropbox.com/s/gh5qpp55mrzxb5l/Pout2hop.jpg
 

Dear David
Thank you for your guide
I simulated BER for multihop without cooperative relay, but with cooperative relay for dual hop , I can't simulate it.

I need simulate BER for multihop with cooperative relay. With this case, when increase number of Relay (as photo), BER at destination will decrease.
Please help me code this problem.

Model and figure as below:
https://www.dropbox.com/s/31hbuofm5vym89g/BER dualhop cooperative.JPG
 

Usually, if you you have multiple relays in series, it is called multihop. If you have relays in parallel it is called multi-branch dual hop system. Just to set the terminology.

Do you know the math behind the curves? What kind of receiver was used? MRC or selection combining (SC)? If you know the mathematical equations, having the example I provided, it is easy to do.

I prefer to write down your own code, and discuss it, instead of asking me to "help you", expecting me to give you the code ready.
 

Usually, if you you have multiple relays in series, it is called multihop. If you have relays in parallel it is called multi-branch dual hop system. Just to set the terminology.

Do you know the math behind the curves? What kind of receiver was used? MRC or selection combining (SC)? If you know the mathematical equations, having the example I provided, it is easy to do.

I prefer to write down your own code, and discuss it, instead of asking me to "help you", expecting me to give you the code ready.

Thank David
I need simulate BER for collaborative dual-hop transmissions using maximal-ratio-combining (MRC) diversity in the destination.
The simulation result show that when have a Relay, BER will be better that direct communication. When increase number of relay, BER will decrease

as this paper : **broken link removed**
Simulation result shown in Figure 2 in this article.
 

You have the equivalent SNR as in (1). You just have the summation that is different than the one relay case. All you have to do is to generate different independent equivalent SNR per relay as in the code I gave you, and sum them up with the SNR of the direct link to get the overall equivalent SNR. It is straightforward.
 

You have the equivalent SNR as in (1). You just have the summation that is different than the one relay case. All you have to do is to generate different independent equivalent SNR per relay as in the code I gave you, and sum them up with the SNR of the direct link to get the overall equivalent SNR. It is straightforward.

About BER? I had BER for each branch ? How calculate BER at the destination, Graph BER vs overall SNR ?

- - - Updated - - -

Hi David, Please give me code
 
Last edited:

hi Robin,
please can you help me to add a second level in a wsn in order to obtain 2 levels in the intercluster communication .
pleeease I need your help as soon as possible.
thx a lot.
 

Re: Help me matlab code for performace of multihop with fixed relay

Yes, I know
I can simulate BER for 1 hop, two hops, ...
But I don't know how to simulate Outage Probability for 1 hop , 2 hops .... Can you help me this problem
Can you talk with me via gmail chat : nguyenkimhieuha

Hi can you help me to simulate BER for 1 hop and two hop
thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top