 Okay, so this is lecture 30. Okay, so the last thing we were looking at was convolutional codes, encoders for convolutional codes I think stopped at the trellis, they describe trellis and we stopped that. The encoder for convolutional code can be conveniently described by this generator matrix, generator matrix in the D-transform domain, in the D-transform domain and in a typical situation it would have g what did I call it, 0d, this is what I called it, g0d, g1d, so on. Okay, so let us say till g, gm, m is not a good word, you can eat a, m-1, okay, you like m, you do m. This would nicely describe encoder for a rate what? Rate 1 by m convolutional code, convolutional encoder. So remember I have not really defined what a convolutional code is, this is the distinction between the code and the encoder you might remember, but we will just bother about the encoder and not worry about the code as much, it is a strict way of properly defining it and code becomes linear and all that nicely happens, but I will just gloss over it. When we saw there are a few other things that are important, number of states is very important, how do you compute number of states? Number of states, 2 to the power, number of memory elements, right, number of memory elements and in the example we saw the number of memory elements was 3 and it was an 8 state encoder, okay and then next thing that is important is the trellis representation, okay and it is nothing but a state diagram with the time axis, right, so you do the state diagram with the time axis. There are a few things that were illustrated in the trellis representation, the first thing is paths correspond to codewords, right, so each codeword is split into several stages, the output you get in each stage, all of that is put together in one path and you get a codeword of the entire convolutional code that goes out, okay, so paths and codewords have a correspondence and each path is made up of what? Path is a, well there is another terminology here, each path said to be a sequence of branches, okay, so in each stage you have a branch, you have branches, several branches and you put a whole bunch of branches together in a valid path, you get a path in the trellis and each path will correspond to a codeword, okay, so all that you can see easily. There was this other notion with respect to the trellis which was a termination, right, suppose you have k input bits, after your k input bits are, have been clocked in, you have to clock in as many zeros as the number of memory elements to drive yourself back to the all zero state and we are only looking at convolutional codes like that, okay, so we do not want to see something else that is happening, so that is an extra say mu bits, so this number of memory elements I will denote as mu, okay, so extra mu bits, mu bits get clocked in, okay, so that will correspond to an extra m times mu bits that came out, so your entire encoding will take you from k bit message to what? It is not simply k times m, it is k plus mu times m bit codeword, okay, so this is because of the termination, all zero to all zero termination, okay, so once you do this it is fine, so one can if you want list out all the codewords for, of the convolutional code, that is possible, okay, is there a mistake here or fine, k plus mu times m, okay, so one can list out all the possible codewords of the convolutional code by considering all the possible messages and you can even think of it as a block code in this format, once you fix the message length it becomes like a block code, you can even think of it that way, okay, so this is a brief look at what we saw, so I am going to do one more example for a four state encoder which is easier to plot and all that, so in an example four state is always easier than each state, you might remember I was struggling last class by doing all these arrows, it is too painful, four state is very easy, so we will look at a nice and simple example for a four state encoder, it will take g of d to be one plus d plus d squared, then one plus d squared, okay, so this is my generator matrix description, from here I can go very easily to the actual encoder, I have two d flip flops, already conclude there were two d flip flops, d squared is the maximum term that shows up, so the only delay, the maximum delay I will have to do is by two time units, nothing more than that, once I do that and what is the rate of this encoder, rate half, right, one by two encoder, you have, you will have two XOR gates, one here, one here, the first XOR gate is connected to all, well the input and the two state bits and the second one is connected to the input and the, and one of the stateless, okay, and you get your two outputs, this will be your sequence U, this is your sequence V0, this is your sequence V1, okay, it is a very simple diagram for a four state encoder, so I am going to do a trellis now for this, okay, I will do, I will do a very simple, I will do the complete trellis, I will not start at all zero and do the slow thing, I will do the complete trellis, it is not too difficult to do, okay, so there are four states, how did we index them, 0, 1, 2, 3, okay, so I can do that, right, this is 0, 1, 2, 3, again you need a convention for the sequencing, right, so we always did S0, S1, okay, so stick to that, okay, the state is S0, S1, okay, so when I say state is 1 what do I mean, S0 is 0 and S1 is 1, okay, that is what I mean when I say the state is 1, when I say the state is 2 what do I mean, S0 is 1 and S1 is 0, okay, so you have the same states here, okay, so once I know it is a four state encoder and once I know there are no feedback elements, it is just feed forward elements, the transitions are easy to write down, okay, the edges are easy to put down, the branches are easy to put down, you do not need any more information for the branches, okay, you need more information for the outputs, okay, so for the branches it is very easy, for instance from the all zero state what are the other states you can go to, 0, 0 and 1, 0, which is 0 and 2, I cannot go to anything else, okay, so that is very easy to write down and even the inputs can be written down, this will happen with input 0, this will happen with input 1, okay, the only thing you cannot write without any other information is the output, without knowing the G of D completely, okay, now that we know G of D completely you can easily write down, what will be the output for 0, 0, 0, for 1 it will be 1, 1, okay, that is very easy, what about from state 1, 1, 0, the same two states are reachable from state 1, okay, and what about input output, 1 would be 0, 0, okay, what about from 2, well it is so clear, only from 2 it can only be 1 and 3, so these things will have to be nice and symmetric, they cannot be, cannot take arbitrary shapes, so, okay, only thing to figure out is 0 would be 1, 0, then 1 would be 0, 1, okay, so for 3 when 0 is input 1, 0, 0, 1, 0, 1 and for 1 it would be 1, 0, okay, so that is my trellis, complete stage of my trellis, okay, so out of each, well, each state, each state on the left hand side, how many branches go out, 2, okay, corresponding to the input 0 and input 1, okay, and into each state on the right hand side, how many branches come in, 2, okay, and in this case for the feed forward case, both those branches that are coming in will correspond to the same bit, okay, it will be only 0, okay, it is very clear because as 0 will have to be equal to the bit that came in last, okay, so from that you can easily conclude what bit that will be, okay, so these are all sanity checks, you can see that that is satisfied, if that is not satisfied then you have made some goof somewhere, you know, simple checks that you can do to check that things like that come up, okay, so for instance there are a lot of definitions that one can do, okay, one can say the next state when the present state is 0, what are the two next states possible? 0 and 2, okay, so you can call them next states and from 0, what are the two, if corresponding to 0 on the right hand side, what are the previous states that are possible? 0 and 1, okay, so all these things are possible previous states, possible next states, okay, so all these will depend on this particular trellis, okay, so simple thing to write down, okay, so what is very nice about the trellis is it is very easy to visualize your decoding happening on the trellis and as I said the trellis is used for doing maximum likelihood decoding for convolutional codes, okay, so that is what we will see next, maximum likelihood decoding for convolutional codes, okay, which is called the Viterbi decoder, okay, so I will not prove any difficult properties for the Viterbi decoder, none of them are very difficult, it is very intuitive, I think most of you must have already seen the Viterbi decoder in one form or the other before, so I will just describe it and then give you a justification for why it works, okay, and then we will just take it from there, it is not too difficult, okay, alright, so first we need a whole bunch of notation to set up the whole issue, so I will say I have a rate 1 by m convolutional encoder, okay, I will say memory is mu, okay, so these two things I say, I am going to use, I am going to look at a message which is, I will start with u1 just for convenience, u1, u2, all the way to uk, sending out k messages, what will be the code word corresponding to this, okay, so I will have to write down V0 1, V1 1, V0 2, V1 2, okay, all the way to what, V0 k, V1 k and then what, you will do more, right, so I have to go all the way from V0 k plus 1, V0 k plus, I am sorry V1 k plus mu, all the way to V0 k plus mu, V1 k plus mu, okay, so that will be my code word, right, so imagine that this code word is being transmitted through with BPSK modulation over AWGN, okay, oh I guess I have done rate half, so I will have to do, okay, let us say I am doing this for rate half, okay, so if you have rate 1 by m what should I do, V1 I will go all the way to m minus 1, okay, so maybe I should have done that okay, so I will just do rate half and then I will mention wherever the change is needed, I will tell you where the changes will bring in, okay, so excuse me for that, should have seen that happening, let us move it and see it, just round on V0 and V1, this for rate half, if you have rate say 1 by m then this will go all the way from V0 1, V1 1 to Vm minus 1 1, okay, so that is how it will go, so we will have, sorry, so the received word corresponding to this, okay, I am going to call it in a similar way R01, R11, R02, R12, R0k, R1k, R0k plus 1, you know, the whole thing, I need the whole received values, all these received values are quite meaningful even though I knew, okay, so our goal is to find only U1 to UK, right, I do not care really about anything else, I only want to find U1 to UK, okay, so you see there is a very natural and simple way to associate, since this entire received vector R can be broken down into stages of the trellis, okay, so if I now write down the trellis, entire trellis, I will start with the all 0 state, okay, in the first stage what would have been the received values, R01 and R11, right, those would be the received values corresponding to the first stage, okay, corresponding to the second stage of my trellis what would be the received values, R02 and R12, okay, so likewise, okay, so I can associate each of these received values to different stages of my trellis, okay, exactly like what I did with my message with my message and code word bits, right, each of these were associated to particular stages of the trellis, I will do the same thing, okay, stage k, this one is stage k plus, okay, so once you do that you can imagine doing decoding on the trellis, but before we go there I want to first write down the ML rule and then try to simplify that and then see how that works out with respect to the trellis, so what is my ML rule, maximum likelihood rule for BPSKWG and actually I can simplify it to the correlation, maximum correlation, but we will just keep it as minimum distance just for now, okay, so what should you do, you should do argument of the minimum over all symbol vectors, all code symbols, what should you minimize, R minus s square, okay, so the square Euclidean distance you have to minimize, okay, so let me try to write this down, you will see this is actually a summation and you can even split that summation over several stages, okay, so we will do something like that, okay, we will see what each thing contributes and we will try to do, we will try to break it up, break up this minimization into a minimization done recursively over stages, okay, so that is the whole point of the Viterbi decoder, we will try to do that next, okay, so let me look at this, R minus s squared is a summation from i equals 1 to k plus mu, okay, R 0 i minus s, I need some notation, I will just do s 0 i square plus R 1 i minus s 1 i square, okay, can I do that, so what is this s 0 and s i, this s I have split as what, s 0 1 s 1 1 s 0 2 s 1 2 all the way to s 0 k plus mu s 1 k plus mu, just like I split V, I can split s, what is the relationship between s and V, the BPSK relationship, 0 goes to plus 1 and 1 goes to minus 1 that is all, so this is how I have split the symbol vector and you see naturally the summation nicely breaks down into a summation over several stages, okay, in each stage, see this is a term that corresponds to a particular stage and more specifically in that stage it corresponds to each branch, okay, each branch of a stage corresponds to different possible values for s 0 i and s 1 i, okay, so let us focus on that a little bit, if I look at stage i, okay, an arbitrary stage i, I am going to have just for simplicity I will stick to the state, four state encoder, okay, so the same thing will work for any number of states, I will just use the four state encoder for reasons of simplicity, okay, so there is no reason why it will not work for anything else, I can also do a general diagram but it is just more of a distraction than anything else, so my diagram is going to look like this, right, okay, this is how my diagram is going to look in stage i, okay, corresponding to stage i what are my received values r 0 i and r 1 i, okay, so this is common to the entire stage but each branch of the stage corresponds to different possible values for s 0 i and s 1 i, for instance here we wrote what, 0 0 0, so that branch actually corresponds to plus 1 plus 1, okay, so here we wrote 1 1 1, so this branch actually corresponds to minus 1 minus 1, okay, different possible values for s 0 i and s 1 i, okay, so in each stage that is what corresponds to, okay, so the next useful definition when using this well is to define something called a branch metric, in each stage you want to compute a metric for the branch, okay, so this term for each branch, you compute that term and keep it ahead of time, store it ahead of time that is called a branch metric, okay, so that is what we will define next, so branch metric, okay, each branch corresponds to a particular value for s 0 i and s 1 i, okay, the branch metric, okay, maybe bm for short is basically r i 0 minus s i 0 squared plus r i 1 minus s i 1 squared, that is my branch metric, okay, so if I give you actual specific values for r i 0 and r i 1 say 0.5, 0.4, okay, you can compute the exact branch metrics for each of those branches, okay and it is very typical in doing the bit by bit decoder to actually write the branch metrics on top of each branch, okay, on the encoding side we wrote this 0 given 0 0, on the decoding side it is more common to write the branch metric on each branch, you already have the r i s and you know the branch metrics are what will appear in the decoder, okay, that is what you have to try to minimize etc, okay, so you write the branch metric on top of each branch on each stage, just write down the whole thing, okay, so there is no big calculation here if you think in complexity, in terms of complexity for each stage your complexity is 2 power mu, okay, it is not growing with n which is your block length, okay, it is not with k which is your message length of block length or whatever, it is only 2 power mu, so it is not very complex, okay, typically ML decoder what do you expect the complexity to be, 2 power k right, 2 power k, 2 power n that is the kind of complexity, it is only 2 power mu and if it is 4 state 8 states it is not too difficult to imagine, okay, so at least this computation is not too bad and you can do it, okay, so that is the branch metric, okay, so the next definition is, next definition is for path metric, okay, very easy definition, okay, what is the path after all, sequence of branches, what will be a path metric then, add up all the branch metrics, okay, so path is branch 1 comma branch 2, so on till let us say branch, I do not know some a, okay, path metric equals summation of branch metric of branch i, i goes from 1 to a, okay, so now remember this path need not be a complete path which actually corresponds to a full code word, okay, so I have not said anything about this path corresponding to a code word, what can I do is I can define this for any path that starts anywhere and ends anywhere as long as it is a valid path, so remember from one state I cannot go to all the four states, it has to be a valid path on the trills, okay, so it should be a valid proper connected path and any partial path I can define a path metric, nothing wrong with this definition, okay, so every path this way will have a starting state and an ending state and several states that it will go through, so I can also describe the path as a sequence of states, okay, right now I wrote down as a sequence of branches, I can also write down the path as what, same path can be written as a sequence of states, okay, so how many states will I need if I have a branches, a plus 1, right, so you have a starting state and then every branch will introduce one more state, okay, the starting state is there and then every branch will introduce one more state, so you will have a plus 1 state, so I can describe the same path as state 1, state 2, so on till state a plus 1, in this description it is the restrictions imposed by the trellis will be slightly clearer, for instance if state 1 is 0 what can state 2 be? 0 or 2, right, I know that, so in branches maybe I do not have notation for the branch but the states are very, very easy to write down, okay, so now the path metric will be what, the exact same thing except that instead of describing, okay, instead of writing down branch metric of branch i, I am going to say branch metric of the branch that connects state i to state i plus 1, I will simply call that state i connects to state i plus 1, okay, so these are all notations, I mean one can have so many different fancy notations for the VWD code of it, just to get the terminology out and the way you think about how the minimization happens, there is nothing more beyond that, okay, so this is a very common way of thinking of a path, okay, so sequence of states that correspond to a valid path on the trellis, okay, so that is one other definition, okay, so now my ML decoder, right, so the next thing is what is this path metric now, suppose I actually have a complete path from all 0 state to all 0 state that corresponds to a valid code word, this path metric will be what? It will be the actual thing I compute in my ML decoder, mod r minus s squared, okay, so what will be mod r minus s squared? It will be equal to the path metric of the path corresponding to s, okay, so that is the next thing, it is very easy to see that also, equals path metric of path corresponding to s, okay, all these things are quite elementary in hindsight, but believe me on the bitter decoder was introduced all these quite fancy corresponding to s, okay, you know s corresponds to a code word, that code word definitely corresponds to a path on the trellis from the all 0 state to the all 0 state, so if you do the that path and compute its path metric, it will be exactly equal to mod r minus s squared, okay, so now I can describe my ML rule as minimize argument of the minimization over paths path metric, okay, so that is another thing, the path metric, okay, I know every path corresponds to a valid code word, I can go back to the code word or the message sequence once I do that, okay, so this kind of a description on the graph is very intuitive and nice and clear to see and you will see it will simplify the way you think and implement your algorithm drastically, okay, so you will see 2 power mu is pretty much the complexity you need, 2 power k will disappear, be something like k times 2 power mu as opposed to 2 power k, which you normally think of the ML decoder, right, you go over all the code words, you do not have to do that, you can do it stage-wise and the only complexity you will encourage is 2 power mu and not k, not 2 power k, okay, so that becomes a very useful device, okay, so the crucial argument in seeing how that happens is instead of minimizing over all the paths in one go, just blindly computing the path metric for each path, you try to concentrate on a particular state at a particular stage and look at all the paths that pass through that state, okay, so that is what I am going to do, I have, this is kind of the argument for the Viterbi decoder, I will try to write down the decoder formally, it is not very difficult to write down, but first I will give you the argument for the minimization, which you can see, this is the argument for the Viterbi decoder, okay, so you know you started at the all-zero state and you know you ended at the all-zero state, this is stage one and this is stage k plus mu, okay, right, in some stage i, in intermediate stage i, okay, you actually have the trellis, right, okay, so let me write down, once again I am using the, I am using the four state thing just for illustration, the same thing works on anything else, okay, so you can see I am struggling to draw even the four state one, so we will not try to draw anything else that is fancy, okay, so here is the argument, okay, suppose I focus on say this state, okay, so I focused on this state, okay, okay, some particular state at, okay, some particular state at some particular stage, okay, so at a particular stage i, I am focusing on a particular state, right, so now I ask the question out of all the paths that pass through this state, okay, suppose I want to minimize the path metric, I want to find that path which would have the least metric, okay, so that is the question I am going to ask, you might ask me what is the relationship between this and the ML rule, of course, there is a close relationship, we will see that soon enough, okay, so if I say, suppose I identify the state as some s i, okay, state i, maybe I will write it as state i, you will see there will be a nice simplification that will happen, okay, suppose I ask this question, I want to find argument of minimization over all paths that pass through state i, okay, which is in stage i, which is on the right hand side of the stage i, okay, path metric, okay, you will see this problem can be done in two stages, I do not have to look at all the paths, find the complete path metric, okay, and then do it, I can do from stage 1 to stage i, and then stage i to stage k plus mu separately, and then add both of them, okay, that was made possible because I insisted that every path has to go through state i, it has to go through state i, so what will happen, you will be looking at a whole bunch of paths which intersect like this, okay, some paths here and then a whole bunch of paths which intersect here, so the path metric here will be equal to the path metric from, for every path the path metric will be equal to the path metric from stage 1 to stage i, then stage i plus 1 to stage k plus mu, and why is it that I can do the minimization separately, so it is very clear because they intersect at state i, right, all of them have a common state i, so this term has to go through this, okay, so it is enough if you do, let me change my pen colour, okay, so looks like I cannot change my pen colour, okay, suppose I have the red path here, red path here, okay, what is the red path now, okay, so this is for the, this is the argument for the, so this is the question that I am going to ask now, I am going to ask two other problems, okay, so one is you do the argument over minimization, sorry, so you will say paths from 0 to state i, okay, so I think I am getting two clumsy here, so let me just move to the next page, I think it is probably a better way of doing it, I am going to ask another question now, I am going to say, let us look at this thing, partial minimization, okay, so you minimize over paths from state 0 at stage 1, okay, so well at stage 1 to state i after stage i, okay, if you do this minimization of path metric, okay, you will get something, okay, so this is what I am going to call as P1, okay, this is what I have drawn in red here, this guy is P1, okay, so instead of worrying about the path from state 0 all the way out to state 0, I am going to say let me stop at state i and only look at those paths and do a minimization, okay, suppose I did that somehow, okay, I am not claiming that is very easy but maybe I did that somehow, if I did that and then maybe I also did a similar thing from state i to state 0 after stage k plus mu, okay, maybe I did that also, okay, so maybe I did that also which will be very similar to this, so I am going to cut and paste from here, suppose I did the same thing, okay, state i after stage i to state 0 after stage k plus mu and then maybe I got path P2, okay, those two paths are shown here in red, okay, I am going to claim this guy, this minimization is equal to just an adjoining of P1m, okay, so you can see why it has to be true, okay, it makes a lot of sense, you have your force to go through state i, nothing else you can do, so you better pick the least path that goes there and then pick the least path again, so very intuitive and clear but you can also rigorously prove it, you assume there is another path here which could have been chosen and then you will see that path metric will really be not the largest one, you can take P1, P2 to be the largest, okay, so it is a very simple argument but this argument tends to simplify ends up simplifying the whole thing, if I do not place this restriction on passing through state i, I cannot make this argument, okay, you can easily convince yourself so that is true, if I do not fix the particular state on which through which it has to pass through, I cannot make this splitting argument, once I force that I can do this, so what the Wittebi algorithm does is, does this calculation of P1 for each state i in each stage recursively stage by stage, once you keep doing that by the time you end up with the last one you will automatically have the minimum path, okay, so that is what the Wittebi algorithm does, so I will try to quickly write down the formal procedure for what you do in stage i, okay, it will be quite clear and then we will see a couple of examples of how to do the Wittebi algorithm, maybe next class and that will be the end of this discussion. Okay, so here is the Wittebi algorithm, okay, so I think the best thing to do is to start with an example, I think that is the better thing to do, let me start with an example, go through that, yes, so you want to do it in reverse kind of, okay, okay, yes, so okay, so maybe I will describe the example and then after that you can ask this question, because I think the question is clear to me but let me answer it after I talk about the example. Okay, so the next thing I am going to do is an example, so suppose we use this four state code that we have, maybe the received value is, I don't know, we will just pick some values, 0.5, 0.7, minus 0.1, what more do you want, minus 0.5, how many ks do we have to transmit, so I have a memory 3, right, so I think I need quite a few, so maybe I will run out of time, so we will see, so I will just do it for a few states, okay, so we will make up values as we go along, okay, so I will draw it on the trellis, I think that is easier, okay, so the first stage, stage 1 will have what, just two branches, okay, so you went from 0 to 0 or, oops, something very crazy is happening, it is just refusing to do something, okay, so let me try something, let me just go to the next page and hope everything works out as planned, okay, so here is an example, okay, so I am going to say, okay, so initially I started the algebra state and then I have to compute the branch matrix, right, so that is the first step in the Wittebi algorithm, so you compute the branch matrix, so maybe this is 0 0 1 1, so maybe the received values here were 0.5 and 0.7, okay, so let us do a quick computation, what will be the branch matrix for the top 1 and the bottom 1, I do not think you need a calculator here, you can do a computation, 0.34 for the top 1, is that fine, okay, so 0.34 for the top 1 and then for the bottom 1 you would have, what happened, 0.34 is not correct, 5.49 for the bottom 1, yeah that makes sense, I do not know, 1.5 square is what, 2.25, right, plus 1.7 which would be 2.89, so it cannot be 5.49, 5.14, okay, so it does not matter really, but so you imagine the kind of computation that is required, okay, so now you begin by asking the same question, so which path to state 0, okay, to state 0 after stage 1 would give you the least path matrix, so if you ask that question, sorry, how do you get 5.04, you tell me, no, see 0 goes to plus 1, 1 goes to minus 1, okay, so you have to do the BPSK modulation, do not do it with 0 and 1, is it okay, you are okay, all right, so now you ask the question, you fix yourself at state 0 and then say which is the least path metric path that would have come here, there is really no question, you already know what that path is, so you just take your red color and color that path, okay, so now you ask the same question for state 2, there is really no question to ask, that is your this path, okay, so it is useful, you will see as you run this algorithm to have the path metric for your best paths also stored readily, okay, so you will see that is very useful, okay, as you do the computation, so it is very common to compute the path metric of the best path to state 0 and write it down right below state 0, so that would be 0.34, okay, so here the path metric for the best path to state 2 is 5.14, okay, so these things have a name, they are called state metrics for instance, okay, so if you want you can call a state metric or just for convenience to compute your next path very easily, okay, in the next stage of metro list I would have four states, okay, and the transitions would be from 0 it goes to 0 and 2 right and from 2 it goes to 1 and 4, okay, so maybe my received values were minus 0.1 minus 0.3, okay, all right, so now first step in each stage is to compute the branch metric, so you go ahead and compute the branch metrics for each branch, okay, so if you want some help with the outputs, I guess it is, you do not have to write for some things, 2.7 or 3.7, 2.7, 2.8, 2.9, yeah, 2.9 for this one, for this one it is 1.3, am I right, okay, so these two what are the outputs, 0.1 and 1.0 if I will not write, 1.0 and 0.1, okay, go ahead and do that, 2.5 and 2.5 and 1.7, fine, so now I ask the same question again, after stage 2 suppose I focus on this guy, okay, what is the path, what is the minimum path, there is no real question, because there is only one branch coming in, so I do not have anything else to say, so I will just pick my red pen and select this, so I can continue, I can do the same thing for every state, because there is only one path that comes into every state, no, so that has to be the minimum path, there is nothing else that one can do about it, so I can just paint everything red, no problem and then continue to write down the, that minimum path metric below each state, okay, so this would be what, for first path is 2.9 plus 0.34 which is 3.24, am I right, this one would be 7.64, this one would be 1.64, this one would be 6.84, so that is it, you see how easy it is, nothing difficult about the WD code, it is just addition and squaring, I think more is required, okay, so running out of time slowly, but let us do one more stage, you will see something interesting happen in the next stage, I hope, okay, so next stage you have many more transitions, but just us do it carefully, so many other transitions are there, but let me just focus on these two right now, these four right now, do not do the remaining, just do these four, just to see some clarity and then we will proceed for it, okay, can you find the branch metrics for these things, I have to give you the received values, I will say received values are 0.5 minus 0.5, what are the branch metrics for 00, do not be so sure, what is the top 1, 2.5, 2.5, okay, what about the next one, okay, all these four will be 2.5, am I right, okay, so I guess then this is a bad example, so let us change one of these values, maybe I will make it 0.1, 0.5, 0.1, okay, I am sorry about that, so redo the computation a little bit, I do not want all of them to be 2.5, just for fun now, it is not, they can be 2.5, okay, what do you get then, 1.06, bottom 1, 3.46, okay and 3.46, 1.06, am I right, okay, so you see there could be smart ways of simplifying a calculation when you implement, right, for each branch metric you do not have to do the same computation over and over again, several branches would have the same metric because they have the same output, same metric has to be there. So now let us ask this question, let us focus on stage 0 after stage 2 and try to ask the question, what is the minimum metric path that will end at stage 0 after stage 2, if I ask that question now, you see there is a very interesting way of answering that question. I know there are two possible ways in which I could have come to stage 0, okay, one way would have been to be at stage 0 before, okay, our state one before and I know what the best way of getting to those states are, okay and then I use my property that once I know I have to go through state 2 or state 1 at a particular stage, I can split my minimization into two different stages, so here the second stage is very trivial, it is just only one branch, right, so I split it into two stages, one stage is already solved, I know already what the best path is to end up here, I will simply look at the next one and add it, okay, so here what happens is the first path is going to give me a overall metric of 3.24 plus 1.06 which is 4.3 and the bottom path is going to give me a metric of something much larger than that, 7.64 plus 3.46 which is some 11 point, so out of these two paths I will only pick the top one and not pick the bottom one, so when I pick my red pen now, I am going to just shade this guy and then say my branch metric is, my path, my metric after that is 4 point, the other transition I will disallow, okay, so disallowing transitions like this is very key to the Viterbi algorithm, for the next stage also one can do it, you will see the top one once again qualifies, okay, so it has got slightly lesser, so you see these two are the two points, okay, so one can do a similar thing for these two things, okay, so for these two also what will happen, the two transitions are this and this, you will get a red somewhere, so I am going to stop now, we will pick up from this exact same point to move.