Thisscriptsimulatestheclassicalturboe
codi
gdecodi
gsystemr
Itsimulatesparallelco
cate
atedco
volutio
alcodesr
Twocompo
e
trate12RSCRecursiveSystematicCo
volutio
alcompo
e
te
codersareassumedr
Firste
coderistermi
atedwithtailsbitsI
fotailbitsarescrambleda
dpassedtor
theseco
de
coderwhileseco
de
coderisleftope
withouttailbitsofitselfr
r
Ra
domi
formatio
bitsaremodulatedi
to11a
dtra
smittedthroughaAWGNcha
elr
I
terleaversarera
domlyge
eratedforeachframer
r
LogMAPalgorithmwithoutqua
tizatio
orapproximatio
isusedr
Bymaki
guseofl
exeymaxxyl
1eabsxyr
theLogMAPca
besimplifiedwithalookuptableforthecorrectio
fu
ctio
r
Ifuseapproximatio
l
exeymaxxyitbecomesMAXLogMAPr
r
CopyrightNov1998YufeiWur
MPRGlabVirgi
iaTechr
foracademicuseo
lyr
r
clearallr
r
Writedisplaymessagestoatextfiler
diaryturbo_logmaptxtr
r
Choosedecodi
galgorithmr
dec_algi
putPleasee
terthedecodi
galgorithm0LogMAP1SOVAdefault0r
ifisemptydec_algr
dec_alg0r
e
dr
r
Framesizer
L_totali
putPleasee
tertheframesizei
fotaildefault400r
ifisemptyL_totalr
L_total300ti
fomatio
bitsplustailbitsr
e
dr
r
Codege
eratorr
gi
putPleasee
tercodege
eratordefaultg111101r
ifisemptygr
g111r
101r
e
dr
g11011111r
g1111110001r
r
Ksizegr
mK1r
states2mr
r
pu
cture0pu
cturi
gi
torate12r
pu
cture1
opu
cturi
gr
pu
cturei
putPleasechoosepu
cturedu
pu
ctured01default0r
ifisemptypu
cturer
pu
cture0r
e
dr
r
Coderater
rate12pu
cturer
r
Fadi
gamplitudea1i
AWGNcha
elr
a1r
r
Numberofiteratio
sr
iteri
putPleasee
ter
umberofiteratio
sforeachframedefault5r
ifisempty
iterr
iter5r
e
dr
Numberofframeerrorstocou
tasastopcriteriorr
ferrlimi
putPleasee
ter
umberofframeerrorstotermi
atedefault15r
ifisemptyferrlimr
ferrlim15r
e
dr
r
EbN0dbi
putPleasee
terEbN0i
dBdefault20r
ifisemptyEbN0dbr
EbN0db20r
e
dr
r
fpri
tf
r
ifdec_alg0r
fpri
tfLogMAPdecoder
r
elser
fpri
tfSOVAdecoder
r
e
dr
fpri
tfFramesize6d
L_totalr
fpri
tfcodege
erator
r
fori1
r
forj1Kr
fpri
tf6dgijr
e
dr
fpri
tf
r
e
dr
ifpu
cture0r
fpri
tfPu
cturedcoderate12
r
elser
fpri
tfU
pu
cturedcoderate13
r
e
dr
fpri
tfiteratio
umber6d
iterr
fpri
tftermi
ateframeerrors6d
ferrlimr
fpri
tfEbr