Sunteți pe pagina 1din 22

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

HomeViterbi decoder http://www.dsplog.com/2009/01/04/viterbi/ About Articles Contact Advertise Subscribe DSP log Signal

Aboutdecoder http://www.dsplog.com/2009/01/04/viterbi/ Home Articles Contact Advertise Subscribe DSP log Signal

Articles Contact
Articles
Contact

AdvertiseHome About Articles Contact Subscribe DSP log Signal Processing for Communication

SubscribeHome About Articles Contact Advertise DSP log Signal Processing for Communication Powered by

DSP log

Signal Processing for Communication

Subscribe DSP log Signal Processing for Communication Powered by Translate 802.11ac Capacity Channel Random
Powered by
Powered by

Translate

802.11aclog Signal Processing for Communication Powered by Translate Capacity Channel Random Variables Diversity DSP Error Rate

CapacityProcessing for Communication Powered by Translate 802.11ac Channel Random Variables Diversity DSP Error Rate Filter

Channelfor Communication Powered by Translate 802.11ac Capacity Random Variables Diversity DSP Error Rate Filter News

Random VariablesCommunication Powered by Translate 802.11ac Capacity Channel Diversity DSP Error Rate Filter News Miscellaneous Objective

Diversityby Translate 802.11ac Capacity Channel Random Variables DSP Error Rate Filter News Miscellaneous Objective Quiz

DSP802.11ac Capacity Channel Random Variables Diversity Error Rate Filter News Miscellaneous Objective Quiz Receiver

Error Rate802.11ac Capacity Channel Random Variables Diversity DSP Filter News Miscellaneous Objective Quiz Receiver

FilterCapacity Channel Random Variables Diversity DSP Error Rate News Miscellaneous Objective Quiz Receiver Transmitter Ads

NewsChannel Random Variables Diversity DSP Error Rate Filter Miscellaneous Objective Quiz Receiver Transmitter Ads by

Random Variables Diversity DSP Error Rate Filter News Miscellaneous Objective Quiz Receiver Transmitter Ads by

Miscellaneous

ObjectiveVariables Diversity DSP Error Rate Filter News Miscellaneous Quiz Receiver Transmitter Ads by Google Metric Bit

QuizDiversity DSP Error Rate Filter News Miscellaneous Objective Receiver Transmitter Ads by Google Metric Bit Error

ReceiverDSP Error Rate Filter News Miscellaneous Objective Quiz Transmitter Ads by Google Metric Bit Error Rate

TransmitterError Rate Filter News Miscellaneous Objective Quiz Receiver Ads by Google Metric Bit Error Rate (

Ads by Google

Metric

Bit Error Rate

(3 votes, average: 5.00 out of 5) 3 votes, average: 5.00 out of 5)

Viterbi decoder

Rate ( 3 votes, average: 5.00 out of 5) Viterbi decoder Ber Binary Signals Print by
Rate ( 3 votes, average: 5.00 out of 5) Viterbi decoder Ber Binary Signals Print by

Ber

Binary Signals

average: 5.00 out of 5) Viterbi decoder Ber Binary Signals Print by Krishna Sankar on January

Print

by Krishna Sankar on January 4, 2009

Shell Marine Products

Supplier of Marine Fuels/Lubricants For Marine Industry Worldwide

www.shell.com/marine

For Marine Industry Worldwide www.shell.com/marine Coding is a technique where redundancy is added to original
For Marine Industry Worldwide www.shell.com/marine Coding is a technique where redundancy is added to original

Coding is a technique where redundancy is added to original bit sequence to increase the reliability of the communication. Lets discuss a simple binary convolutional coding scheme at the transmitter and the associated

Viterbi decoder

Viterbi (maximum likelihood) decoding scheme at the receiver.

http://www.dsplog.com/2009/01/04/viterbi/

Update: For some reason, the blog is unable to display the article which discuss both Convolutional coding and Viterbi decoding. As a work around, the article was broken upto into two posts.

This post descrbes the Viterbi decoding algorithm for a simple Binary Convolutional Code with rate 1/2,

constraint length

code, please refer to the post – Convolutional code

code, please refer to the post – Convolutional code and having generator polynomial . For more

and having generator polynomial

post – Convolutional code and having generator polynomial . For more details on the Binary convolutional

. For more details on the Binary convolutional

Viterbi algorithm

As explained in Chapter 5.1.4 of Digital Communications by John Proakis for optimal decoding for a modulation

scheme with memory (as is the case here), if there are combinations. This becomes prohibitively complex as

landmark paper Error bounds for convolutional codes and an asymptotically optimum decoding algorithm, IEEE Transactions on Information Theory 13(2):260–269, April 1967 described a scheme for reducing the complexity to more managable levels. Some of the key assumptions are as follows:

levels. Some of the key assumptions are as follows: coded bits, we need to search from

coded bits, we need to search from

possibleare as follows: coded bits, we need to search from becomes large. However, Mr. Andrew J

becomes large. However, Mr. Andrew J Viterbi in his

(a) As shown in Table 1 and Figure 2 (in the article Convoutional Code) any state can be reached from only 2

possible previous state.

(b) Though we reach each state from 2 possible states, only one of the transition in valid. We can find the

transition which is more likely (based on the received coded bits) and ignore the other transition.

(c) The errors in the received coded sequence are randomly distributed and the probability of error is small.

Based on the above assumptions, the decoding scheme proceed as follows: Assume that there are

Take two coded bits at a time for processing and compute Hamming distance, Branch Metric, Path Metric

and Survivor Path index for

Branch Metric , Path Metric and Survivor Path index for coded bits. times. Let be the

coded bits.

, Path Metric and Survivor Path index for coded bits. times. Let be the index varying

times. Let

Metric and Survivor Path index for coded bits. times. Let be the index varying from 1

be the index varying from 1 till

.
.

Hamming Distance Computation

For decoding, consider two received coded bits at a time

possible combinations of two bits. The number of differing bits can be computed by XOR-ing 11 and then counting the number of ones.

computed by XOR-ing 11 and then counting the number of ones. and compute the Hamming distance

and compute the Hamming distance between all

with 00, 01, 10,of ones. and compute the Hamming distance between all is the number of 1′s in is

is the number of 1′s inis the number of 1′s in is the number of 1′s in is the number

is the number of 1′s in

is the number of 1′s inis the number of 1′s in is the number of 1′s in is the number of

is the number of 1′s in

is the number of 1′s inis the number of 1′s in is the number of 1′s in is the number of

is the number of 1′s in

is the number of 1′s inis the number of 1′s in is the number of 1′s in is the number of

is the number of 1′s in

Branch Metric and Path Metric Computation

As stated prior, each state can be reached from two possible states (shown by red and blue lines respectively). Branch metric is the sum of the path metric of the previous state and the hamming distance required for the transition. From the two avaiable branch metrices, the one with minimum branch metric value is chosen. This operation is also referred to as Add Compare and Select (ACS) unit.

Note:

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

1. Typically, Convolutional coder always starts from State 00. The Viterbi decoder also assumes the same.

2. For index

computed. In this case, path metric for each state is equal to branch metric as the other branch is not valid.

= 1, branch metric for State 00 (from State 00) branch and State 10 (from State 00) can only beis equal to branch metric as the other branch is not valid. 3. For index State

3. For index

State 00) and State 11 (from State 10) can only be computed. In this case too, path metric for each state is equal to branch metric as the other branch is not valid.

= 2, branch metric for State 00 (from State 00) branch, State 01 (from State 10), State 10 (fromis equal to branch metric as the other branch is not valid. 4. Starting from index

4. Starting from index

01 (from State 10), State 10 (from 4. Starting from index =3, each state has two

=3, each state has two branches and the need to do Add Compare and Select arises.

5. Its possible that two branch metrices might have the same value. In that scenario, we can chose one among the

the branches and proceed.

we can chose one among the the branches and proceed. Branch Metric and Path Metric computation

Branch Metric and Path Metric computation for Viterbi decoder

Figure: Branch Metric and Path Metric computation for Viterbi decoder

State 00 can be reached from two branches

(a) State 00 with output 00. The branch metric for this transition is,

.
.

(b) State 01 with output 11. The branch metric for this transition is,

.
.

The path metric for state 00 is chosen based which is minimum out of the two.

state 00 is chosen based which is minimum out of the two. The survivor path for

The survivor path for state 00 is stored in survivor path metric.

Viterbi decoder

Viterbi decoder State 01 can be reached from two branches: (c) State 10 with output 10.

State 01 can be reached from two branches:

(c) State 10 with output 10. The branch metric for this transition is,

10 with output 10. The branch metric for this transition is, (d) State 11 with output

(d) State 11 with output 01. The branch metric for this transition is,

11 with output 01. The branch metric for this transition is, http://www.dsplog.com/2009/01/04/viterbi/ The path metric

http://www.dsplog.com/2009/01/04/viterbi/

The path metric for state 01 is chosen based which is minimum out of the two.

.
.

The survivor path for state 01 is stored in survivor path metric.

.
.

State 10 can be reached from two branches:

(e) State 00 with output 11. The branch metric for this transition is,

00 with output 11. The branch metric for this transition is, (f) State 01 with output

(f) State 01 with output 00. The branch metric for this transition is,

01 with output 00. The branch metric for this transition is, The path metric for state

The path metric for state 10 is chosen based which is minimum out of the two.

.
.

The survivor path for state 10 is stored in survivor path metric.

.
.

State 11 can be reached from two branches:

(g) State 10 with output 01. The branch metric for this transition is,

10 with output 01. The branch metric for this transition is, (h) State 11 with output

(h) State 11 with output 10. The branch metric for this transition is,

.
.

The path metric for state 11 is chosen based which is minimum out of the two.

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

Viterbi decoder http://www.dsplog.com/2009/01/04/viterbi/ The survivor path for state 11 is stored in survivor path

The survivor path for state 11 is stored in survivor path metric.

.
.

Traceback Unit

state 11 is stored in survivor path metric. . Traceback Unit Once the survivor path is

Once the survivor path is computed times, the decoding algorithm can start trying to estimate the

input sequence. Thanks to presence of tail bits (additional Convolutional code is State 00.

of tail bits (additional Convolutional code is State 00. zeros) , it is known that the

zeros) , it is known that the final state following

So, start from the last computed survivor path at index

previous state corresponding to the current state. From the knowledge of current state and previous state, the input sequence can be determined (Ref: Table 2 Input given current state and previous state). Continue tracking back through the survivor path and estimate the input sequence till index = 1.

path and estimate the input sequence till index = 1. for State 00. From the survivor

for State 00. From the survivor path, find the

ip, if

previous

state

current

state

00

01

10

11

00

0

0

x

x

01

x

x

0

0

10

1

1

x

x

11

x

x

1

1

Table 2: Input given current state and previous state

Simulation Model

Octave/Matlab source code for computing the bit error rate for BPSK modulation in AWGN using the convolutional coding and Viterbi decoding is provided. Refer to the post on Bit Error Rate (BER) for BPSK modulation for signal and channel model.

Note: Since 2 coded bits are required for transmission of each data bit, the relation between coded bits to noise

of each data bit, the relation between coded bits to noise ratio with bits to noise
of each data bit, the relation between coded bits to noise ratio with bits to noise

ratio with bits to noise ratio is

.
.

The simulation model performs the following:

(a)

Generation of random BPSK modulated symbols +1’s and -1’s

(b)

Convolutionally encode them using rate -1/2, generator polynomial [7,5] octal code

(c)

Passing them through Additive White Gaussian Noise channel

Viterbi decoder

(d)

Hard decision demodulation on the received coded symbols

(e)

Received coded bits are passed to Viterbi decoder

(f)

Counting the number of errors from the output of Viterbi decoder

(g)

Repeating the same for multiple Eb/No value.

http://www.dsplog.com/2009/01/04/viterbi/

Click here to download Matlab/Octave script for computing BER with Binary Convolutional code and Viterbi decodig for BPSK modulation in AWGN channel

code and Viterbi decodig for BPSK modulation in AWGN channel Figure 3: BER plot for BPSK

Figure 3: BER plot for BPSK modulation in AWGN channel with Binary Convolutional code and hard decision Viterbi decoding

Observations

code and hard decision Viterbi decoding Observations 1. For lower regions, the error rate with Viterbi

1. For lower

regions, the error rate with Viterbi decoding is higher uncoded bit error rate. This is because,

decoding is higher uncoded bit error rate. This is because, values, there Viterbi decoder prefers the

values, there

Viterbi decoder prefers the error to be randomly distributed for it work effectively. At lower

are more chances of multiple received coded bits in errors, and the Viterbi algorithm is unable to recover.

2. There can be further optimizations like – using soft decision decoding, limiting the traceback length etc. Those can be discussed in future posts.

References

etc. Those can be discussed in future posts. References Tutorial on Convolutional Coding with Viterbi Decoding

Tutorial on Convolutional Coding with Viterbi Decoding – Mr. Chip Fleming

Digital Communications by John Proakis

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

Please click here to SUBSCRIBE to newsletter and download the FREE e-Book on probability of error in AWGN. Thanks for visiting! Happy learning.

Tagged as: AWGN, BPSK, Viterbi

Happy learning. Tagged as: AWGN , BPSK , Viterbi Related posts 1. Viterbi with finite survivor

Related posts

1. Viterbi with finite survivor state memory

2. Soft Input Viterbi decoder

3. Convolutional code

4. Matlab or C for Viterbi Decoder?

5. Hamming (7,4) code with hard decision decoding

Air Starters from ASC Inc www.ascairstarter.com Full line of New & Remanufactured air starters and parts.

Extreme Low Power MCUs www.microchip.com/xlp

20nA Sleep, Real Time Clock & Watchdog Timer

Transmitter Receiver www.globalspec.com Search Thousands of Catalogs for Transmitter Receiver

Verilog TimingTool.com

Free Online Timing Diagram Editor Verilog & VHDL Test benches

Online Timing Diagram Editor Verilog & VHDL Test benches D id you like this article? Make

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN.

Ads by Google

Algorithm

75W90 Shell

Shell TELLUS

CPLD Code

{ 58 comments… read them below or add one }

CPLD Code { 58 comments… read them below or add one } 1 Lealem January 10,

1 Lealem January 10, 2009 at 12:06 pm

Hello! Kirishna Thank you for ur matlab script Concerning convolutional coding. Do u have a matlab script which is used to simulate convolutional coded OFDM? an do u have also matlab script of convolutional coding that use a soft decision decoding algorithm? Thank you!!!

Reply

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

Viterbi decoder http://www.dsplog.com/2009/01/04/viterbi/ 2 Krishna Pillai January 13, 2009 at 5:31 am @Lealem: Thanks.

2 Krishna Pillai January 13, 2009 at 5:31 am

@Lealem: Thanks. Sorry, I have not yet written posts on using convolutional coding with OFDM. Maybe once I discuss interleaver, I will add a post on it. I am writing a post on soft decision decoding, I just finished the simulation model.

decision decoding, I just finished the simulation model. Reply 3 Lealem January 14, 2009 at 5:52

Reply

decoding, I just finished the simulation model. Reply 3 Lealem January 14, 2009 at 5:52 pm

3 Lealem January 14, 2009 at 5:52 pm

Thank you! Kirishna what can i do to write a simulation of convolutionaly coded QAM, QPSK,16-QAM and 64-QAM signals and also Trellis coded MOdulation? Thanks

Reply

signals and also Trellis coded MOdulation? Thanks Reply 4 detito April 24, 2010 at 11:44 pm

4 detito April 24, 2010 at 11:44 pm

Hey Krishna, I am writing a Viterbi decoding algorithm for a simple Binary Convolutional Code with rate 1/3, constraint length K=5, and having generator polynomial G=(25,33,37) in matlab . Can you please help.

Reply

G=(25,33,37) in matlab . Can you please help. Reply 5 Krishna Sankar April 27, 2010 at

5 Krishna Sankar April 27, 2010 at 5:19 am

@detito: Hopefully, the code in this post can help you as a reference.

the code in this post can help you as a reference. Reply 6 Sandeep January 10,

Reply

6 Sandeep January 10, 2009 at 10:41 pm

Hi Krishna Thanks for article on viterbi.I would like further articles discussing 1> The following assumption :The errors in the received coded sequence are randomly distributed and the probability of error is small. 2> How you decide about traceback length? We can’t wait for all the input to be arrive before starting traceback. 3> For 11n what type of architecture is used for high throughput? Regards

Reply

Viterbi decoder

Viterbi decoder 7 Krishna Pillai January 13, 2009 at 5:40 am @Sandeep: Thanks. My replies:

7 Krishna Pillai January 13, 2009 at 5:40 am

@Sandeep: Thanks. My replies:

http://www.dsplog.com/2009/01/04/viterbi/

1. If you recall, the decoding complexity is reduced in Viterbi algorithm by assuming that each state

can be reached from only two possible states and only one of them is valid. However, if there are burst errors (or if the probability of error is high) then the above assumption becomes invalid. So, when we traceback we might not be able to decode correctly.

2. For the current simulation, I assumed that we wait till the end of all the coded bits to start

traceback. As you said, in typical systems, we do not do that. We typically start the traceback much

before. I will write a post on traceback length.

3. The Viterbi algorithm described in the post takes two coded bits and gives one data bit per

iteration. However, we can write the transition table to take four coded bits and give out 2 data bits

per iteration. This architecture allows one with a clock frequency limited system to have a higher throughput at the expense of extra hardware.

Hope this helps.

Reply

8 Lealem January 21, 2009 at 5:20 pm Lealem January 21, 2009 at 5:20 pm

Hello! kirishna what can i do to write a simulation of convolutionaly coded QAM, QPSK,16-QAM and 64-QAM signals and also Trellis coded MOdulation?if u have a matlab code please try to provide me. Thanks

Reply

u have a matlab code please try to provide me. Thanks Reply 9 Krishna Pillai January

9 Krishna Pillai January 24, 2009 at 7:41 am

@Lealem: Trellis coded modulation – not yet. Hope to write soon.

Reply

coded modulation – not yet. Hope to write soon. Reply 10 Ricky January 27, 2009 at

10 Ricky January 27, 2009 at 7:09 pm Ricky January 27, 2009 at 7:09 pm

can i get the vhdl code for k=7 and the inputs being 171 and 133 octal, with the rate=1/2

Reply

the inputs being 171 and 133 octal, with the rate=1/2 Reply 11 Krishna Pillai January 28,

11 Krishna Pillai January 28, 2009 at 6:03 am

@Ricky: Sorry, we mostly discuss Matlab modeling here.

Viterbi decoder

Reply

12 Dhruv April 10, 2009 at 10:41 am Dhruv April 10, 2009 at 10:41 am

hey man i am looking for the same did you get it???

10:41 am hey man i am looking for the same did you get it??? Reply 13

Reply

13 Lealem February 10, 2009 at 7:15 pm

http://www.dsplog.com/2009/01/04/viterbi/

hello!Kirishina u did it for BPSk modulation but how can i write a matlab code when the modulation is changed to QAM, QPSK ,16-QAM and 64-QAM? Thank you!

Reply

is changed to QAM, QPSK ,16-QAM and 64-QAM? Thank you! Reply 14 scorswiss February 17, 2009

14 scorswiss February 17, 2009 at 12:33 pm

Hello Krishna, I want to develop a verification environment in Verilog for Viterbi decoder. I want a tested C model or Verilog model for the same.From where can I get it?

Reply

15 Krishna Pillai February 21, 2009 at 7:29 am Krishna Pillai February 21, 2009 at 7:29 am

@scorswiss: In the posts I have provided a Matlab code for soft decision and hard decision Viterbi decoder for the rate 1/2 K=3 convolutional encoder. Maybe you can convert that to C and use.

Reply

encoder. Maybe you can convert that to C and use. Reply 16 setareh August 16, 2009

16 setareh August 16, 2009 at 6:04 pm

hello , I am also looking for matlab code for k=3 and r=1/2 , I am writing VHDL code for it I cant find the code you post it for matlab could you tell me where exactly I can find it thank you in advance

Reply

me where exactly I can find it thank you in advance Reply 17 Krishna Sankar August

17 Krishna Sankar August 18, 2009 at 3:48 am

@setareh: The URL for the code is provided just above the BER plot.

Reply

Viterbi decoder

Viterbi decoder 18 scorswiss February 25, 2009 at 3:41 pm http://www.dsplog.com/2009/01/04/viterbi/ Hi Krishna, Thanks

18 scorswiss February 25, 2009 at 3:41 pm

http://www.dsplog.com/2009/01/04/viterbi/

Hi Krishna, Thanks for the reply. I am still facing an issue in the encoder part- When the bits are convolutionally coded, the coded bits together with the uncoded bits are mapped to a space to generate symbols. Till this point we deal wih the digital bitstream,but when this bitstream passes through the channel, AWGN noise(whose value is between 0 and 1 eg: 0.8)is added which is analog in nature. The problem is how to add analog noise to digital stream.Is it through D/A and A/D converters or quantization concept or the AWGN output is converted to digital stream?

Reply

or the AWGN output is converted to digital stream? Reply 19 Krishna Pillai February 27, 2009

19 Krishna Pillai February 27, 2009 at 6:01 am

@scorswiss: The AWGN noise (which can theoreticall be from -inf to +inf) is added between the DA/ and A/D. If I may the chain will be as follows:

Bits -> convolutional coded bits -> constellation mapping -> filtering -> D/A –> Add Noise –> A/D –> constellation to bits -> Viterbi decoding

Alternatively we can use Soft decision decoding:

http://www.dsplog.com/2009/01/14/soft-viterbi/

Bits -> convolutional coded bits -> constellation mapping -> filtering -> D/A –> Add Noise –> A/D –> soft decision Viterbi decoding

Hope this helps.

A/D –> soft decision Viterbi decoding Hope this helps. Reply 20 Allyson March 16, 2009 at

Reply

20 Allyson March 16, 2009 at 1:16 pm

Hi,

I use the Matlab function (bercoding) to simulate the coded-AWGN-BER. and for the decoding and encoding method I use matlab function as well (vitdec and convenc)… My simulated result is near to uncoded-AWGN-BER but not near to coded-AWGN. Why is it so?

Reply

but not near to coded-AWGN. Why is it so? Reply 21 Krishna Pillai March 21, 2009

21 Krishna Pillai March 21, 2009 at 8:24 am

@Allyson: Quite likely a power normalization issue.

Reply

Viterbi decoder

Viterbi decoder 22 Allyson March 16, 2009 at 1:27 pm Hi, http://www.dsplog.com/2009/01/04/viterbi/ It’s me again…. I

22 Allyson March 16, 2009 at 1:27 pm

Hi,

http://www.dsplog.com/2009/01/04/viterbi/

It’s me again…. I hope to see the explanation on the soft decoding which can improve the situation.

Thanks.

Reply

soft decoding which can improve the situation. Thanks. Reply 23 Krishna Pillai March 21, 2009 at

23 Krishna Pillai March 21, 2009 at 8:26 am

@Allyson: You may refer to the post @

http://www.dsplog.com/2009/01/14/soft-viterbi/

to the post @ http://www.dsplog.com/2009/01/14/soft-viterbi/ Reply 24 ahamed March 21, 2009 at 8:43 pm Hi krishna

Reply

24 ahamed March 21, 2009 at 8:43 pm

Hi krishna I am doing viterbi decoder in verilog can you tell me from where i can get a code for reference

Reply

you tell me from where i can get a code for reference Reply 25 Krishna Pillai

25 Krishna Pillai March 25, 2009 at 5:42 am

@ahmed: You may check

http://home.netcom.com/%7Echip.f/viterbi/fecbiblio.html

http://home.netcom.com/%7Echip.f/viterbi/fecbiblio.html Reply 26 chintu March 30, 2009 at 2:38 am Hi I want to know

Reply

26 chintu March 30, 2009 at 2:38 am

Hi I want to know for R=1/2 K=7 convolutional code which generator matrix is best. Please tell me how can I get the answer. Also I want to simulate convolutional coding with FSK. Please tell me how to do it.

Reply

coding with FSK. Please tell me how to do it. Reply 27 Krishna Pillai April 4,

27 Krishna Pillai April 4, 2009 at 8:54 am

@chintu: My replies:

(1) From looking at the Table 8.2.1 in Digital Communications, Proakis, find that for K=7, the

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

generator polynomial is {133,171}_octal. I think, reasearchers long back have tried simulating with different generator polynomails and the table listed in the book lists the best for each constraint length and rate combination.

(2) I have written a post on BER with FSK

http://www.dsplog.com/2007/08/30/bit-error-rate-for-frequency-shift-keying-with-coherent-

demodulation/ Hope it should be reasonably easy for you to add convolutional coding + viterbi decoding to that script.

Reply

coding + viterbi decoding to that script. Reply 28 chintu April 7, 2009 at 3:16 pm

28 chintu April 7, 2009 at 3:16 pm

The generator matrix for the optimal code for above query if given a different value in Lin and costello ” error control coding” which is (117, 155) octal.Please clarify.

Also how do I implement this R=1/2 K=7 convolution code in your convolution coding(r=1/2,k=3) script as it is designed for K=3 and can’t be generalized for K=7. Please post a generalized script.

Reply

generalized for K=7. Please post a generalized script. Reply 29 Krishna Pillai April 11, 2009 at

29 Krishna Pillai April 11, 2009 at 6:20 am

@chintu: My objective was to provide an example code for Viterbi decoder to help understand the concept. Am reasonably sure that once you understand the concept, the reader can easily extended to other cases. Good luck in your project work.

Reply

30 Zeeshan Sattar June 3, 2009 at 4:16 pm June 3, 2009 at 4:16 pm

Superb Explanation. Thumbs Up bro

Reply

3, 2009 at 4:16 pm Superb Explanation. Thumbs Up bro Reply 31 Krishna Pillai June 7,

31 Krishna Pillai June 7, 2009 at 2:05 pm

@Zeeshan Sattar: Thanks pal.

Reply

32 einstein July 4, 2009 at 4:56 pm einstein July 4, 2009 at 4:56 pm

Viterbi decoder

What changes should I make for k=5, r=1/3 decoder?

Reply

What changes should I make for k=5, r=1/3 decoder? Reply 33 Krishna Pillai July 6, 2009

33 Krishna Pillai July 6, 2009 at 5:51 pm

http://www.dsplog.com/2009/01/04/viterbi/

@einstein: For k=1/5, r=1/3 the state transitions change. The branch metric and path metric computations needs to be changed accordingly.

Reply

metric computations needs to be changed accordingly. Reply 34 arun August 9, 2009 at 8:18 pm

34 arun August 9, 2009 at 8:18 pm

Hi krishna, Can you give the list of generator polynomials for various constraints lengths. Ex: k=7 the Generator poly is 133 ,171

Reply

lengths. Ex: k=7 the Generator poly is 133 ,171 Reply 35 Krishna Sankar August 11, 2009

35 Krishna Sankar August 11, 2009 at 4:48 am

@arun: You may check the Chapter 8.2.5 in Digital Communications by John Proakis. That chapter has a list of generator polynomials for various code rates from 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8 … for constraint length from K=3 to K=14.

Reply

36 arun August 9, 2009 at 8:20 pm arun August 9, 2009 at 8:20 pm

Hi, Can you give me the best generator polynomials for various constraint lengths.

Reply

generator polynomials for various constraint lengths. Reply 37 Krishna Sankar August 11, 2009 at 4:48 am

37 Krishna Sankar August 11, 2009 at 4:48 am

@arun: You may check the Chapter 8.2.5 in Digital Communications by John Proakis. That chapter has a list of generator polynomials for various code rates from 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8 … for constraint length from K=3 to K=14.

Reply

38 fateme September 2, 2009 at 6:25 pm fateme September 2, 2009 at 6:25 pm

Hi kirishna

Viterbi decoder

What can i do to write a simulation of Space Time Trellis code ? if u have a matlab code please try to provide me. Best Regards Fateme

Reply

code please try to provide me. Best Regards Fateme Reply 39 Krishna Sankar September 8, 2009

39 Krishna Sankar September 8, 2009 at 5:21 am

@fateme: Sorry, I have not tried modeling space time trellis code.

Sorry, I have not tried modeling space time trellis code. Reply 40 amudhan October 30, 2009

Reply

40 amudhan October 30, 2009 at 11:34 am

http://www.dsplog.com/2009/01/04/viterbi/

can u send the vhdl and verilog coding for low-latency low-complexity architectres for viterbi decoder

Reply

low-complexity architectres for viterbi decoder Reply 41 Krishna Sankar November 8, 2009 at 8:06 am @amudhan:

41 Krishna Sankar November 8, 2009 at 8:06 am

@amudhan: sorry, i do not have vhdl/verilog code.

Reply

42 Neo Cambel November 25, 2009 at 11:37 pm November 25, 2009 at 11:37 pm

Excellent tutorial. Thanks a lot. BR, Neo

Reply

at 11:37 pm Excellent tutorial. Thanks a lot. BR, Neo Reply 43 Hyunjin.Jang November 26, 2009

43 Hyunjin.Jang November 26, 2009 at 10:36 pm

It’s difficult to viterbi… Help me, mt graduation of thesis. Image(photo) processing/ Simulation to C++

Reply

of thesis. Image(photo) processing/ Simulation to C++ Reply 44 Krishna Sankar December 7, 2009 at 4:42

44 Krishna Sankar December 7, 2009 at 4:42 am

@Hyunjin.Jang: Hope this post helps. Good luck.

Viterbi decoder

Viterbi decoder Reply 45 Harish December 4, 2009 at 3:05 am http://www.dsplog.com/2009/01/04/viterbi/ Hi, In your code

Reply

45 Harish December 4, 2009 at 3:05 am

http://www.dsplog.com/2009/01/04/viterbi/

Hi,

In your code I see that the survivor path metric index you have calculated as minimum of the 2 paths. Some thing like this case I : says idx case II; you say it is idx+2.

I don’t understand this. What would it be if I am using 8PSK with 8 states ? I am not able to arrive at the idx thing for storing the path index. Could you please help me with that ?

Thanks,

Harish

Reply

Could you please help me with that ? Thanks, Harish Reply 46 Krishna Sankar December 7,

46 Krishna Sankar December 7, 2009 at 5:11 am

@Harish: Well, I have assumed BPSK in this simulation. Even if you are using BPSK, I believe you might be passing on the received hard decision bits to the Viterbi decoder. So the underlying path metrics computation should still hold good. Agree?

path metrics computation should still hold good. Agree? Reply 47 sujata.kamlapur April 10, 2010 at 9:26

Reply

47 sujata.kamlapur April 10, 2010 at 9:26 am

hi sir

i am a mtech student

here in this project 1st we extract the hand writing features and then should build the HMM model, after this we use viterbi algorithm for recognition and baum-welch alogrithm for training. so please can u help me in viterbi algorithm part…….?

and i’m working on d project hand writing recognition using hidden markov model.

Reply

hand writing recognition using hidden markov model. Reply 48 Krishna Sankar April 14, 2010 at 5:02

48 Krishna Sankar April 14, 2010 at 5:02 am

@sujata.kamlapur: Does the Viterbi decoder code provided in this post help?

Does the Viterbi decoder code provided in this post help? Reply 49 Keshav Kishore Jha April

Reply

49 Keshav Kishore Jha April 23, 2010 at 11:34 pm

Hi Krishna,

Thanks for your post.

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

I need your help in implementing this code when channel is AWGN+Rayleigh fading.

Kindly help me to tell what modifications are required in this program for soft decoding.

….

Keshav

Reply

in this program for soft decoding. …. Keshav Reply 50 Krishna Sankar April 27, 2010 at

50 Krishna Sankar April 27, 2010 at 5:26 am

@Keshav Kishore Jha: Need to have a multiplicative noise to model the Rayleigh channel. You may refer to examples @ http://www.dsplog.com/tag/rayleigh/

may refer to examples @ http://www.dsplog.com/tag/rayleigh/ Reply 51 guzeltayyar October 8, 2010 at 10:53 pm Hi

Reply

51 guzeltayyar October 8, 2010 at 10:53 pm

Hi Krishna,

Appreciate your efforts in the first place.

I have a question for you

non-gaussian noise cases

maximum likelihood distance metric to enhance my decoder performance against impulsice noise

I would like to replace the Euclidean distance with another metric for for instance, I would like to use alpha-penalty function or known state

how would you go about it?? does it change the way how you compute the soft inputs?? or changing only the distance metric is enough??

have you ever tried another metric for non-gaussian noise for your decoder??

thanx in advance,

TayyaR.

Reply

noise for your decoder?? thanx in advance, TayyaR. Reply 52 Krishna Sankar November 19, 2010 at

52 Krishna Sankar November 19, 2010 at 5:57 am

@guzeltayyar: I guess, one way is to give less weights to softbits affected by impulse noise. This can be done by scaling down those softbits. I have not tried any metric for non-gaussian noise.

I have not tried any metric for non-gaussian noise. Reply 53 Sulav Paudel November 16, 2010

Reply

53 Sulav Paudel November 16, 2010 at 7:52 pm

Hi Krishna…………

i am trying to plot the graph of BER vs SNR for bayesian demodulation and QPSK demodulation. I have to analysis the performance for these two techniques. Could you please help me in this matter.

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

And, can you help in the matlab code for theoritical and pratical BER for QPSK.

With Regards,

sulav paudel

Reply

and pratical BER for QPSK. With Regards, sulav paudel Reply 54 Krishna Sankar November 17, 2010

54 Krishna Sankar November 17, 2010 at 4:54 am

@Sulav: Hopefully the following post might be of help

a) BER of BPSK in AWGN

http://www.dsplog.com/2007/08/05/bit-error-probability-for-bpsk-modulation/

b) Symbol Error rate of QPSK in AWGN

http://www.dsplog.com/2007/11/06/symbol-error-rate-for-4-qam/

Reply 55 Rodrigo Mendoza May 25, 2011 at 9:00 am amm……

Reply

55 Rodrigo Mendoza May 25, 2011 at 9:00 am

amm…… I don`t know why but the code I download from this page doesnt work. nErrViterbi(yy) = size(find([ip- ipHat_v(1:N)]),2); the dimensions of ipHat_v are smaller than N Can you tell me how can I resolve this problem I just cant

Reply

you tell me how can I resolve this problem I just cant Reply 56 Krishna Sankar

56 Krishna Sankar May 26, 2011 at 5:33 am

@Rodrigo: Are you sure? I re-ran the code. It’s working.

@Rodrigo: Are you sure? I re-ran the code. It’s working. Reply 57 Ajeesh December 31, 2009

Reply

57 Ajeesh December 31, 2009 at 2:27 pm

Sir,

Reply

Reply 57 Ajeesh December 31, 2009 at 2:27 pm Sir, Reply 58 Ajeesh December 31, 2009

58 Ajeesh December 31, 2009 at 2:29 pm

Sir, We want to compute with binary convolutional code of rate=1/2, generator polynomial- [171, 133] Octal… Kindly help us pleaseeeeeeeee………

Viterbi decoder

Reply

Leave a Comment

Viterbi decoder Reply Leave a Comment Name * E-mail * Website Notify me of followup comments

Name *

Viterbi decoder Reply Leave a Comment Name * E-mail * Website Notify me of followup comments

E-mail *

Viterbi decoder Reply Leave a Comment Name * E-mail * Website Notify me of followup comments

Website

Viterbi decoder Reply Leave a Comment Name * E-mail * Website Notify me of followup comments
Viterbi decoder Reply Leave a Comment Name * E-mail * Website Notify me of followup comments

Notify me of followup comments via e-mail

* E-mail * Website Notify me of followup comments via e-mail { 2 trackbacks } Convolutional

{ 2 trackbacks }

Convolutional codeNotify me of followup comments via e-mail { 2 trackbacks } Viterbi with finite survivor state

Viterbi with finite survivor state memorycomments via e-mail { 2 trackbacks } Convolutional code Previous post: Convolutional code Next post: Migration

Previous post: Convolutional code

Next post: Migration to Who’s Who theme

code Next post: Migration to Who’s Who theme http://www.dsplog.com/2009/01/04/viterbi/ 19 of 22

http://www.dsplog.com/2009/01/04/viterbi/

Viterbi decoder

SubscribeViterbi decoder Subscribe via RSS Subscribe via email http://www.dsplog.com/2009/01/04/viterbi/ Ads by Google Qam

Subscribe via RSSViterbi decoder Subscribe Subscribe via email http://www.dsplog.com/2009/01/04/viterbi/ Ads by Google Qam Modulation

Subscribe via emailViterbi decoder Subscribe Subscribe via RSS http://www.dsplog.com/2009/01/04/viterbi/ Ads by Google Qam Modulation

http://www.dsplog.com/2009/01/04/viterbi/

via email http://www.dsplog.com/2009/01/04/viterbi/ Ads by Google Qam Modulation Generate Code Shell Adrana Tag

Ads by Google

Qam Modulation

Generate Code

Shell AdranaAds by Google Qam Modulation Generate Code Tag 16-PSK 802.11a Alamouti AWGN BPSK Capacity CDF

TagAds by Google Qam Modulation Generate Code Shell Adrana 16-PSK 802.11a Alamouti AWGN BPSK Capacity CDF

16-PSK 802.11a Alamouti AWGN BPSK Capacity CDF conference convolution CORDIC Diversity eye diagram first order

frequency offset FSK Gray IISc interpolation ISI latex machine_learning magnitude MIMO ML MMSE MSK Nyquist OFDM orthogonal

PAM PAPR pdf phase PSK pulse shaping QAM raised cosine Rayleigh SIC sigma delta STBC TETRA transmitter

Viterbi ZF

CategoriesSIC sigma delta STBC TETRA transmitter Viterbi ZF Archives Top Rated posts Bit Error Rate (BER)

sigma delta STBC TETRA transmitter Viterbi ZF Categories Archives Top Rated posts Bit Error Rate (BER)

Archivessigma delta STBC TETRA transmitter Viterbi ZF Categories Top Rated posts Bit Error Rate (BER) for

STBC TETRA transmitter Viterbi ZF Categories Archives Top Rated posts Bit Error Rate (BER) for BPSK

Top Rated postsSTBC TETRA transmitter Viterbi ZF Categories Archives Bit Error Rate (BER) for BPSK modulation - 38

Bit Error Rate (BER) for BPSK modulation - 38 votes - 38 votes

BER for BPSK in OFDM with Rayleigh multipath channel - 28 votes - 28 votes

BER for BPSK in Rayleigh channel - 24 votes - 24 votes

Alamouti STBC - 21 votes - 21 votes

Maximal Ratio Combining (MRC) - 21 votes - 21 votes

Download free e-book on error probability in AWGN - 20 votes - 20 votes

Rayleigh multipath channel model - 17 votes - 17 votes

Viterbi decoder

http://www.dsplog.com/2009/01/04/viterbi/

MIMO with MMSE equalizer - 16 votes - 16 votes

Comparing BPSK, QPSK, 4PAM, 16QAM, 16PSK, 64QAM and 32PSK - 15 votes - 15 votes

Understanding an OFDM transmission - 14 votes - 14 votes

- 15 votes Understanding an OFDM transmission - 14 votes Recent Posts Stochastic Gradient Descent Batch

Recent Posts- 15 votes Understanding an OFDM transmission - 14 votes Stochastic Gradient Descent Batch Gradient Descent

Understanding an OFDM transmission - 14 votes Recent Posts Stochastic Gradient Descent Batch Gradient Descent Back!

Stochastic Gradient DescentUnderstanding an OFDM transmission - 14 votes Recent Posts Batch Gradient Descent Back! Non coherent demodulation

Batch Gradient Descent- 14 votes Recent Posts Stochastic Gradient Descent Back! Non coherent demodulation of pi/8 D8PSK (TETRA)

Back!Posts Stochastic Gradient Descent Batch Gradient Descent Non coherent demodulation of pi/8 D8PSK (TETRA) IEEE

Non coherent demodulation of pi/8 D8PSK (TETRA)Stochastic Gradient Descent Batch Gradient Descent Back! IEEE 802.11ac – Very High Throughput for lower 6GHz

IEEE 802.11ac – Very High Throughput for lower 6GHz bandBack! Non coherent demodulation of pi/8 D8PSK (TETRA) Comments Krishna Sankar on MIMO with ML equalization

CommentsIEEE 802.11ac – Very High Throughput for lower 6GHz band Krishna Sankar on MIMO with ML

Krishna Sankar on MIMO with ML equalization on MIMO with ML equalization

Krishna Sankar on Rayleigh multipath channel model on Rayleigh multipath channel model

Krishna Sankar on Alamouti STBC with 2 receive antenna on Alamouti STBC with 2 receive antenna

Stochastic Gradient Descet on Batch Gradient Descent on Batch Gradient Descent

benza on MIMO with ML equalization MIMO with ML equalization

Viterbi decoder

DSPViterbi decoder ANALOG & DSP Complex to Real DSP blog DSP DesignLine DSP Guide DSP Tutor

ANALOG & DSPViterbi decoder DSP Complex to Real DSP blog DSP DesignLine DSP Guide DSP Tutor DSPRelated Octave

Complex to RealViterbi decoder DSP ANALOG & DSP DSP blog DSP DesignLine DSP Guide DSP Tutor DSPRelated Octave

DSP blogViterbi decoder DSP ANALOG & DSP Complex to Real DSP DesignLine DSP Guide DSP Tutor DSPRelated

DSP DesignLineViterbi decoder DSP ANALOG & DSP Complex to Real DSP blog DSP Guide DSP Tutor DSPRelated

DSP GuideDSP ANALOG & DSP Complex to Real DSP blog DSP DesignLine DSP Tutor DSPRelated Octave Octave-Forge

DSP Tutor& DSP Complex to Real DSP blog DSP DesignLine DSP Guide DSPRelated Octave Octave-Forge FPGA FPGA

DSPRelatedComplex to Real DSP blog DSP DesignLine DSP Guide DSP Tutor Octave Octave-Forge FPGA FPGA Central

OctaveReal DSP blog DSP DesignLine DSP Guide DSP Tutor DSPRelated Octave-Forge FPGA FPGA Central General Amit

Octave-Forgeblog DSP DesignLine DSP Guide DSP Tutor DSPRelated Octave FPGA FPGA Central General Amit Agarwal –

FPGADSP Guide DSP Tutor DSPRelated Octave Octave-Forge FPGA Central General Amit Agarwal – Digital Inspiration

FPGA CentralDSP Guide DSP Tutor DSPRelated Octave Octave-Forge FPGA General Amit Agarwal – Digital Inspiration Enchanting

GeneralDSP Tutor DSPRelated Octave Octave-Forge FPGA FPGA Central Amit Agarwal – Digital Inspiration Enchanting Kerala Get

Amit Agarwal – Digital InspirationDSPRelated Octave Octave-Forge FPGA FPGA Central General Enchanting Kerala Get smart with the Thesis WordPress Theme

Enchanting KeralaFPGA Central General Amit Agarwal – Digital Inspiration Get smart with the Thesis WordPress Theme from

Get smart with the Thesis WordPress Theme from DIYthemes.

dspLog - All rights reserved. Copyright © 2007–2011

http://www.dsplog.com/2009/01/04/viterbi/

No content on this site may be reused in any fashion without written permission from http://www.dspLog.com.