 So this is lecture 37 and what we have been seeing is going through the entire system for say BPSK, entire transmitter and the entire receiver block by block trying to make some plots of the actual signal. So how the signal looks like, what information can we get out of the signal and what we hope to see. So that is the kind of thing we are trying to do. So let me see, I think we were at a point where so BPSK was kind of done, we finished BPSK more or less with rectangular pulse, that is what we did, BPSK with rectangular pulse is what we did. An interesting thing to try is QPSK, so I want you to at least the transmitter part the receiver part may be we will not do in great detail. So transmitter part, say you have a rectangular pulse once again for the transmitter filter and your signal SK is going to come from plus minus 1 or plus minus j, so this is signal is 1 from 0 to t, that is your transmitter filter and then you do multiplication by Well, I am going to write it as e part j 2 pi fct and then a real part, that is the right thing to do here. So I am going to call this X of t, so I want you to take a simple sequence for SK say for instance 1 j minus 1 minus j, just a sequence and then plot what X of t will look like. And assume fc times t is 4 for instance, just to say 4 cycles of the carrier will come into 1 symbol period, so you assume fc times t is say 3 or 4 whatever is come comfortable. Then make a plot of X of t for this input sequence, it is a little bit more challenging than the BPSK case, so let us see how it works out. So it is always good to start out with an expression for X of t and try to plot it, but the expression can be a little bit devious for instance, let us do it symbol by symbol. So the reason is there is g of t minus kt and then this 1 t minus kt which will show up in everything and if I write it summation it might be a little bit misleading, but anyway so I will try it, let us see how it goes. If you look at say 1 times e power j 2 pi fct and then you take its real part what is going to happen, you will get cosine 2 pi fct, there is no problem. If you take j times e power j 2 pi fct what do you get, minus sign. So see all these things do not write it as minus sign, you will only get confusing if you write it as minus sign, right stick to cosine, then you will know what phase shift to introduce at the place where the phase changes and that might be easier to plot, so if you like minus sign that is also fine, but you remember you are doing a time shift and a phase shift is with the same cosine or sign, a phase shift is easier to plot sometimes, okay. So if you were to write it in cosine what would it be, so cosine 2 pi fct plus pi by 2, okay. So it is the same as that sinusoid except that there is a phase shift ahead by pi by 2, the same thing will happen if you do minus 1, minus 1 would be cos 2 pi fct plus pi and then minus j would be plus 3 pi by 2, okay. So that is the way to visualize the modulation, so once you visualize it that way plotting it is presumably a little bit easier, so you do that, okay, so you begin with the cosine so maybe you do 1, 2, 3, so you do 3 cycles of a cosine, okay and then what should you do, you are doing a j which means, so you have to start from 0, do you see that, so there will be a sharp fall here, start from 0 and go on which direction, go downwards, okay, so there is a advancement of, so it is 1 cycle, 2 cycles and then 3 cycles, so that is where it ends and then what do you do, 1 more, phase shift by pi, pi by 2, okay, so you will have 1 cycle, 2 cycles, 3 cycles, okay, so my plot is going so hopelessly off scale that I should do something about it, okay, so 1 is the second one and this is the third one, okay and then the last one is once again, another pi by 2 phase shift, but this time it will go up, okay 1, 2, 3 and it stops, okay, so that is how X of t is supposed to look, okay, so it is clearly a passband signal, right, passband signals, how do they look, they typically have an envelope and then there is a sinusoid going up and down inside them, right, so this is clearly a passband signal and if your fct is larger as would be the case, most cases you will have a lot of wiggles going back and forth in the sine wave, okay, so that is your X of t, okay, so this is going to go through the channel, right, noise will get added and then what do you do for the receiving, okay, so you do band pass filter followed by phase splitter then multiply by e power minus j and then proceed so on and so forth, okay, so sometimes you may not want to implement the phase splitter also, see there is another way of doing it, right, so you do band pass filter then you maybe go ahead and multiply by e power minus j and then what would you do, you do a low pass filter to get rid of something else that might have come in, so in the analog implementation it is not clear what else will come in, sometimes people do the whole thing in digital, at that time something else can come in because of the aliasing, so you might want to do a low pass filter followed by that, okay, so that is also another implementation, okay, so if you do, if you do not like implementing phase splitters, that is a good implementation as well, okay, so this is QPSK, any questions on this, how I got this, okay, is that clear, okay, since it was QPSK it worked out reasonably okay, okay, so if I were to try 16 QAM what will happen, what do you think will happen, how do you think this thing will look, yeah, so there will be a change in amplitude also, do you see why there will be a change in amplitude, it has to be there, right, so 16 QAM has different amplitude things, so the envelope will not be flat, but it is a bit of a nightmare to draw because you have both the sine and cosine, so how will you tackle that, how do you draw when this both sine and cosine, I am sorry, yeah, so you have to convert it into one sinusoid but you will get some phase and you can also figure out what that phase will be, it is not that difficult, right, so depending on where that point is just look at that angle and you will know it, some angles are easy even in 16 QAM, some angles will have a strange tan of 3 or 1 by 3 or whatever, I mean just let it be the way and then you know but you know what the angle is, so you will know what phase to shift by, okay, so the whole thing whatever way you draw it ultimately will look like this, even 16 QAM will ultimately look like this, well there will be a change in amplitude but there will be also be a phase shift, there can also be a phase shift, okay, depending on what the transition is, okay, so this is how the passband signal will look in QAM, okay, to have an envelope there will be a lot of variations inside it, there will be both a phase shift and an amplitude shift in the general case, okay, for the receiving you do band pass filter followed by the down conversion low pass filtering and then you process your match filter, okay, so that is what you do, alright, so this is for the rectangular pulse case, so once you move to a square root raise cosine pulse there are a lot more choices to be made and you have to be careful about it, okay, there will be lots more delay in the system, so far we have never worried about delay, right, this is rectangular pulse, you can happily do whatever you wanted, once you do square root raise cosine there will be delay, why am I saying there will be delay? Yeah, it is a two sided pulse, right, square root raise cosine is two sided, right, finite bandwidth and it goes for a long time, so you will have to delay the whole thing to get a practical implementation, okay, so what I am going to do now is BPSK with square root raise cosine, we will do it roughly first and then I also have some MATLAB code to show you in a very smooth way how the whole thing looks, okay, so but for now I think it is good to first do it by hand so that you get a feel for who these things work out and then you can go through and do the, okay, so we are going to do BPSK with square root raise cosine pulse, okay, square root raise cosine is your transmit filter, okay, so the first choice to make is about G of T itself, okay, this is your transmit filter response, okay, what are the various things to choose for a square root raise cosine, sorry, the roll-off factor, right, so I don't know if I call it alpha or beta or whatever, so something, the roll-off factor you have to choose, so basically you have to figure out how much bandwidth it will actually occupy, so it will be some 1 plus beta times divided by 2T, okay, so this beta you have to decide, this will be your bandwidth and based on the beta and the bandwidth you will get a symbol rate, okay, so all these three have played a role in deciding your transmit pulse, okay, so usually you bandwidth is fixed and you want a certain symbol rate or a certain spectral efficiency which means certain number of bits per symbol, so you go back and work it carefully, so we have done a few problems on this, right, so you know how to pick this beta as a 1 by T, so you will get a 1 by T, okay, so that's the theoretical expression, so now we will get a huge big expression with, you know what that expression looks like, so sine and the cosine and all these things, it's 1 by minus 4 beta T by T whole squared, all these things show up in that expression, okay, so in practice you have to truncate, so truncate as in you have to, you can't implement an infinite response, okay, so that's one thing and the other thing to keep in mind is nobody will implement this filter and analog, okay, well I'm saying nobody, there might be somebody who does but most people would implement such filters in digital, what do we mean by implementing this filter in digital, so the way you do it is there will be something called an arbitrary waveform generator, so basically you sample this raise cosine, how will it look, so it'll look something like this, okay, so I'm drawing square root raise cosine will have a slightly larger tail as opposed to the, okay, so it'll be symmetric, it'll look something like this, okay, so what will be this, so this will be, if you take this as your origin, what will be this length, 1 by T, right, so every 1 by T it will go off to 0, okay, so all these gates will be 1 by T, 1 by T, so on, okay, so every 1 by T it goes to 0, right, so that's where you get the ISI property with an ideal channel, okay, so every 1 by T it goes to 0, so pretty much the choice you have to make is how long will the G of T be in terms of your symbol period, okay, so that's the choice, it's the first choice you have to make, okay, so a typical thing might be you might want to have say some 10 lobes on the right and 10 lobes on the left, which means you'll have 20 times the symbol period or maybe you have 5 lobes on the right, 5 lobes on the left, whatever choice, I mean depending on what your system can afford you make that choice, okay, so maybe you put say 5 times T here and then 5 times T on this side, okay, so that's the first choice you make, after you choose a beta and a 1 by T you decide how long, how much you, at what point do you want to truncate your trace cosine, the next decision is in a digital implementation, you have to figure out how much you want to sample this, okay, so so maybe, I mean depending on what follows next, what, depending on your digital tonal or converter, finally, you might want to make that choice some way, but maybe you want to choose some 10 or 20 or sometimes it might even be 5 or 6, depending on how much you can afford, for instance people who are doing the lab usually produce this in digital and then you give it to a sound card, so sound card has a certain sampling frequency, so you can only sample this at a certain frequency, so if you pick a certain 1 by T, maybe you sample this at 22k for instance, okay, and if your 1 by T was, I don't know, 100 Hertz, then you got a over sampling of what, whatever fraction, if it was 1k then you got a over fraction of, over sampling of 10 times, okay, so ultimately this thing is also sampled, you have samples of this stored in some memory, okay, and when a symbol comes in, if the symbol is plus 1, you simply read out those samples and give it to a D2A, which is going to do simple interpolating digital tonal or conversion and you get your GFT out, okay, so this is a very common way of implementing these filters, it's very popular also, many people use such things, okay, in fact I believe there's even a patent out on this, arbitrary reform generators, okay, so but it's very nice, nice and simple implementation and it works out very well, okay, so that's how, that's how you typically implement this, so those are the choices you have to make for GFT, okay, so suppose we did 5 lobes on the left, 5 lobes on the right, that's what we did for GFT, okay, so once you do that your thing is quite clear, right, so you have an S of k, goes through a GFT, okay, and you produce say X1 of T, then you multiply this by, okay, so I'm doing BPSK, so I'll write simply as cos 2 pi of Ct, okay, and you get X2t, right, so if I'm doing any other modulation I'll have to write E part J and then take the real part, doing BPSK, so I might as well multiply by cosine, okay, so I want you to make careful plots of X1 of T, so maybe you just choose this as 3t, okay, so for simplicity, for the plot sake, instead of choosing 5t, maybe you just choose 3t, so that your plot will look much cleaner, okay, and you can choose a large enough scaling so that you can clearly show, okay, so this is a good exercise, if you've not done it before and if you've never seen these things in action, okay, you'll see how it looks like, try to plot it for S of k equals plus 1, minus 1, minus 1, plus 1, okay, plot X1 of T first and then we'll plot X2 of T, just put 3 lobes, so if you pick 3 lobes how will it look? It's just what? 1 by 2, 2 by 2, it'll look like this, it'll just go up after this, okay, so the G of T will look something like this, okay, so the way we defined that, what will be this value for the square root raise cosine, any of you remember? So the raise cosine it'll be 1, okay, for the square root raise cosine it won't quite be 1, it'll be something slightly larger than 1, okay, so anyway, so that's how the plot will look, okay, so this is 0, well I'm drawing it very badly, 1 by T, 1 by T, 1 by T, okay, same thing happens on this side, make a plot of X1 of T and X2 of T, so this case, assume fc T equals 3, see it's a bit devious, right, it's not as straightforward as the rectangular pulse which nicely died out after 0 to T, there's something floating around and you'll carefully plot it, let me do this, so someone with very questionable drawing skills like me is gonna have a tough time, so maybe some of you can do this very well, 1, 2, 3, okay, so the first thing is gonna look something like this, I'll assume the lobes are really, really high so that, I'm sorry, is it fine? 1 by T, 2 by T, okay, it's gonna come back here again, it'll be very symmetric, what about the next one? It's gonna start here, right, it's gonna look like this and oh it's minus 1, you're right, see there you go, once you see it's minus 1 the whole thing changes, so it's gonna change sign, it'll look like this, it'll look like this and then it'll go down all the way down and come back down here, this way, okay, so that's the second one, what about the third one? It's minus 1 again, so it'll go right, it'll be a simple time-shifted version of the previous pulse and then the last one is plus 1, it's gonna be like this, like this and then it'll go on top, did I get that right? No, it should go a little bit more to the right, anyone here who got a, how many engineering drawing courses do you guys have in this? Only one, anyone who got a S? How many of you got a S? Okay, so you guys will be able to draw this much better, I've never got any grade better than B in my engineering drawings, so there you go, that's, there it is, so now what do you do? You have to add up all these things, okay, so the easiest ones to add are the first and the last, okay, and then maybe this one will go a little bit more down, this will maybe roughly cancel or bring this down a little bit, okay, so no, no, no, it has to go all the way up because it'll go to zero then, okay, so I have to be careful, so you might as well draw this as it is, but it'll bring it down a little bit but not too much and then it'll come down very sharply to join this very soon and then in fact it will go, okay, so my drawing has gone totally for a toss, okay, so let me redo this part a little bit, okay, so it has to go through this point and then come back and then go through this point again, then it is going to go through that point, okay, then it has to go through zero here, right, so it has to come back almost touching the same thing and then maybe go here and then join, so that's how your thing will look, so maybe I'll draw the final curve in red just to illustrate how it looks, there you go, okay, not a bad picture I guess, there was one point where it became a little bit bend it back to the left too much I guess, overall turned out okay, right, kind of conveys the picture, alright, so this is how you transmit pulse, the baseband transmit pulse, this is what is called the baseband transmit pulse, right, before you convert this was your transmit pulse, remember again we I drew it as a continuous curve in most implementations this is going to be discretized, this is going to be over sampled and given to a analog digital to analog converter to get the analog versions, so maybe even you do the multiplication in digital, multiplication by e power j 2 pi f ct may also be done in digital, right, so so many things are possible, okay, so all these things that do be as whether they are digital or analog that's how the plot would look, okay, any questions as to how I got this, this is clear, right, okay, so now the next step is to multiply this with cosine 2 pi f ct when you have a plus 1 and minus 1, so now you can forget about plus 1 and minus 1, okay, you've got the entire baseband transmit pulse, so no need to take care of plus 1 and minus 1, the only thing you have to do is multiply this by cosine 2 pi f ct, okay, so there you have to pay attention, okay, so the easiest way of doing this is to finish up what's called the envelope symmetrically, okay, so do a minus of this, okay, so once you do that, why am I doing a minus of this, then even you do a cosine, it will only be contained inside that and you'll get the nice envelope, okay, so that's the way to do it, I'll try to do that here, so I'll draw, okay, so maybe I should draw the negative also and red so that makes the whole thing easier to do the negative also, okay, and then maybe I'll draw the envelope in green, okay, so remember I have to allow for three cycles inside each time period, okay, so that's the only thing, I'll simply take a sign, okay, so I'll start with the zero phase here, 1, 2, 3, okay, so that's how the waveform will look and then I do 1, 2, 3, okay, that's how the second one will look, the third one would be 1, 2, 3, okay, and then the fourth one would again be, okay, there might be some phase changes, I'm not taking care of it, I'm just happily drawing a sign inside each of them, 1, 2, 3, okay, and a 1, oh well actually it should be more than 3, I'm sorry, I'm sorry, I'm sorry, here you should get a total of 9, okay, I'm sorry, I'm sorry for this, okay, so actually, right, so roughly about then it should be more cycles because this whole envelope is closing in more than 1 by T, okay, so there'll be more than this, I'm sorry, so you see, so take care of that number, okay, so it'll be, it's tough to count it exactly, so, but you'll get a rough estimate, okay, so you kind of know that, so in general I think if you just draw something like this, you'll be okay, okay, for instance in an exam, this should be considered an okay passband signal, okay, so and you see the envelope clearly is the baseband signal that you want, all right, okay, so now the next question is the receiver, okay, so now when you move to the receiver, okay, you do a band pass filter, okay, you get R of T, you do a band pass filter, okay, in practical implementations it's important that you do a band pass filter first and then multiply because sometimes there'll be all kinds of noise, if you do anything else, it's good to first do a band pass filter and there might be, because there might be other transmitters using radio spectrum right next to you, so you don't want to let in all that in anything you do into baseband, so you just do a band pass filter first, get what signal you have, so that's why I'm doing a band pass filter and then a phase splitter may or may not be necessary, so you might be able to just get away with, so usually maybe you just get away with doing a sampling here, you sample here and then you do multiplication by e power minus j 2 pi fct, okay, so well it cannot really be fc, it's only be some f1t, okay, so maybe it's nominally equal but there'll be an f1t plus, plus theta also right, so there'll be some phase also which you can't get, so maybe I'll just keep that there, okay, so something like that you do and then you do a low pass filter and digital, okay, so the reason why you need a low pass filter and digital is when you do this multiplication in digital, when you have over sampled it, there's going to be an alias thing from the other side that might come in, okay, so and you want to get rid of that by doing a band pass filtering, okay, so something else can come, okay, so anyway in general it's good to low pass filter this after you bring it down to the, this, what do I say, to the base band, okay, so you do a low pass filter, you get only your base band signal, okay, so this is, so what do I want to do, so I want to write down what this will look like, maybe I'll call this, yeah, so after you multiply by e power minus j you'll have actually complex, right, so you'll have to keep track of both i and q, okay, so maybe you do a low pass filter, you keep track of both i and q and then you decode i and q with a match filter, so right now you have to do a match filtering, okay, so what is match filtering? g star of minus t, okay, so you have to convolve with, yeah, g star of minus t, so once again it'll be a sampled version that you had before for g of t and then g star of minus t is going to be a total causal thing but when you shift it back you'll pretty much get the same thing, so in fact here you'll have this exact g of t that you had before, okay, right, so that's the g of t, okay and then you do a sampling at kt plus tau, okay, so can you get a rough estimate for this tau, the delay, okay, so g of t originally has been, you've included 3t on the left and 3t on the right, okay, so what's a rough estimate for tau, okay, so you pick order for your filters, okay, so you do, forget about the bandpass filter, okay, so we'll forget about the bandpass filter, so maybe this is a order 30 filter, okay, some order, right, it's in digital, so what's a rough estimate for tau, I'm sorry, okay, so let me just, right, so 60, so tau should be greater than 60, right, so it'll be 60 plus something to adjust for the low pass filters delay, okay, so there'll be a delay from the low pass filter, okay, so maybe some 15 samples, right, so you don't know what the sampling rate is, so I can't really tell you exactly what it'll be, but there'll be a 15 sample delay here and then there is a 60 delay because of the filtering, do you see that, because of the transmit filter and the match filter, right, the transmit filter was delayed by 3t, then this guy, which is match filters once again delayed by some huge amount but still it'll effectively cause a delay of 3t to your, to whatever is happening, so roughly some 60 and then the order of the filter also will pay a role, so it'll be around that time, so this delay has to be taken care of, okay, so once you do the sampling you'll get back your, get back whatever it is you're doing, okay, so like I said all these things are done in digital usually, so you do a convolution here with the sampled version and you get the okay, so well this is also complex, okay, so once again all these problems exist, so when if your f1 is not equal to fc and if your theta is not zero then you'll get rotated versions of your constellation, okay, so in fact you keep on rotating if f1 is not zero, okay, so all these things are illustrated with some MATLAB programs that I have, so I think we're running out of time, maybe we have like 6 or 7 minutes, so I don't know if I can really fire up my MATLAB programs to work in 5 or 6 minutes, so we'll stop here for today, so we'll declare an early closing for the class, but I'll come back next class and show you some MATLAB programs where all these things are easier to see, okay, so once I start showing MATLAB programs it'll be easier to see but the learning will be lesser, okay, the only way you'll really learn is if you write those MATLAB programs yourself and then or MATLAB or CE or SILAB or whatever you prefer, okay, so you write those programs yourself and see it, it's very easy to write, there's nothing in these things, okay, so you just write a sequence of lines, it'll be in fact a 10 or 15 line program which you quickly do all these things, okay, so we'll do that.