Demonstration For Implementation of Basic Operational Blocks Related To Viterbi Algorithm in Software by Using VB NET Programming Language
Demonstration For Implementation of Basic Operational Blocks Related To Viterbi Algorithm in Software by Using VB NET Programming Language
net/publication/344403474
CITATIONS READS
0 9
1 author:
Thobius Joseph
2 PUBLICATIONS 1 CITATION
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Thobius Joseph on 28 September 2020.
Abstract— this study aimed to provide source code and knowledge’s on how to implement operational blocks found in ordinary Viterbi
algorithm through high level programming languages. In high level programming languages paradigms a VB.NET programming language
IJSER
fall under event programming languages and this study provides easy features for coding Viterbi algorithm operational blocks. The study
methodology involved generating randomly bits pattern and mark them on sheet of paper and computing corresponding outputs
mathematically by using theory described in literature which clarifying viterbi operational blocks. The trial and error technique were used to
migrate the formulas into a block of codes, then the generated bits patterns were passed as inputs to the blocks of codes through
textboxes controls to compare the obtained results. The results of this study indicate that same results were obtained by using either
mathematical tactic or code implemented by the study.
Index Terms— Convolutional Codes, Software Programming, Trellis Diagram, VB.NET, Viterbi Algorithm
—————————— ——————————
1 INTRODUCTION
1.1 Background
IJSER
trellis diagrams have being used to explain VA decoder [33]. by compare path metrics for each state and store one with ei-
Consider a convolutional encoder of structure (2, 1, 2) with (7, ther lower or highest value, also its transition is selected as
5) generator polynomials P0 and P1 [33], generator representa- survivor path. Traceback unit first adds tail bits to refresh de-
tion is given in Fig. 2. coder to a zero state position then, stored path metric are used
to recover transmitted data, the process starts from trellis end
towards the first stage of the trellis.
Po= x[n]+x[n-1]+x[n-2]
(1010011)
U= (11101)
Output =
(11011001001011)
P1= x[n]+x[n-1]
(1010011)
IJSER © 2020
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 11, Issue 9, September-2020 1015
ISSN 2229-5518
term VB.NET arises, in order to distinguish classical VB such 2 DESIGN AND IMPLEMENTATION OF VITERBI ALGORIHTM
as VB2 and VB3 from those released from 2002 like VB10 and IN VISUAL BASIC PROGRAMMING LANGUAGE
visual basic 2015 ([21], [22]).
Visual Basic with Networks Enhanced Technology 2.1 Experimental Settings
(VB.NET) provides easy programming syntax and it is object –
Visual Studio 2010 Ultimate was used as Integrated Develop-
oriented programming language ([9]). The language has been
ment Environment (IDE). The (2, 1, 2) convolutional encoder
implemented in many studies for creating simulations due to
from Fig. 2 will be used for elaboration. For convolutional and
the fact it’s a proprietary language for well-known windows
Viterbi decoder, bits are process serially and continuoulys but
based Operating Systems (OS) and therefore, it provides a
in this study 24-bits’ pattern were generated randomly and
quickly and easy way of developing more powerful windows
inserted into developed software encoder to generate output.
programs ([10], [11], [12], [13], [14], [15]). Additional advanta-
About 256 pattern of 24 bit length were tested, few are given
geous of VB.NET of other high-level programming languages
in Table 1. From obtained output some bits were inversed to
comes from its features of automatically memory management
justifying errors may be introduced due to communication
and intellisense ([16], [17], [18]).
channel impairments. Mathematically for 24 bits input in en-
1.4 Problem Statement coder of ½ code rate the corresponding output will be 48 bits
Viterbi Algorithm has been employed in many applications length. Viterbi decoder assumes metric is hamming distance
includes satellite communication, image recognition tech- between the received pair of bits and the output bits for each
niques, speech recognitions techniques and 5G mobile com- state.
munications ([23], [24], [25], [26]). This powerful algorithm has TABLE 1
been explored by several studied but in hardware level lan- RANDOMLY GENERATED 24 BITS’ PATTERN
guages such as Very High-speed integrated circuit hardware
Description Language (VHDL) for Field Programmable Gate 24 bits’ encoder 48 bits’ encoder X flipped bits
IJSER
Arrays ([27], [28], [29],[30]) and Very Large-Scale Integration Input Output denoted by line
(VLSI) [31]. The exploration in hardware level is complex and
increases difficultness for non-electronics scholar to exploit its
0000000000 000000000000 000000000000
powerful functionality. Numerous aptitude technologist un-
00100000100 000000000000 000000000000
derstanding in easy when concepts are in high level pro-
111011000000 111010000000
gramming languages than complex low-level hardware relat-
111011111011 111011111011
ed programming languages.
In Malaysian VB.NET programming language has become 000100100 000000111011 001000111011
one of compulsory course in computer technology, hence it 000100100 111011000000 111111000000
favored by major of technologists in their country [9]. In addi- 000100
tion, this study has conducted a survey for 10 Universities in
111011111011 111011111011
Tanzania to find preferred Operating System (OS) among 000000111011 000000111011
scholars and it was observed that about 95% of students own 100100000 111011111011 111011011011
computers are using windows-based OS. In [32] windows OSs 100000000
are still dominant in the market, hence then, a program devel- 000000111011 000000110011
100100
oped in VB.NET language would result in efficient and adapt- 000000000000 000010000000
ableness can be in large scale. 111011111011 111011011011
Therefore, this study comes up with source code and elabo-
rative knowledge’s of how to implement Viterbi Algorithm in The flipped bits act as bit inversion occurred due to medium noises. The
VB.NET high level programming language. The usage of patterns were successfully recovered by presented VA code in this paper
VB.NET will enable even less experienced programmers to
easy understand the source code due to its simple syntax. In 2.2 Code for Convolutional Encoder
addition, when the concepts would become clearly, more in-
The textbox control was used as place to enter randomly gen-
put would be provided into the Software- Defined Radio field.
erated bits pattern, its name TxtInput. The following code
1.5 Paper Organization should be under button for performing encode task.
The remainder of the paper is organized as follows, Section 2 '' left most is the first signafance bit, encode start fron
explain design and implementation of VA in VB.net pro- MSB, temp will hold input from TxtInput
gramming language, also explain study settings. Section 3 Dim temp As String
provides conclusion and future work, finally section 5 gives Try
acknowledgement. temp = TxtInput.text
'' Declare codewords C1, C2 and total output c of the en-
coder
Dim c1, c2, c As String
For i As Integer = 0 To temp.Length - 3 Step 1
' Extract single bit from temp bits array.
IJSER © 2020
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 11, Issue 9, September-2020 1016
ISSN 2229-5518
IJSER
For i As Int16 = 0 To 0
PathTable(0, 2) = PathTable(0, 1) + (1 - In-
Str(st_relst(0)(i), stri_receiver(2)) + (1 - InStr(st_relst(0)(i + 1),
stri_receiver(3))))
Pred_Succe_Table(0, 2) = 0
' calculate branch metric
PathTable(2, 2) = PathTable(0, 1) + (1 - In-
Str(st_relst(1)(i), stri_receiver(2)) + (1 - InStr(st_relst(1)(i + 1),
stri_receiver(3))))
Pred_Succe_Table(2, 2) = 0
PathTable(1, 2) = PathTable(2, 1) + (1 - In-
Str(st_relst(4)(i), stri_receiver(2)) + (1 - InStr(st_relst(4)(i + 1),
stri_receiver(3))))
Pred_Succe_Table(1, 2) = 2
PathTable(3, 2) = PathTable(2, 1) + (1 - In-
Fig.5. Legend Trellis diagram of VA for corresponding (2, 1, 2) convolu- Str(st_relst(5)(i), stri_receiver(2)) + (1 - InStr(st_relst(5)(i + 1),
tional code stri_receiver(3))))
From the diagram there are 8 possible outputs. The outputs Pred_Succe_Table(3, 2) = 2
will be hold in state array.
'Declare the possible output array for each state and ep= temp Next
pm=emission prob= bm + pm, bm = branch metric, pm path ' Show path taken
metric MessageBox.Show (PathTable(0, 2).ToString + " " +
Dim st_relst(0 To 7) As String PathTable(1, 2).ToString + " " + PathTable(2, 2).ToString + " "
For i As Int16 = 0 To 0 + PathTable(3, 2).ToString)
st_relst(0) = "00"
st_relst(1) = "11" 2.4 Code for Path Metric Calculation
st_relst(2) = "11" The path metric is calculated when trellis is start to repeate
st_relst(3) = "00" itself. The trellis will start to repeate when transition is at third
st_relst(4) = "10" level (t=2).
st_relst(5) = "01" '''' enters in the stable state where the graphy is repeating
st_relst(6) = "01" Dim temp1, temp2 As Int16
st_relst(7) = "10" Dim indexupdate As Int16 = 0
Next '' for state 0, each state two transisitions are compared
Additional two zero bits are added as flush bits, which will For j As Int16 = 2 To 6
make corresponding trellis to have26 transitions. The next step
is to generate a trellis matrix with four nodes and 26 transi-
IJSER © 2020
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 11, Issue 9, September-2020 1017
ISSN 2229-5518
For i As Int16 = 0 To 0
temp1 = PathTable(0, j) + (1 - InStr(st_relst(0)(i), '' for state 3
stri_receiver(j + 2 + indexupdate)) + (1 - InStr(st_relst(0)(i + 1), For i As Int16 = 0 To 0
stri_receiver(j + 3 + indexupdate)))) temp1 = PathTable(2, j) + (1 - InStr(st_relst(6)(i),
stri_receiver(j + 2 + indexupdate)) + (1 - InStr(st_relst(6)(i + 1),
stri_receiver(j + 3 + indexupdate))))
temp2 = PathTable(1, j) + (1 - InStr(st_relst(2)(i), temp2 = PathTable(3, j) + (1 - InStr(st_relst(7)(i),
stri_receiver(j + 2 + indexupdate)) + (1 - InStr(st_relst(2)(i + 1), stri_receiver(j + 2 + indexupdate)) + (1 - InStr(st_relst(7)(i + 1),
stri_receiver(j + 3 + indexupdate)))) stri_receiver(j + 3 + indexupdate))))
Next
Next If temp1 > temp2 Then
PathTable(3, j + 1) = temp2
If temp1 > temp2 Then Pred_Succe_Table(3, j + 1) = 3
PathTable(0, j + 1) = temp2 Else
Pred_Succe_Table(0, j + 1) = 1
Else PathTable(3, j + 1) = temp1
Pred_Succe_Table(3, j + 1) = 2
PathTable(0, j + 1) = temp1 End If
Pred_Succe_Table(0, j + 1) = 0 indexupdate = indexupdate + 1
End If ' Show path that was taken
MessageBox.Show(PathTable(0, j + 1).ToString) 'Show MessageBox.Show(PathTable(0, j + 1).ToString + " " +
path taken PathTable(1, j + 1).ToString + " " + PathTable(2, j + 1).ToString
'''' for state 1 + " " + PathTable(3, j + 1).ToString)
IJSER
For i As Int16 = 0 To 0 Next
temp1 = PathTable(2, j) + (1 - InStr(st_relst(4)(i), ''''' terminating the trellis by flush bits, only 0 transition
stri_receiver(j + 2 + indexupdate)) + (1 - InStr(st_relst(4)(i + 1), are considered here
stri_receiver(j + 3 + indexupdate)))) For ji As Int16 = 7 To 8
temp2 = PathTable(3, j) + (1 - InStr(st_relst(6)(i), If ji = 7 Then
stri_receiver(j + 2 + indexupdate)) + (1 - InStr(st_relst(6)(i + 1), For i As Int16 = 0 To 0
stri_receiver(j + 3 + indexupdate)))) temp1 = PathTable(0, ji) + (1 - InStr(st_relst(0)(i),
stri_receiver(ji + 3)) + (1 - InStr(st_relst(0)(i + 1), stri_receiver(ji
Next + 4))))
If temp1 > temp2 Then temp2 = PathTable(1, ji) + (1 - InStr(st_relst(2)(i),
PathTable(1, j + 1) = temp2 stri_receiver(ji + 3)) + (1 - InStr(st_relst(2)(i + 1), stri_receiver(ji
Pred_Succe_Table(1, j + 1) = 3 + 4))))
Else Next
If temp1 > temp2 Then
PathTable(1, j + 1) = temp1 PathTable(0, ji + 1) = temp2
Pred_Succe_Table(1, j + 1) = 2 Pred_Succe_Table(0, ji + 1) = 1
End If Else
IJSER
PathTable(0, ji + 1) = temp1
Pred_Succe_Table(0, ji + 1) = 0 V(4) = 0
End If End If
' Show path taken jj = jj + 1
MessageBox.Show(PathTable(0, j + 1).ToString) Next
End If
Next If V(4) = V(0) Then '' it will be show number of error oc-
cured
2.5 Code for Traceback MessageBox.Show ("Amount of error occured is " + err)
At this stage we are end of trellis (t=9) and it required to turn End If
back to t=0 so that we can be able to recover original bits from ' Display recovered bits in Txtrecoverd
received codewords. Txtrecovered.Text = stri_receiver, Remove(24, 2)
' start of traceback of the code
Dim tracebackarray(0 To 26) As Int16 ' hold traceback
current state 2 its predecessor state value 3 CONLUSION AND FUTURE WORK
tracebackarray(26) = 0 ' dis position always is zero In this paper, source codes for implementing convolutional
' MessageBox.Show("trace " + traceback- encoder and Viterbi decoder in VB. Net were developed, test-
array(26).ToString) ed and successfully reproduce the desire results. To get overall
tracebackarray(25) = Pred_Succe_Table(0, 26) function code for VA decoder the code for BMU, PMU and
' MessageBox.Show("trace " + traceback- traceback should be combined together. The conversion of
array(25).ToString) source code from VB.NET to other high-level language like
Dim valuehold As Int16 = tracebackarray(25) java is easy as there are many free online converters.
For cv As Int16 = 25 To 1 Step -1 The future work will be enabling dynamic constraint length
tracebackarray(cv - 1) = Pred_Succe_Table(valuehold, and developing open program which could increase commu-
cv) nity skills and expand software defined radio field.
valuehold = tracebackarray(cv - 1)
———————————————— ACKNOWLEDGMENT
Thobius Joseph own BSc. In Telecommunications Engineeing (2014) and The authors wish to thank Vijana Labs. Co. limited and Uni-
MSc. In Telecommunications Engineering (2016) from Unicersity of Do- versity of Iringa.
doma, Tanzania. E-mail: josephthobius@gmail.com
REFERENCES
[1] I. B. Djordjevic, Advanced Optical and Wireless Communications Systems,
Springer, Cham, 2018 https://doi.org/10.1007/978-3-319-63151-6_6.
' MessageBox.Show("trace " + valuehold.ToString)
[2] S. Matin and L. Milstein, "Impacts of Channel Impairments and Im-
Next
perfections on OFDM System Performances," 2018 IEEE Global Con-
IJSER © 2020
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 11, Issue 9, September-2020 1019
ISSN 2229-5518
ference on Signal and Information Processing (GlobalSIP), Anaheim, CA, ment Based on Improved Viterbi Algorithm in 5G-C-RAN,” Confer-
USA, 2018, pp. 1209-1213, doi: 10.1109/GlobalSIP.2018.8646520. ence: 2019 IEEE 5th International Conference on Computer and Communi-
[3] Ouyang, Feng, Digital Communication For Practicing Engineers, The cations (ICCC) Project: Large Vocabulary Indonesian Automatic Speech
Institute of Electrical and Electronics Engineers, Inc, pp.163-240, Recognition,1030-1035, 2019, 10.1109/ICCC47050.2019.9064366.
2019. [24] Hatala, Zulkarnaen, “Viterbi Algorithm and its application to Indo-
[4] A. Mohr, E. Riskin, R. Ladner, “Unequal loss protection: Graceful nesian Speech Speech Recognition,” Conference: 3rd International Con-
degradation over packet erasure channels through forward error cor- ference on Statistics, Mathematics, Teaching, and Research (ICSMTR 2019)
rection,” IEEE Journal on Selected Areas in Communication, vol. 18, Makassar, 9-10 Oct 2019.
pp.819–828, 2000. [25] V. Fabian, F. Rubem and J. Daniel, “A FPGA-based Viterbi algorithm
[5] Pradeep Kumar Shaga et al, “A New Approach of Forward Error implementation for speech recognition systems,”Conference: Acous-
Correction For Packet Loss Recovery,” International Journal of Comput-
tics, Speech, and Signal Processing, 2001. Proceedings. (ICASSP '01). 2.
er Science and Mobile Computing, Vol.3 Issue.9, pg. 670-674, 2014.
1217 – 1220, 2001,10.1109/ICASSP.2001.941143.
[6] UKEssays, “Types Of Forward Error Correction,”
[26] Q. Xie, Q. Long, and S. Mita, “Integration of optical flow and Multi-
https://www.ukessays.com/essays/information-technology/types-of-
Path-Viterbi algorithm for stereo vision,” International Journal of Wave-
forward-error-correction-information-technology-essay.php?vref=1,
lets, Multiresolution and Information Processing, 2017, 15.
2018.
10.1142/S0219691317500229.
[7] Atlanta RF, “Link Budget Analysis: Error Control & Detec-
[27] V. Kakkara, K. Balasubramanian, B. Yamuna, D. Mishra, K. Lin-
tion”,unpublished, 2013.
gasubramanian and S. Murugan, “A Viterbi decoder and its hardware
[8] Akkidas, Davidrichesemmanuel, “Viterbi Algorithm,” Journal of Ex-
Trojan models: an FPGA-based implementation study,” PeerJ Comput.
perimental Algorithmics, 2015.
Sci. 6:e250, 2020, DOI 10.7717/peerj-cs.250.
[9] Chowdhury, Dwaipayan, “Design Automation Methodology of a
Cube using Solidworks and VB.net,” International Journal of Engineer- [28] S. Hema, V. Babu, and R. Pushpangadan, “FPGA implementation of
ing Research, 2020, V9. 10.17577/IJERTV9IS060352. Viterbi decoder,” Proceedings of the 6th WSEAS Int. Conf. on Electronics,
Hardware, Wireless and Optical Communications, Corfu Island, Greece,
IJSER
[10] H. Lauren, “Programmer’s toolchest: examining VB.NET,” Dr.
Dobb's Journal, 27. 65-69, 2002. 162-167, February 16-19, 2007.
[11] N. Dharshinni, S. Amir, A. Fadhillah, and I. Fawwaz, “Design of [29] M. Mozaffari Kermani, V. Singh and R. Azarderakhsh, "Reliable Low-Latency
Simulation Definite Integral Application learning Using Trapezoid Viterbi Algorithm Architectures Benchmarked on ASIC and FPGA," IEEE
Method based on VB.Net,” Journal of informatics and telecommunication Transactions on Circuits and Systems I: Regular Papers, vol. 64, no. 1, pp. 208-216,
engineering, 4. 193-202, 2020, 10.31289/jite.v4i1.3880. Jan. 2017, doi: 10.1109/TCSI.2016.2610187.
[12] H. John, H. Elizabeth, T. Anne, J. Scott, and B. Moe, “Using Assign- [30] Akash Thakur and Manju K Chattopadhyay,” Design and Implemen-
ments in a VB.Net Class to Create Simulations for Use by Teachers,” tation of Viterbi Decoder Using VHDL,” 3rd International Conference
Conference: Society for Information Technology & Teacher Education Inter- on Communication Systems (ICCS-2017) IOP Publishing IOP Conf. Se-
national Conference, 2010. ries: Materials Science and Engineering 331, 2018, doi:10.1088/1757-
[13] H. Wen-Qing and Z. Jie-min., “Mixed-language programming with 899X/331/1/012009.
Fortran and VB.NET," Zhongshan Daxue Xuebao/Acta Scientiarum [31] R. Putra, and T. Adiono, “VLSI Architecture for Configurable and
Natralium Universitatis Sunyatseni, 56. 1-8, 2017, Low-Complexity Design of Hard-Decision Viterbi Decoding Algo-
10.13471/j.cnki.acta.snus.2017.04.001 rithm,” Journal Of ICT Research And Applications, 10(1), 57-75, 2016.
[14] Prastianto, Fayyadh & Rostiani, Yeny, “Komputerisasi Akuntansi [32] Patayon, Urbano and Mingoc, Nerico, “Operating Systems Usability:
Penyusutan Aktiva Tetap Metode Garis Lurus Berbasis Vb.Net Pada A Comparative Study,” JPAIR Multidisciplinary Research, 2019, 36.
Pt Alam Makmur Karawang,” Jurnal Interkom, 2020, 15. 10.7719/jpair.v36i1.683.
10.35969/interkom.v15i1.68. [33] Thobius Joseph, “Prototype for Multimedia Content Delivery Based
[15] Bakhtiar Md Shaari1 and Wan Roslina Wan Musa, “Visual Basic on Ntc Enhanced Viterbi Algorithm”, MSc. In Telecommunications
Program With Hardware: Teaching Of Interfacing Method Approach Eng., The University of Dodoma, Dodoma, Tanzania, 2016.
For Serial Communication,”Advanced Journal of Technical and Voca- [34] James L. Massey, “OBITUARY Peter Elias, 1923–2001”, IEEE Information
tional Education 1 (1): 97-106, 2017. Theory Society Newsletter, Vol. 52, No. 1 available at
[16] Appleman, Dan, Moving to VB.NET: Strategies, Concepts, and Code , https://www.itsoc.org/publications/newsletters/itNL0302.pdf, 2001.
pp.103-121, 2001. [35] M. Mona, A. Hossam, A. Fathi and E. Ayman, “Image Security With
[17] K. Tahani, Visual programming in VB.Net, Dar wael, 2014, ISBN: 978- Different Techniques Of Cryptography And Coding: A Survey,”
9957-91-128-7. IOSR Journal of Computer Engineering, 16. 39-45, 2014, 10.9790/0661-
[18] Whiteside, Mary & Eakin, Mark,”VB Simulation for Multiple Com- 16313945.
parisons Research,"2020. [36] Carl Nassar, “Channel Coding and Decoding: Convolutional Coding and
[19] Wikipedia, “BASIC”, https://en.wikipedia.org/wiki/BASIC, 2020. Decoding,” Telecommunications Demystified, Carl Nassar, eds., Newnes, Pages
[20] Haney, John & Lovely, John. .NET as a Teaching Tool. 1., 2016 197-219, 2001, ISBN 9780080518671, https://doi.org/10.1016/B978-0-08-051867-
[21] T. Stephen, Subclassing and hooking with Visual Basic - harnessing the 1.50013-5
full power of VB/VB.NET: covers VB.NET, O'Reilly, 978-0-596-00118-6,
2001.
[22] S. Devi, S. P. Ramalingam, and P.V.S.S.R., Chandra Mouli, “Chal-
lenges and Issues in Code Migration From VB 6.0 TO VB.NET,” In-
ternational Journal of Computer Information Systems, 2011.
[23] Liu, Kaiming and Peng, Zhengbo, “Service Function Chain Deploy-
IJSER © 2020
http://www.ijser.org