Code covered by the BSD License  

Highlights from
Turbo Code


4.3 | 8 ratings Rate this file 119 Downloads (last 30 days) File Size: 10.4 KB File ID: #39423
image thumbnail

Turbo Code



11 Dec 2012 (Updated )

Encoding: RSC, Decoding: BCJR

| Watch this File

File Information

Modulation: BPSK
Channel: AWGN
Encoder: G(D)=[1,(1+D+D^2)/(1+D^2)]

Required Products Communications System Toolbox
MATLAB release MATLAB 8.1 (R2013a)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (53)
25 Nov 2014 Yogesh K Soniwal

C0 is same as P0, and C1 is same as P1. Maybe the notation is a bit confusing.

24 Nov 2014 Muhammad MAZHAR

thanks a lot..
one small quastion,,in your code of encoder u r calculating in loop C0 and C1 and with this C0 and C1 you are calculating Po ans P1..its clear..but at which stage of Encoder diagram you r calculating co and c1?this is not so clear for me--i mean after feedback value and input or where ?
can u plz clear it..i will be thankful t u.

21 Nov 2014 Yogesh K Soniwal

Please refer

17 Nov 2014 Muhammad MAZHAR

thanks Yogesh..i habe read this paper..its good..but can u tell me from which BOOK you have used this formula...i mean Reference of Book or any paper..
and how u demodelate your singal,because R0,R1 R2 are demodulated...'?

14 Nov 2014 Yogesh K Soniwal

Hi Muhammad

Please refer to

for formulae of alpha, beta and gamma

11 Nov 2014 Kondakov  
05 Nov 2014 Muhammad MAZHAR


i have seen ur code and also paper,i hava quastion how u demodelate your singal,because R0,R1 R2 are demodulated but which formula are u using?

and the formula for calculating gamma?where did u got this i mean can u share any reference file.thanks in advance.

03 Jul 2014 Sanchis

Hi Yogesh,

your code is very well!! But there is a thing that I don't understand and it is: I don't understand as you encode P1 and P0. I have readed the description in page 2 and 3 of your paper, but I don't understand, Could you explain me it? And as you implements it in the code?

Thanks you.

01 May 2014 Yogesh K Soniwal

Hi Long
I have not checked if there is any difference in the performance if we use extrinsic information.
If you want to use extrinsic information, just substract the intrinsic term given on page 4 of
from aposteriori information.

15 Apr 2014 popeye

Hi Yogesh,

As from your code, the information you exchanged between two decoders is the a-posteriori information not extrinsic information as in theory. Is there any difference in the performance ? If I want to use extrinsic information in this case, how I can ? Thanks.

27 Mar 2014 Yogesh K Soniwal

Hi Tongyang
In BCJR decoder we exclude the intrinsic information and pass the aposteriori probability from one decoder to another for subsequent detection

13 Mar 2014 tongyang

from your PDF report, you mentioned that only extrinsic information is exchanged between two BCJR decoders. However, in your MATLAB code, I think the exchanged information is the a-posteriori information. Is it correct? Thanks.

12 Mar 2014 Yogesh K Soniwal


05 Mar 2014 mary

hi.. is the used interleaver a random permutation interleaver?

17 Feb 2014 Filip

Yogesh, you should divide the SNR by 3 because the SNR is defined with respect to the energy per information bit (Eb), and not per coded bit (Es). This code has a rate of 1/3, right? Therefore, you need to consider the code rate when you corrupt the signal by noise.
Eb/No=(1/rate)*Es/No = (1/rate)*(mu^2)/(2*sigma^2)

15 Feb 2014 Yogesh K Soniwal

Hi Filip
I don't think there is any problem in scaling. Why would you divide the SNR in all 3 bits?

13 Feb 2014 Filip

One little correction ,should be 2*1/3*SNR, I forgot the factor 2.

13 Feb 2014 Filip

Hey Yogesh. Are you sure the SNR scaling is correct in the turbo.m file? You assume a certain SNR, but you apply the same value to R0, R1 and R2, which is incorrect because you have not considered the code rate. The correct thing would be the following: instead


you should have written


because your code rate is 1/3.
By doing as you did the corruption is very less and your output BER is smaller.

26 Jan 2014 devina etwara

Hi Yogesh.. i have an something to ask. actually whenever i'm increasing the snr gap, that is i'm changing it to 0.2 interval.. i am getting peaks .. like the graphs is shooting up and then coming down.. i wanted to know that is normal behaviour of turbo codes... i am getting little confused and even getting stressed as i am using your code as my base start for my dissertation .. please do lemme know about it.. please i am hope to hear from you soon

06 Jan 2014 wang jack  
05 Dec 2013 mary

hi yogesh,
let's suppose that i have value "A"
I want to multiply the encoded data by it and than add noise then dividing the result by the same value then decode the resulting data:
suppose my data is X , and nose is N;
I want to do the following

then add noise ss=s+N
then the data that will be decoded=ss./A

can you do that to your code??

11 Nov 2013 Yogesh K Soniwal

Hi Jang,
Please refer to page No. 5 for alpha and page No. 9 for (j+2) in this link

11 Nov 2013 jang

I do not know how the alpha is defined.
Also, j +2, why are you used?

24 Oct 2013 Yogesh K Soniwal

Download all the codes in one directory then run turbo.m

24 Oct 2013 sravya

Error in turbo (line 43)
dlg = ProgressDialog();
i got this error when i simulated it please help me in this.. thanq...

18 Sep 2013 ANAND

hello sir...
am doing project in increasing energy efficiency using turbo code.... i calculated Eb value for BPSK modulation... have to substitute the Eb value in turbo code.... how can i do it....
plz give me your ans to my mail id:

17 Sep 2013 Yogesh K Soniwal

The interleaver used in this code is random (line no. 4 of turbo.m) .. replace your designed interleaver with this one.

17 Sep 2013 mustafa

your work is really perfect and i am concerned with the interleaver how can i replace the existing interleaver by my designed interleaver?

31 Jul 2013 vahid

hi tank u for ur code.the decoder depends on the snr but in reallity we dont know the snr how can we implement this code ?

03 Jul 2013 triet ho

why only has 3rd iteration? i saw picture has 4th iteration? can you update iteration higher? tks so much. can you send your updated code to my email: tks you.

28 Jun 2013 Yogesh K Soniwal

You can refer to code provided on this link for 16-QAM

25 Jun 2013 DUJIN KWON

If I want to modify your program by using 16qam modulation instead of BPSK can you help me with that?

13 Jun 2013 Yogesh K Soniwal

no..performance for QPSK and BPSK will be different

12 Jun 2013 mary

will the performance be better when using QPSK modulation?? or it will be the same as when using BPSK?

12 Jun 2013 mary

Do you have a matlab code of it ? Can you do it for me please?

12 Jun 2013 Yogesh K Soniwal

You have to transmit 2 bits for each symbol. And decode each of them individually. Refer to the QPSK simulation code.

11 Jun 2013 mary

If I want to modify your program by using QPSK modulation instead of BPSK can you help me with that?

11 Jun 2013 Yogesh K Soniwal

Yes, the modulation used is BPSK.

10 Jun 2013 mary

another question i have >> the modulating you are using is BPSK right???

10 Jun 2013 mary  
10 Jun 2013 mary

i mean can we make the first RSC encoder of rate 2/3 ?? so according to this the second encoder will also be of rate 2/3

09 Jun 2013 Yogesh K Soniwal

no..we are using the same bits permuted for the second RSC encoder, so we can't make this code rate 2/3.

09 Jun 2013 mary

So it means that to make it of rate 2/3 we should use two bits as an input to RSC encoders right? Is it possible with BCJR decoding?

09 Jun 2013 Yogesh K Soniwal

There are two encoders. Information bits are coded using convolution code for the first encoder and their permutation is coded using convolution code for the second encoder, but only one bit is used for second encoder. So RSC encoder is rate 1/3.

08 Jun 2013 mary

okay and what about the bit rate of the RSC encoders??

05 Jun 2013 mary

okay thank you

15 May 2013 Yogesh K Soniwal

Hi mary,
this is rate 1/3 code..

15 May 2013 mary

what is the bit rate of this encoder please??

05 May 2013 saikiran

Hi, In the code when we increase block length the performance of the code should be increased in ber wise. But it is not the case happening?

29 Apr 2013 mary

or it is of 8 states?

29 Apr 2013 mary

okay it ran thank you

well this code is of 4 states trellis could you make it of 8 states ??

28 Apr 2013 Yogesh K Soniwal

You have not downloaded 'parity_bit' function which is used by turbo.m . That's why this error is coming. Download all the other functions (alpha_1, beta_1,gamma_1, parity_bit, lappr) and then run turbo.m

28 Apr 2013 mary

when i ran it using matlab 2012 an error occured
"Undefined function 'parity_bit' for input arguments of type
'double'." what do i do?

30 Jul 2013

Iterations increased for better performance

17 Oct 2013

Encoding not done iteratively, used convolution for encoding

22 Oct 2013

Fixed Error in UI

31 Oct 2014

Submitted as a toolbox

Contact us