 Welcome back to this lecture on digital communication using GNU radio. My name is Kumar Appaya and I belong to the Department of Electrical Engineering at IIT Bombay. In this lecture, we will continue our discussion of bit errors and symbol errors for various constellations. In the last lecture, you have seen how we can compute the energy of a constellation, how we can make the constellation points have a required energy. For example, scaling it appropriately and we have computed the symbol error rates for both BPSK and PAM4 and we got an overall idea of how we can compute it for other linear constellations also. Today, let us begin our discussion with the symbol error rate for QAM4. QAM4 is our first discussion on a constellation where you have the I and the Q that is consists of complex symbols unlike PAM4 and BPSK where the symbols were all real. In this case, let us again see how we can compute the average energy of a constellation. So, let us say that we have QPSK or QAM4 both mean the same thing, this, this, this, this. Once again by the arguments which I made in the previous class, it is optimal for you to center the constellation, taking the constellation to a particular point where even if it is symmetric, the center is not the origin will end up making you spend more amount of energy for the same amount of bit error rate or for the same energy, you will have a poorer bit error rate or symbol error rate rather. So we know what the QPSK constellation is. So let this point be alpha, alpha or alpha plus j alpha, this is alpha minus alpha minus alpha minus alpha minus alpha alpha. All the four points are equiprobable, therefore the amount of energy spent in sending this particular point is alpha square plus alpha square by 2 because if you do mod of alpha plus j alpha square, you also get the same thing upon 4 rather because 1 fourth is the probability of sending it plus for this also it will be the same, for this also it will be the same, for this also it will be the same. So let me not do plus, so let me instead just do multiplied by 4 which is 2 alpha square. Now I want my 2 alpha square to be equal to the ES, that is I have my desired signal energy to be ES, 2 alpha square is ES, so alpha is root of ES upon 2. Therefore my points are root ES upon 2, root ES upon 2, minus root ES upon 2, root ES upon 2, root ES upon 2, minus root ES upon 2, minus root ES upon 2, root minus root ES upon 2 which is actually what I have drawn over here. And I have deliberately chosen these values to have a unit energy, a constellation of energy ES. Now I have deliberately highlighted the areas in grey and white and there is a reason why. Let us say that we send this particular constellation point. What is the noise that affect this constellation? In this particular case, the noise is actually complex additive white Gaussian noise which basically means that this point you can think of a two dimensional Gaussian which is standing on top of this point which can take this here, here, here, here or in any direction with equal in an equally probably fashion, equal probability fashion. So you can have multiple events which correspond to having an error. So I have deliberately drawn it in this way, so that if you go this way you end up with an error. If you go that is your, let us give the symbol some number. Let us call this symbol you know a 1, a 2, a 3, a 4. That is a 4 being mis-detected as a 1 is an error, a 4 being mis-detected as a 3 is an error, a 4 being mis-detected as a 2 is another error. So there are three possible error, symbol error events in the case of QAM4. Now we can compute all of these separately using an approach and things like that but I think that is very cumbersome and there is a better way. See if you look at a simpler approach, you can think of this particular constellation point just going to see, let us look at it in terms of quadrants. If this particular constellation point which is in the I think 1, 2, 3, 4th quadrant ends up in the first quadrant or second quadrant or third quadrant there is an error. What if we could easily compute the probability that a 4 is mis-detected as a 1 or a 2? That is easier because that just means that the, that just means that the constellation points has moved right enough so that it is either in a 2 or a 1. That is it is moved here, here, here, here, here, here, here or somewhere here, somewhere in this region. The reason a 1 or a 2 is to be computed is very easy, we only need to look at the I part that is we only need to take into account the real part of the constellation. That is in other words all we need to look at is has the real part of this particular constellation received value has it moved by more than d upon 2. The reason d upon 2 is because the distance from the vertical or y axis is d upon 2. Therefore, the probability that, let me again mark them a 4, a 1, a 2, a 3, probability that a 4 gets mis-detected as a 1 or a 2 is not surprisingly you have to use q of d upon 2 sigma, ok. q of d upon 2 sigma, d in this case is root s upon 2 times 2 so it will be root of 2 Es and we always assume that the noise per dimension is n naught upon 2 so we are going to just call it. That is because we are only taking it into account the real part, the real part is affected by a real Gaussian whose variance is root of n naught upon 2 and the distance is root Es upon 2 times 2 because this is root Es upon 2 this is minus root Es upon 2, ok. Now, similarly if you compute the probability that a 4 gets mis-detected as a 3 or a 2 again you are not surprisingly it will be the same thing. Now, if you want to compute the probability that a 4 is mis-detected in general because you can now use your basic probability axioms let us say this is an event you know this is an event you know E 1 this is event E 2 probability that you know you will have a 4 in error is basically the union and you can use the use the fact that P of E 1 union E 2 is P of E 1 plus P of E 2 minus P of E 1 intersection E 2 and that way you can subtract this common probability out, ok or if you want to do it in a simpler way you can just write your q's as well and do it. So, the other the straightforward approach I will leave it to you is to essentially take into account the fact that it goes here how will it go here? You will have to move along the to towards the right along you the along towards the right implies that the real part has to undergo a change of d by 2 or more the imaginary part should not undergo a change of d by 2 or more you know and for this it is the same for this both the real and imaginary parts undergo a change of d by 2 or more that is basically because you have to move to the right by d by 2 and bottom by d by 2. So, if you want to compute it the direct way you can just go ahead and do so in this case I have done it for you it is 2 times q of root of E s upon n naught minus q of root of E s upon n naught the whole square. So, you can actually just you can actually verify there may there may have been a slight scaling in the calculation we can verify that this is indeed the case the and the reason why this minus comes about is because this particular area is common. So, to maybe just give you a hint on how you can do this calculation in this case let us say you have d d is in this case root of 2 E s at the mistake it was d by 2 sigma. So, I will do it correctly this time d is root of 2 E s and for this particular event to happen ok you have q of root of 2 E s by 2 root of n naught by 2 that gives you q of root of E s by n naught that is the probability that the real part moves by d by 2. Then the imaginary part should not move by the same. So, for that you will have to essentially do q of root of E s by n naught times 1 minus root of E s by n naught. Similarly, for this you will have another and you will have the third term which so let me just do it for you. So, the this particular probability going here is q of root of E s upon n naught into 1 minus q of root of E s upon n naught why real part moves by d by 2 imaginary part does not move by d by 2 that is what this is. I am just sticking a 2 here the reason is because the same value will appear for here and for this one both of them move by the same d by 2. So, you will have plus q of root of E s by n naught the whole square and if you expand this you get 2 q of root of E s by n naught minus 2 q of root of E s by n naught the whole square plus which gives you this particular expression. So, this is the way in which you can calculate the symbol error rate for quam 4. Now, you can also approximate it as 2 q root of E s by n naught and it is reasonably tight when you have high SNR scenarios. Now, let us go to a slightly more complicated constellation that is quam 16. In the case of quam 16 we have 16 particular symbols and quam 16 you know you may you know in the case of pam 4 I said packing more leads to higher errors all those quam 16 is actually quite popularly used especially when you have sufficient amount of SNR. It allows you to pack a lot more symbols in fact, lot more even when compared to pam 4. Now, you can see there is some relationship between quam 16 and pam 4. In fact, let me go a step back if you look at this particular you know quam 4 right it looks like this particular part looks like a BPSK and this particular part looks like a BPSK also. So, you can think of a quam 4 as a combination of 2 BPSKs one on the real part one on the imaginary part right. So, one part decides whether it is the left or right of the x axis one part of the y axis one part decides whether you are above or below the x axis. In a similar fashion quam 16 also looks a lot like 4 pam 4 right because 1 pam 4 decides which vertical height you are in 1 pam 4 decides which horizontal point you are in. Let us quickly do the computation of the symbol energy for quam 16. Now, for quam 16 right there are 16 points 1 2 3 4 5 6 7 8 9 10 I am drawing them roughly because I do not I am not going to use all of them again we are going to make the assumptions that we are centered around the origin. So, let me call this point 3 alpha comma 3 alpha this is 3 alpha comma alpha is alpha comma 3 alpha and is alpha comma alpha and I have to find alpha if all points are equiprobable. So, that I get energy ES. So, now here is what I am going to do I have these particular points. So, now 3 alpha 3 alpha right fine. So, what is the amount of energy and I am not doing it for the rest because I am just going to do 4 times because the energy is going to be the same because their distances from the origin are the same. So, fine 3 alpha 3 alpha 9 alpha square plus 9 alpha square upon 16 I will write at the end plus 3 alpha alpha 9 alpha square plus alpha square alpha 3 alpha alpha square plus 9 alpha square alpha alpha square plus alpha square all divided by 16 multiplied by 4 because there are 4 I do not want to write all the terms you get the same thing with the negatives and all those things. So, let us do this calculation 9 plus 9 18 20 I get 40 I think I get 9 plus 9 18 20. So, 40 alpha square divided by 4 is equal to 10 alpha square is equal to ES. Therefore, not surprisingly your alpha is equal to root of ES upon 10. This is what I have mentioned as a summary over here I have not taken alpha I just took you know alpha as 1 I just did 4 times 3 square plus 3 square plus 3 square plus 1 square plus 1 square plus 3 square plus 1 square plus 1 square and I got 10 basically I got 10 alpha square, but yeah I just wrote it as 10 I have to scale my constellation by root ES by 10. So, if you normalize it you get plus r minus 3 root of ES upon 10 plus r minus 3 root of ES upon 10 and similarly all the constellation points are there. So, while you know it looks like a messy constellation, but it has its advantages because if you think about you know sending bits which we have not yet looked at you are able to send 4 bits in one symbol. In the case of Pam 4 you are sending 2 bits here you are sending 4 bits in one symbol. So, it is quite an advantage. Now, I have deliberately marked these you know these 3 particular points in different colors this is a red one this is I think some light blue this is violet these are the only 3 points for which you need to compute the symbol error rate why because all the other points are alike or you know like one of these 3. For example, if you look at this point these are similar right they are all they will all have the same similar error by symmetry. This point all 8 of these are similar. So, they will have the similar symbol error and finally this point will have the same similar errors these these these. Therefore, I am going to consider the computing of the symbol error rate only for 3 of the points and even that I am going to let you do it, but let me tell you how you can look at it. So, the way to look at it is this particular distance is d ok that distance is d this particular distance is the same d ok I chose the constellation in that way right. So, I have my ds 2 root e s by 10 and this particular constellation point also has the same, but let us now look at the error events. For this particular point error has happened when you go this way this way or this way this e really looks very similar to our qpsk point. It is in fact very similar you can compute the error events for this exactly like you do for qpsk. In fact, it is this it is going to be the very same thing except for a different d. Next what about this point this point is like the cousin of our pam 4 ok because you have errors if you go this way this way and you have errors going this way I mean anywhere here is an error. So, you can always just compute this using this approach it is not very difficult. Finally, for this point you have an error if you go this way this way this way this way 4 decision boundaries right. See this has 2 decision boundaries this has 3 decision boundaries this has 4 decision boundaries. So, in this way again if you want to now get a hint on how you can compute the error for this one take the real part you will have the same thing like your middle point in the pam 4 take the vertical part it is very similar to the middle point in the pam 4 and you can just combine them to get the symbol error rates. Thus this is the way to compute the symbol error rates for your qam 16 it is very messy, but the principles are the same, but you know sometimes you may think do I really need to go through that much I mean is it really you know needed for me to do so much of a calculation. So, sometimes when you have a reasonably high SNR some approximations are present which will work. So, one such one is union bound. So, see as you saw for qam 16 and I will for example, I can even ask you for qam 256, qam 1024, qam 4096 and things like that it is very cumbersome that is very painful to calculate the symbol error rate for these complicated constellations. So, in such situations it is actually convenient to obtain a bound called union bound ok. In the case of a union bound the probability of error given that you send the ith constellation it is less than or equal to the summation of q of norm sj minus si by 2 sigma that is in the case of qpsk remember we tried to look at this error event this error event and the third error event was overlapping and we subtracted that out. What they are saying is do not subtract it out just assume that you know just take the union bound that is in the case of your qpsk we had p of e1 plus p of e2 minus p of e1 intersection e2 ignore that. So, you are essentially boiling it down to summation q of d ij by 2 sigma what does that mean let me just go back. So, in this case I am saying this particular constellation can become an error by going here by going here by going here by going here by going here and so on. What union bound says is compute q of d by 2 sigma assuming only these two constellations are in your universe keep that in one corner then compute d by q of d by 2 sigma for this pair of constellations assuming only these two exist compute it for these two compute it for let us say these two these two these two and keep computing it for all and add them up ok. The key idea which they are drawing on is that you are not subtracting the overlapping event fraction because see for that particular point whether I have gone one step below or two step below I have encountered a symbol error. They are saying you know when you use the union bound just forget it just add the reason why this makes sense is because if you look at q of d ij by 2 sigma right. If you remember q had a bound which was less than exponential of minus you know d square and so on if d is very very large e power minus d square is anyway small. So, if you expand this right many terms will actually be really really small. So, it will turn out that you can I just take the take a few particular ones that matter and the others for example let us go back to our quam 16 these are this error this error this error may matter but this error may not even matter because they are so far in fact it is like several times the distance between the nearest neighbors. So, therefore you can use the union bound you can make computations using the union bound very very easily and it is reasonably tied for high SNRs. The reason is because when your q becomes high then those distances even slight changes in distances start stop mattering that is why that is where the nearest neighbor approximation comes in. So, what we said is this is the union bound I have written again just take q of d i j by 2 sigma just pair wise assume that these are the only constellation points you have and compute it. But for large d i j right the effect of e power minus d i square by 2 sigma square is not that sigma that is those things do not matter. So, the key idea that you must do is you must approximate the similar rate using only the nearest neighbors that is find the number of nearest neighbors for every one of the constellation points and just do average nearest neighbors into d which you know find the number of nearest neighbors that have the minimum distance and multiplied by q of d mean by 2 sigma and you get your probability of error. I will just go back to this constellation point and show you this particular constellation point has two nearest neighbors these two only not this because these two are d apart this is you know root 2 d apart. So, this has two nearest neighbors this has three nearest neighbors this also has three nearest neighbors this has four nearest neighbors. So, if you find the average of the number of nearest neighbors for every one of these constellation points you will turn out that the average is 3 in fact over here it is 2 plus 4 plus 3 plus 3 upon 4 which is 3 and the d min is exactly this amount which I have written here it is 2 root of e s by 10 and if you just plug in that particular particular formula you will end up with probability of symbol error is approximately 3 q times root of e s upon 5 and not. Therefore, the approximate symbol error can be computed in this way it is reasonably accurate for high SNRs, but bear in mind that this is not a less than or equal to bound this is an approximation there may be some scenarios where you have a low SNR and this bound may not be accurate. So, this is just something to keep in mind. Finally, one approach to compute the symbol error rate for various scenarios is to not really go through all this hassle and you can just run a simulation Monte Carlo based approach that is generate several constellation points and apply Gaussian noise to each of them and then compute the fraction of symbols that are correct fraction of symbols that are wrong this is the approach that we will take when we do glue radio also and that ratio will essentially tell you your symbol error rate. This Monte Carlo approach works very well in several scenarios where computing the accurate symbol error rates is cumbersome. So, let us take a pause here and see what we have done. So, we have computed the symbol error rate for several useful constellations and for these constellations the symbol error rate is dependent on the layout of the constellation points in the distance between them and the noise depending on which type of constellation use whether use a real constellation or you know complex constellation the layout of the constellation will determine the minimum distance which also effectively determines your symbol error rate. And if you really want to compute these for complicated constellations you can use the union bound and you can also use the nearest neighbor approximation. In the next lecture we will now just expand on the knowledge that we have gained so far and apply this to the case of bit error rates where there are significant differences because some symbol errors need not be bit or you know need not result in all bits being incorrect. So, that is what we will see in the next lecture. Thank you.