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.

Coded cooperation in wireless netwrok

Status
Not open for further replies.

fairul

Newbie level 4
Joined
Mar 26, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,327
matlab code for rcpc code

I'm beginner in Matlab , i already have a matlab code for coded cooperation slow Rayleigh fading but i need to run it in another condition. Some one please help me to do editing to my matlab code . I want to change it from slow fading to a fast fading. Here i attach my matlab code. Regards.
 

rcpc code with matlab

Change the following lines
Code:
% For Slow Fading, Channel coefficients are the same over block transmission;
h_10  = sqrt(1 / 2) * abs(randn + j * randn) * ones(1, N);
h_20  = sqrt(1 / 2) * abs(randn + j * randn) * ones(1, N);

into

Code:
% For Fast Fading, Channel coefficients changes from one symbol to the other
h_10  = sqrt(1 / 2) * abs(randn(1, N) + j * randn(1, N));
h_20  = sqrt(1 / 2) * abs(randn(1, N) + j * randn(1, N));

Regards
 

coded cooperation

Thank you very much
 

coded cooperation in matlab

Hi apprentice,

As U all know small scale fading (based on Doppler spread) is divided in to
1.Slow Fading
2.fast fading

for fast fading, there is high doppler spread , channel variations are ofcourse faster than signal variations, coherance time < symbol period

In the Matlab code, they have simulted for slow fading (which has got lower doppler spread , coherance time > symbol period , channel variations are slower than signal variations )

What about doppler spread inclusion???? (it is not included in the Matlab code for both slow & fast fading)
 

The way we are simulating slow fading and fast fading is idealistic. In the slow fading case, we assume that the fading coefficient is *constant* over the codeword and it changes independently from one codeword to the other. While in the fast fading case we assume that the fading coefficient changes from one *symbol* to the other, so even two consecutive symbols would see independent fading coefficient. This paradigm is good for conceptual understanding.
If you want to make it more realistic, you can use a code similar to this:

Code:
InputSamplePeriod = 1/100000;
MaxDopplerShift = 130;
PathDelays = [0 1.5e-5 3.2e-5];
AvgPathGaindB = [0, -3, -3];

channel = rayleighchan(InputSamplePeriod , MaxDopplerShift, PathDelays, AvgPathGaindB);
symbols_with_fading=filter(channel,transmitted_symbols);

The values of InputSamplePeriod and MaxDopplerShift determines whether the fading is fast or slow. So, you should choose those values carefully.
 

Hi apprentice,
u wrote:
The values of InputSamplePeriod and MaxDopplerShift determines whether the fading is fast or slow. So, you should choose those values carefully.

can u specify what values should be the i/psample period value for slow fading
what about symbol period???

ofcourse maxdopplershift is much low...

can u specify the link or post the code for both slow fading and fast fading if you don't mind..

thank you

Added after 5 minutes:

can u specify the book or link so that it gives the clear understanding of coding the fading effects (small scale fading based on multipath delay spread 1. flat fading 2. freq selective fading... small scale fading based on doppler spread 1. slow fading 2. fast fading)

for theory i follow wireless comm by rappaport...

can u suggest some useful lik so that i by myself do coding ....simulating all the fading types ...
 

ramya ravi, if you have Matlab 7.5 or above, just go to Matlab help and search fading channels and go through the help file, you'll understand how to simulate all types of fading. Tell me if you are stuck on something
 

Thank you ... Communication_engineer but i am using Matlab7 ... ok let me try to get matlab v7.5
 

Dear apprentice,

after i changed the matlab code from slow fading →fast fading ,
the result from the simulation as shown in file attached.
Do i need to do another additional editing to matlab code for a good simulation result?
Best regards.
 

hello
i am doing my rpoject on cooperative communication and i have to write a code for coded cooperation protocol . does the above given code works and which error correcting technique is used in it .. if someone can help me out with it i ll be grateful
 

fairul said:
Dear apprentice,

after i changed the matlab code from slow fading →fast fading ,
the result from the simulation as shown in file attached.
Do i need to do another additional editing to matlab code for a good simulation result?
Best regards.



Last edited by fairul on 08 Apr 2009 7:27; edited 1 time in total


And Torres has left the post, removed
 

I have made the modification from slow to fast as I mentioned above and I compared the results. See the attached plot.
In the fast fading case, the performance is better than the slow fading case. Is this something expected?
 

hello fairul .. the code which you have given is showing undefined function error for the function crc16 so can you tell me how to overcome that problem ill be grateful to you
 

Taksali,
CRC16 functions is not a standard function in matlab, and that's why you get an "undefined function" error from MATLAB. However, If you use the attached file "CRC16.M", you will get over this issue. You should put this file in the same directory of the m-file that contains that code that you want to run. This way, MATLAB will be able to call the CRC16 function with no problems.

Regards
 

ya this problem is solved but i m getting problems in convenc (msg,trellis,punture). it is telling that initial values must be between zero and trellis. something so plz tell be what changes should i make ..

Added after 39 minutes:

what is trellis actually?
 

Taksali,
The matlab version you are using does not support the convenc in the way it is used in the code. The m-code you have intends to call convenc in this mode:
code = convenc(msg,trellis,puncpat)

whereas your version of MALTAB tries to interpret it as:
code = convenc(msg,trellis,initstate)

i.e it mistakes the the puncturing pattern for the initial state and that's why you get the folloing error:
"the initial state must be a integer scalar between 0 and (trellis.numstates-1)."

So, you either try to run the code with a newer version ofMATLAB ( 7.3.0.267 (R2006b) or later) OR you do puncturing by yourself with some additional code.
I need to check a couple of things then, I will try to post some hints on how to do it.

Regards
 

thanks . for replying.. but i dont have the latest version of matlab so can you tell me how to change my code so that i can overcome the prob ..
 

Taksali,
I figured it out. You need to make two modifications:

First,
Replace this command:
Code:
RCPC = convenc(msg, trellis, puncture);
with those lines:
Code:
RCPC = convenc(msg, trellis);
RCPC(4:4:end) = [];

Second,
Replace this command:
Code:
punc_bit = convenc(msg, trellis, complement_puncture);
with the following lines:
Code:
punc_bit = convenc(msg, trellis);
punc_bit = punc_bit(4:4:end);

This should get your code working.

Regards
 

thanks a lot apprentice..i am thankful to u .. but i have got the newversion which i installed jst nw nd run the code ..from last half n hour its calculating sm values .. nd showing busy .. dnt know y..

Added after 17 minutes:

"Unable to read file noCooperation: No such file or directory".
now am getting this error what to do plz tell me
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top