Hey guys, if you are interested in seeing how I magically created this look, stay tuned because this is going to be a very much a chatty. Get ready with me. I haven't done my hair yet. Anyways, stay tuned. I'll be using my new palette that I bought, the Natasha Denona Glam palette. I bought this maybe a week or so ago and these are the colors so that you can see, I covered my mirror up with this so that you can see the colors. I think this is sort of a cooler tone palette and very much a more neutral color. Anyways, I thought I would do this, get ready with me, show you sort of how I do my eye look. I am by far a novice when it comes to eyeshadows. I do have a few favorite palettes that I use and a few favorite looks and all that. So this particular palette I just recently picked up, I bought and I really like it a lot. What I found when I've wanted each day is that the colors go on and I happen to like something that gets built up. I don't like something that is going to just go on and be full force and I have to take it down. I'd rather build up than take down. So I'm sure that depending on how you apply your shadows and all that will determine how this works for you but for me it's really fine. So I normally start.  I've already done that and right now I'm working on the crease color which is this particular one. I'm holding the palette upside down. So if you were looking at the palette it would be the second one in from the right and I'm trying to do this on a mirror. So what I do is I tap out my brush slightly and I try to rather than you know stretch or spread or I try as much as possible to pat the colors down. I don't always, I'm not always successful with that. A lot of times I do swish a little bit you know the windshield wiper motion but I really try to do more of a pat job than anything else. So tonight Jay and I or this afternoon Jay and I are going out we're going to be celebrating our anniversary. This week on the 15th was our 30th anniversary and so we're going out to dinner in a place that I really really like. It's my favorite restaurant and he really likes it too and I don't think it's so much a favorite for the food as it is the ambiance. It's on the ocean it overlooks the ocean it's just absolutely beautiful I really like it. So what I've done with this color is I've kind of gone in my crease I can see I've gone up too high I usually have to do a lot of cleanup work but I've gone into my crease and I've just gone into the outer V a little bit with this and I'm using the Sonia G brush set that I actually got last year for my this year for my birthday from Marlene Fab and Glam and simply Sheila. Because I've always had hooded eyes and then as my eye hoods kind of receded a little bit or lifted a little bit I have a lot of wrinkly skin. I you know so I there's a lot of movement on my eyes and I try to minimize that movement as much as possible I don't know if I'm doing a good job with that but anyway so I just kind of like tap this in and it's very uneven I can see it's very uneven but this is the way I kind of do it and I do both eyes I do the steps you know like the all over the all over on both eyes and the shadowing on both eyes and then I go in and I do you know a little bit of a cleanup but I kind of try to look at it in a way that makes it somewhat you know somewhat equal but it isn't going to be perfectly equal I'm going and I try to blend a little bit and this is where I get more of my my movement on my lids that I'm trying to avoid. It's kind of really funny the other day I got a message from I think it was Mary Ellen came first but he was they got two messages on a very old video and the old video was nine years ago it was 2011 and I was really so glad I mean it was kind of it was a funny thing that YouTube was actually recommending that old video but I was really kind of glad that they saw it and left me a comment and it made me because their comment was on the idea of wow you look so much younger today whatever you're doing obviously it is working for you you look so much younger today and that kind of like really made me feel good so I think what I'm going to do is shoot my written a four year update because it was four years in August and I haven't done it yet I just think with the issues with my dad and just threw me in for a loop so I haven't really done that yet I'm going to do it and and so I'm going to use that video clip so at the same time I had two of you say wow you look amazing now compared to you know nine years ago a few minutes later I get a comment from one of my on one of my newer videos from someone that says you just need a facelift I cracked up so anyways I'm going to go and do the middle shade they're calling this is the lash line it's like a darker deeper brown right here and I'm going to put that into into my crease I'm going to use the same brush I have I really love these brushes and I know everyone everyone has their own favorites and I just kind of messed up a little bit but that's okay I could fix all of my mess ups I am not using any kind of a lid primer all I have is the all over the all over shade you know that I put on but no lid primer at all and I do have my mascara on 90% of my mascara is on after I do my eyeshadow I will touch up my mascara dock in it and spots after I brush whatever if there is any residual shadow on there the one thing I'm really liking about this palette is that much like my Visiott palette it does not have any fallout it just simply does not have any fallout very minimal very minimal fallout at all so now I'm going to go into the center eyelid and this is on the very bottom of this which will be the top as I turn it over the center eyelid I really like the fact that they have these like kind of labeled like this because it makes it for people that like me that don't know what they're doing that well it kind of really helps them so I'm just tapping this thing to my center eye look my center eyelid and again I'm looking for a more of a natural type of look you know I don't want to have a look that's going to be too bold or too bright and then on the very top and now I'm switching to a sigma brush on the very top which will be the very bottom I'm going to do the inner corner using this particular color right here the inner corner now I should also tell you that have on a little bit of the wrong thing I have on a little bit of of my skin care all my skin care is done I've done my new face device this morning I've done my red light therapy I've done all my skin care the only thing I don't have on is any any foundation or blush or brows or anything like that so you're seeing me as I really would not ever want to be seen which is my naked eye look so I'm gonna do is the inner corner the lighter inner corner one in the in the middle row I'm gonna go right down here now I can tell immediately that that's too bright obviously and the one that I used was this one right here in the middle row normally I'm gonna blend I'm gonna play and again I always do both eyes at the same time it allows me the ability to really see what I'm doing to really play with it to make sure that as much as possible they're kind of equal because because I am yeah I don't I don't I don't do a good job with that my eyes are like all over the place but I thought it was funny that YouTube was recommending this old video of mine to some of my subscribers and friends and that and how they have complimentary they were and then I get this other person that says you just need a facelift you know so let's talk about facelifts I have never ever made it a secret that if I could I probably maybe would but I'm such a big whoosh whoosh when it comes to surgery to needles and to things of that nature that I don't know that I could really comfortably kind of pull it off you know what I mean like I'm such I'm afraid of surgery and elective surgery in my world the elective surgery for me is not anything that my insurance is going to cover you know what I mean they're not going to cover anything of that nature so and I'm not financially in a situation where I want to spend money on elective surgery that's not covered especially something as dramatic as that I'm just not really ready for that yet at all I don't I don't know that I will ever be ready for it but at this point in time I'm not ready for it so what I'm going to put on now is and I usually end up doing this and then I go back and play for me it's very much about layering on my eye look and then I have to look at myself in different lights I have to look up I have to look down so you know but right now I'm going to add some eyeliner and this is actually I'm going to show you what this is this is I think fairly new this is epic where and these are the liner sticks by NYX and this one is like a purple so anyways I'm going to go ahead and put this on my eyes took the liner stick I needed to get up close to a magnifying mirror to do it because I can't see what I'm doing but I took the liner stick this is actually called very goth very goth like oh my gosh so I ended up lining underneath my lashes a little bit and then around the my lid my right next to my lash line is what I ended up doing now at this point in time I would continue to blend and then depending on say the day that I'm having at work what my schedule is how late I am how I you know whether I did all my skincare I might add more to this if I'm home if I'm going out for the evening I'm definitely going to bold up my inner crease a lot right now it's pretty undramatic but I'm going to I can darken it up I can also put a little bit of a smoky glitter on the outside but I'm not going to really do that at this point because I I'm going to just kind of blend this out I just do the mess I'm making I'm going to kind of blend this out and then I will do my eyes and then I will come back in and kind of show you my my finished look and my thoughts on these products so everything I've used today with the exception of the the brushes that I have were things that were purchased by me none of this none of this was gifted I have a couple of products that I have bought in the last couple of weeks I went on an altar haul while a mini altar haul and I went on a Sephora haul yeah yeah this this I got from Sephora and I got the and I really like it the Smash Box this was a recommendation from Sheila and Marlene but this is the Smash Box contour bronze bronzer and highlighter so I'm going to use that along with my with my makeup when I come back I told you guys I really don't really don't do much of anything spectacular I do have to work on my out of the I can tell that and I'm going to do a better job if I'm standing up at my mirror with my magnifying glass because I don't have my eyeglasses on and when you can't see what you're doing it's kind of hot so I will be back in a moment or two okay guys so I came back so I'm gonna just tell you quickly what I did now I I am by no means done done because I still have to do my setting spray and then I normally will be like blending out more of my shadows because that's what I do but I just wanted to tell you the rest of what I did on my skin on my face I have my number seven this is the protect and perfect this is with the SPF I really really like this foundation so I've been wearing this almost every single day I am trying a new foundation that is from a pharmacy F-A-R-M-A-S-I-V-F-X camera ready I they've got several samples the first one that I used a couple of times is just too light for me so I'm going to open up one of the other samples probably tomorrow and see how see how it works I don't want to do it today because I'm going out and I don't want to have that on the other thing that I have is the instant age rewind erase this is the concealer that I had put on and down around here I have on my nose this is my favorite bowing I have a number of them I have three different bowings but I have one that's in a stick that I really really like and then I have the I have three little tubes the one I have on today is the number two this is sort of like an industrial strength concealer I love love love the one in the stick that kind of looks like I don't have it with me it kind of looks like this the one in the stick is not the industrial strength I really like that because that can add give me an added surge of moisture during the day that I really like so I have that on I have my foundation on I have this concealer on I use the Smashbox contour to try to contour a little bit I am lousy at contouring totally lousy at contouring but I use the Smashbox they do have a little bit of a diagram there so you can kind of read it follow along I didn't I and I have the brush I use that and then when I was all done I took my and this is a Sigma the large power this is the F 30 anyways I took this and I dumped it into the I dumped it I tapped it into the bronzer pot and I just kind of like went all over my face did like a little bit of a bronze so that I didn't have I didn't look too pale on my eyebrows I I really like the billion-dollar brows a lot so on my eyebrows I have the billion-dollar brow pencil and this was sent to me in PR and I've talked about it before I have the pencil on I have like four different eye products on them but today just the pencil and then I have on top of it I have the coloring control this is the brow gel I really like that you know the ones that come out look like a little mascara I really like these these are the only two things right now that I have on my brows for my blush I really love mad about Matt is it mad about Moff mad about Moff this is an Avon blush I've been using this I would have to say this is my favorite blush overall I've used many different blushes but I just keep going back to this one because I love how it looks on me it doesn't look like the boom too much it just looks really nice I really like how it how that looks on me so on my lips my lip liner I have several different of the lip liners these are the glimmer sticks from Avon so when I buy my my blush I also always buy the glimmer sticks I also have a lot of the glimmer sticks I eyebrow which I like a lot I've used over the course of time they're really super good as well but my Avon lips this is the perfect plum I don't know I lined my lips with it perfect plum it looks really good today I'm not wearing my color the world lippies I'm actually wearing I want to say this is probably about maybe the fourth tube of this that I've bought in a number of years this is number 450 this is romantic rose Maybelline this one is fairly new I think I bought this you can see there's lots in here I just really I if I'm gonna it like for a regular lipstick this romantic rose color matches anything any look I have I really really like it whereas my color of the world they're they're a little bit more creamy they're more softer I have different shades of mauve I have a bunch of different shades in that that I love so if I'm not gonna use a color of the world it's gonna be this one is my top one that I get at the drug store and I really like it now for a lip gloss now I'm not even gonna tell you about the lip gloss I bought but I'll tell that in another video but I usually top off with a lip gloss and for many years my my my favorite my favorite was white Russian from Buxom I that has been my favorite lip gloss and then I went and I bought some of the the drugstore that I really I think really is a it's not a dupe but it works really nice is the hot candy so the hot candy lip glosses with plumper's you can get many different shades I really like them a lot in some cases they're probably it depends how fast you are on lip gloss you might like them just as much as a high-end if price were no factor I'd buy the I buy the Buxom if price were no factor but these are pretty darn good for for I think for the price point and I like I have like maybe five of them I use them but I am trying another lip plumper I'm really excited about it I'll tell you that another time but I think other than I think I told you everything other than my essence color corrector I usually do that under my eyes a little bit and then during the day I've been trying this for a while and I actually think Susan little poet might have mentioned this as well to the Garnier this is the Claire Breitner and I have a very light shade I would have to really look at the color I think it's an I think I have the universal share tint light to medium anti-dark circle eye roller so I bought this and anti-dark circle eye roller so what I've been using this as a touch-up during the day now normally I use my Boeing touch-up for here it's really rich and creamy I actually should compare the two of them in a video but this I've been trying I find it comes on too too bright for me it's like I really have to have you it says roll like this if I roll like that I have too much of a coverage this might be perfect for someone who wants that much coverage I really don't so that's kind of all I have on my face today I haven't done my hair I did go and do my hair I had my hair cut and then I had instead of my hair my roots done I had my hair heavily heavily highlighted really blonde I know you can't see it in this but really blonde highlighted I think what I'm going to try to do is kind of a kind of like see how it grows out and kind of avoid coloring it a little bit more you know letting my gray or or and I'm not ready I'm not going to go gray I'm not going to be like a Mary glitzy fretsy and just you know she looks awesome in that color I wouldn't and and I've seen Marlene Fab and glam and she's done some beautiful gray wigs and to me it would just age me but I want to have the the gray or the white that I have naturally and it's only around my crown my hairline I should say that I have that the back of my hair the rest of my hair I have no gray but I want to see if I can blend it in with more blonde highlights so I don't have to process as much that's what I'm thinking and also because my hair tends to pull brass and orange I'm thinking if I do that rather than color it might be a little bit better so that's what I've been doing I've been trying a few different things and anyways that's what I have on my face today I should say thank you guys so much for watching I know I look a mess but I'll fix my eyes before I grow up public


Thank you all for coming today. My name is Randy Barler. I work on the Fedora infrastructure team at Red Hat. I focus a lot on Bode, which is our update system. And today, we're going to talk about Python 3's AsyncIO library, which is a pretty neat library. I really like it. Just in case you're interested in following along on your own computer, this presentation is on GitLab. So I've got a link here. So feel free to go there and check it out. All the files, I'm basically not using slides. I'm going to be showing you just code. So all the code I'm showing you is inside there, and you can check it out and play with it on your own. And I welcome questions during the presentation. So if you feel like you're not understanding something, or if you think I'm not understanding something, feel free to speak up. So I've been thinking about this presentation for a little while. And one thing I wanted to do was sort of create a demo program that shows off what AsyncIO can do. And so I was trying to think through what kind of toy programs I could write. And you can do all kinds of things with sleep and prints and things.  My phone will not play MP3s right now. I really don't know why. It's an Android phone. If you push play, it doesn't make any sound. It says it's playing, but you don't hear anything. I don't know why. And so I like to listen to RSS, my podcast when I fly on a plane, and I want to download all these MP3s, but they won't play. So I decided to make my toy program for this talk be where we're going to do is we're going to go download my RSS feed. We're not really going to do that because of the conference Wi-Fi, so we're going to fake download it. And then the things we need to then convert all the MP3s to a different format so my phone will play them. So what I'm going to show you first is how you might do that in sort of a traditional synchronous code. So I have this script here pretty straightforward. I'm keeping the links in a file called links.txt. So the first thing we do is we go and just get the links out of the file. It's pretty simple. And then what we're going to do is we're going to do a giant for loop. This might be, is it better if I make it a little smaller? Is that better? OK. So we're going to go over each link. And we're going to start by downloading the link. We're going to start by printing that we're downloading the links. And then we're going to use Python requests and get it and make sure it was OK. I'm going to do some path formatting to find out what the file name was so I can write it out to that name of file. Going to print some more things to the screen. And then lastly, I'm going to try to find out the base of the name so I can tell ffmpeg to convert my mp3 to an org. You can see here that I'm calling subprocess. And then lastly, I'm actually going to have the script play the file so that you can hear it and make sure it works, because sometimes it's weird. And that's it. So we're just looping over the files, downloading them, converting them, and then playing them, and printing out some status. Feel like we're all pretty familiar with this code, right? Like it's not hard to follow. Any questions? OK. So I have a question for you, which is, what problems do you see with this approach? It's synchronous, so what is that? Yeah, so you have to wait for one download to finish before starting the next one. What else? Exactly. So you don't just wait to download one to start the next, but you also have to wait to process the one you just downloaded before you start doing the next one. And similarly, you have to also listen to it. Fortunately, I am only listening to two seconds of it. That's what this dash dash length two does. But still, yeah. Any other problems anyone sees? Say that again? Oh, right. OK. So yeah, if you hit an exception, in fact, I think we're going to raise an exception at one point. So if this happens right here, as soon as you hit that, the whole thing is going to exit. No, we could fix that by having something catch that exception. But I was trying not to make it too complicated for the demo. But yeah. Anything else? Well, actually, I'm going to listen to it. That's true. I think it would, I guess it probably would exit with an exit code. And I am doing check call. I actually did have some problems. I have a problem with MPV that I'll talk about later. But it isn't what it isn't that. I think you're right, though. So yeah, I guess I didn't have to listen to things, but actually did. Yeah. The reason I'm playing it is that I'm going to show a more complex form of this later, and playing it does something funny. OK. Well, I don't know of any other problems, any others that you guys can think of. Oh, OK. Oh, I didn't know that the microphone's not on. Can you? The microphone is that. I only open the notebook. Do I sound better now? OK. I didn't realize that it wasn't on. OK. OK, so before we, so I want you to keep that downloading thing in the back of your mind. So what we're going to do next is we're going to look at an extremely simple asynchronous program that has nothing to do with that. And then we're going to come back to that problem and make it asynchronous. OK. So this is a very simple asynchronous program. Do I have a pointer? Is this a pointer? Maybe? Oh. OK. So in Python 3.5, you get these new keywords, async and await. It is possible to do things like this in Python 3.4 as well, but this syntax is different. And I don't really intend to show that today. But just for your information, it is possible to do things like this in Python 3.4 as well. But the code that I'm showing here requires Python 3.5 or later. So what we're going to do here is we've got a function, an asynchronous function, called say, except a word. And it's going to wait for a random amount of time between zero and two and a half seconds. And then we're going to sleep. Then we're going to print that word. And I kind of want to explain a little bit about what these keywords are doing here, and then we'll show it run. So when you use this async in front of a function definition, what you're doing is you're creating something called a co-routine in Python. And a co-routine is sort of strange. When you run the co-routine, so if I write say, parentheses, and a word, it doesn't actually run right now. It returns a co-routine. And that co-routine can be handed to something to run later. And you can see us doing that down here. So our main function is going to build a list of tasks. And this is going to call say with a word for each word and let's make it asynchronous. At this point, we're not executing that function, even the traditional Python that looks like I'm calling it. But what I'm really doing is creating a co-routine that we'll call it later. Then what I'm going to do down here is ask async.io to this gather the tasks. That is a way to tell async.io that you want to run this group of things all at once. Just start it all off. Now to clarify, we're not working in true parallel here. We're just working asynchronously. And the difference is important. Because we still have the gil. We're still in Python. So we'll talk more about that in a second. But we're basically telling async.io to just do them all. That's true. Yeah. So this function returns something called a future. And a future is a object that you can await. And eventually, in the future, it will do something. So when we call this line, that's when all the tasks are going to run. And then the last part is that we're going to use async.io has this dot run function. And you can just hand it an asynchronous method. So that's what this line here is just essentially running our main program. And I'll show you how that works. And if you run it every time, if you remember, we were sort of waiting a different amount of time between the sleeps. So if you run it over and over, you'll see them in different orders. And actually, when I was playing with this earlier, I did it in order one time. And oh, there you go. So that's kind of fun. I think maybe about 1 in 24, you should expect to be in order. One thing I wanted to do, though, was put some more print statements in here to sort of show what is happening when. So we get some sense that, to remind you, this is not parallel, when we enter this function and we hit this await, we're actually handing the process control back to Python. And in this case, we're calling a sleep. So when the sleep happens, Python's like, OK, I'm going to go do something else. Because I'm not going to just sit here and block. So whenever you hit these awaits, Python will go to the next thing in your list of tasks. And it'll run the same. In this case, it'll just hit the next await. And so you're going to hit all four awaits before any of them finish. And then it's just a matter of which one slept longer, because we have that randomness. So to demonstrate that, I'm going to stick some print statements. And you know what's going to be funny is I'm definitely going to forget to put parentheses around the print statement, even though this is a talk about Python 3, because I've been a Python 2 programmer for like, I don't know, 12 or 15 years or something. And I cannot get used to that. It's so hard. OK, let's see. Let's actually do this. Word to sleep for live typing in front of people. That's great. OK, so we'll put the word and the wait time. I remembered the parentheses. That's good. And then we can, well, we could put a print there, but there already is one. So OK, let's run that. And what's really interesting here is that you can see that those new print statements we put all happen first, because each one of them runs until it hits the await, and then the control goes back to Python, and then Python just runs the next one. The other thing that you might notice is that it's always going to print those four in the order we told, right? So we said, let's make it asynchronous. We called it in that order. And each time you can see us hitting it in that order, but then it sleeps for different amounts of times. It finishes in a different order. So that's sort of the key there. Are there any questions at this point about anything that doesn't seem clear or that I could explain better? Yeah, the question is, do I have to use the sync for the main here? I think you do. I'm not actually 100% sure. You can clone the repo and try it. Oh, I guess we could try it right now. Let's try that. Let's do an experiment. I think you do, because I think the run expects a coroutine. However, due to my confidence, we can see what happens. Yeah. Yeah, so if you don't have that, you're going to get this exception that, well, if you remove the await, then I don't think you can run async.io.gatherer without waiting on it. What are your suggestions? Oh, I see. So the suggestion is I could kill main and do this, do this, and do this. That actually seems like it could work. What am I doing? OK. That's what happens when you confuse Vim's paste with your, OK. I have a feeling this will work, actually. Let's see. Oh, my. I suppose that the gather does not return exactly what that's expecting. So we're beyond the limits of my knowledge here. But when you read examples online, you do sort of see that first form that I was showing. And of course, I have now exited, so I can't undo and go back to it. That's fine. Perhaps. Yeah. No, because you can await co-routines, too. You cannot. Run a future. Yeah, you cannot run a future. Yeah, that seems.  Yeah. And then you await your future. Yeah, that's right. That's right. You look from the morning. Yeah, yeah, yeah. So you and future is a state of thought. Yeah, yeah. So this is actually highlighting some really fun things about all of this, is that it is like a really weird, different world. And as you go, you kind of run into a lot of problems like this. It actually took me a long time of trying things. And you sometimes end up realizing that you're awaiting the wrong thing than what you think you're awaiting. And then your program doesn't run, or you end up with deadlocks. So it's a lot of times it's just kind of experimental, like we were doing here. Like you just try things and try to learn that way. Does that mean five minutes left? That's fine. OK. Yeah, that just goes away. OK, cool. You have some space here. OK. I feel like, OK. Well, let's move on, because with only five minutes left. Yeah. OK. So this is a simple form of that. Remember the problem where we're going to download my MP3s and try to turn them into Augs? So I wanted to show you a simple form of that that uses imports that aren't used in the file. So you can ignore most of those. If you remember, we start off by reading our links. This is exactly the same. I'm going to introduce this new function called download MP3. It uses one non-standard library, or uses a library that's a third party called AIO-HTTP. It's sort of like requests, except that it's a synchronous. And you can see I'm creating a session here with it. Wonder, is it better if I make it a little smaller so you can see more code? Is that still readable? Yeah, OK. So we have this download MP3. And then we have our main, which this time I'm not going to try to change. And the main looks just like that last thing we saw, right? We're creating some tasks with our links, our coroutines. And then we're going to ask async.io.gather, which basically just says, kick them all off, do it. So let's focus on the download MP3 function. It's pretty similar to our first code at the beginning. So we're trying to find out what file name it's going to be called. This AIO-HTTP, like I said, is a lot like Python requests. It is not identical, actually. So it's not a drop in replacement. I can't remember. I think one really weird difference was this one has response.read to get the bytes. But the other one is response.content. So you can't just drop it in. But it is kind of a similar idea. It's a nice library. So we're going to build a session. And notice that we do that asynchronously. So even creating our session is asynchronous. And here, we're going to ask it to get. And I think all that really does is start the connection. And next, we're going to print that we're downloading it. And then we're going to open our file. And then we're going to do this. And this is the line that it's going to wait on. So as you download the file, it's going to hit that line. And it's going to sit for a long time while you download these files. 9 to 100 megabytes each. So we can't really do that on the Wi-Fi. And then lastly, it just prints out some statuses, saying that it saved it, and so forth. Any questions about this before I bring in some more complication to it? Oh, OK. What does a sync with do? So we're all pretty familiar with the with statement. So this is an asynchronous function when we're creating the session. But we often use the with statement to clean up things when you're done. So this is a way to combine the concepts of being asynchronous and also having a way to automatically clean up when you're done. And so we want to clean up the session. And we want to clean up the call to get. Because later, all we do is ask it for the read. But that doesn't mean it has closed the connection. So I think this ensures that we close our connection and then close the session as well. Yeah, the question is, what is the client session doing? And why is it asynchronous? I don't know. That may be a detail with how AIO-HDP works. I looked at their docs for only a couple of minutes to write this. And then it worked. And then I was like, their docs sort of showed this way. So to be honest, I don't actually know how they're doing it internally or why they want to do it this way. I could only really guess. Yeah, presumably there's something about creating a session that takes some time or can be done in the background. Yeah, I would probably recommend maybe that their docs explain this. I really didn't read their docs because Jeremy Klein doesn't like when you read docs. I didn't want to disappoint him. He's always on my case about not reading the docs. Yes? Yes, so to summarize, it seems that we're handing control back to Python while some kind of creation happens here, some kind of initialization. And when all that's done, it's going to come back to us. And then we can proceed. Jeremy? I did something asynchronous inside of that. The width would exit before the future event had been completed. So you're downloading something. That file hasn't even been able to get it. Right. So you have to say, return a future.  Yeah, so to summarize, Jeremy Klein's comment, if we didn't have asynchronous theorem, we did it with, we could run through this whole thing because there's a, we've run through the whole thing before we even downloaded any file. So this is sort of a way to help us wait and sort of chain things, including the cleanup. You had a thought? I actually, I just know why there is, I don't know why this particular particular function is usually asynchronous, but I know the difference between asynchronous and normal. Because I think in this case, it could be, even use normal, normal, normal with coroutine. But the, I think it works that way that the, when you have a complex manager, you have basically two special methods. One is a enter, and one is exit. Enter is generated in the start of the context and exit after the context, even if there was exception raised. But you cannot use, normally you cannot use coroutine in there. And the asynchronous created that you could use coroutines as an asynchronous. Okay. To summarize the comment is that they sync with allows you to have an enter and exit for your context manager be asynchronous. And so it's a way, it's a way to have a schedule the enter and exit on your context manager. I may be out of time. Okay. Some people maybe want to switch to another session. Yeah, if people want to go to another session, that's fine. Okay. Okay. Well, I, if you're interested, I encourage you to look at my code because I actually had a lot more. The next code was that it actually processes the MP3 and then actually plays it. And it actually also limits how many can go at once. And apparently it's way too much to do in 30 minutes. So thank you all for attending. And if you want to look online, I've got some more code than this. And you can play with it and try it out yourself. Yeah, thank you.


So, this is lecture 13 and so what did we see last class, last class I think was talking about probability of error for MPAM, so we did probability of error and well this worked out approximately to be 2Q, is there a question, are you guys are okay, he is still asking you something, is there a question, you are okay, so guy is right behind Dinesh, did you have a question, you are okay, alright, so there was a, the way I wrote it down I said why this should be, root and not by 2, is that fine, right and from the way the energy of the signal, energy of the signal was related to D and energy of the noise was related to N0, so we could define a simple SNR, I defined that SNR in a specific way, once you define that SNR this works out to be Q what, square root of 3 times SNR divided by M squared minus 1, so that is how the SNR work, the probability of error worked out first and then we defined normalized SNR, it was just for convenience, but we saw this is a good enough approximation, it is not a very bad approximation at all, so it works out very well and I think I do not know if I completed the M squared QAM thing, maybe I did it, did I do it, I completed the M squared QAM, so this also worked out to something very similar except for some factors of 2, so I think this worked out as Q root 3 times SNR by 2 M squared minus 1, am I right, so this is how this worked out, so M squared QAM is nothing but 2 M PAMs and it simply worked out as 2 times roughly, so there is a by 2 there, it is a 3 dB penalty you pay for doing that, so that is roughly M squared QAM, so for Mre PSK for instance, for MPSK a similar derivation becomes complicated because it does not split into independent real and imaginary parts, you have to actually deal with the two dimensional Gaussian PDF and integrate, so it is not a very easy simplification to do and we will not do it, I will simply write down the final expression after a lot of approximations, you will see final expression will work out to 2 times Q root sine squared pi by M times SNR, so remember what is my MPSK constellation, it is on the circle and I am going to take the radius of the circle to be square root of E s, why would I do that, then my average energy is going to be E s which is what I wanted and then I can define once again my average noise power or energy is N naught by 2 and then my SNR would once again become E s by E m, which is the same which is a comparable quantity across different constellations, so this thing is on this circle, we have a lot of points, so this angle would be what, what would be this angle, 2 pi by m, so this is my constellation, for that if you work it out, if you work out all the expressions for probability of error, you will get this sine squared pi by M SNR, so now I want to compare these expressions and make some claims about how good is PSK when compared to QAM or PAM, so the first impulse looking at the expressions is to compare MPSK and MPAM, so I am going to argue first of all that it is not a fair comparison, why is it not a fair comparison, yes no maybe you can compare, nothing wrong in comparing it, but MPAM is real in baseband and MPSK is not real in baseband, so technically MPSK is already using double the bandwidth of PAM, so it is not a good comparison, but M squared PSK and M squared QAM I can very well compare, so in terms of what I am doing in baseband and what bandwidth I am using, M squared PSK and M squared QAM are going to give me a very good comparison, so no problem, so we can compare and see how that works, so let us try to do that, so if you look at, so the way we do it you will see it is a little bit interesting, so I will do it also on the graph, but I will first do it with the expressions then I will relate it into a graph, so let us look at M squared PSK versus M squared QAM, so let me write down the probability of other expressions, because I wrote it for MPSK, the M squared PSK is going to be slightly different, so the probability of error, so for M squared QAM works out to I will say equal to it is all approximate and up to certain 3 by 2 M squared minus 1 SNR and probability of error for M squared PSK is going to be what, 2 times Q square root sine squared pi by M squared SNR, so the first thing I will say is this 2 and 4 multiplying the Q outside will not even show up on my plot, if I plot log of PE versus SNR and DB, this 4 and 2 outside you cannot even see it on the plot, so maybe in the log scale 1 to 2 is a reasonable jump from 2 to 3 and 4 and all that there is really no significant thing, so you cannot see anything, so that is not a big deal, so we will ignore that part pretty much, and then we will ask the question, so we will assume, so we will ignore this differences, so we will say this we will ignore. Now I am going to ask the question, suppose these two probabilities of errors are equal, suppose these two have to be equal, what SNR do I need for M squared QAM and what SNR do I need for M squared PSK and I am going to compare those two things, so that is what I am going to do, so I am going to say suppose PE M squared QAM equals PE M squared PSK, what at SNR Q here and at SNR some PE here, so what am I doing here, if you plot both these PE's on the same graph versus SNR, I will get two different curves, I am fixing myself at one point on the y-axis, then I am asking the question, where do I get the intersections on the x-axis, so what are the two SNR's at which these things are achieved, so if you do that what should I do, I should simply equate what is inside the square root as an argument of Q, so it is enough if I do that, so this will happen if 3 by 2 M squared minus 1 SNR Q equals sine squared pi by M squared times SNR P, so we have been doing so many approximations, so we might as well approximate sine, for large M pi is just 3 close to 3, so large M sine pi by M squared is going to be what, pi by M squared, so you square that, you get pi squared by M power 4, so you do all that then you will see SNR Q divided by, should I do SNR P divided by SNR Q or which is a better, I think SNR P is better, so we will do that SNR P divided by SNR Q will work out to roughly 3 M squared by 2 pi squared, so it is an approximate calculation, so you have to take M to be a power of 2, so first thing to take is M equals 2, if you take M equals 2, you know 4 Pim and 4 Psk have to be exactly identical, there is no difference between the two, do you agree or not, 4 Pim and 4 Psk are exactly the same, there is no difference, but since we did a lot of approximation, here you would not get the exact equal, but it is almost the same, if you take pi to be 3, maybe it is roughly almost the same if you put M equals 2, so you have some problems there, but it is okay, it is just an approximation all over the place, but as M becomes larger, our approximation is going to be more and more true, for M equals 2 pi by 4 is definitely sine pi by 4 is probably far away from pi by 4, reasonably far away, so it is not a good approximation, so if you go to M equals 4 for instance, then this becomes a very good approximation, M equals 4, M equals 6, 8, M equals 16 and on there it becomes better and better, so if you plot this versus M, M 2, 4, 8 I have only 3 points, for 2 it works out to be 0 dB, if you do the accurate plot, it will work out to be 0 dB, for 4 it works out to be roughly around some 4.2 dB, for 8 it is around 10 dB, what do these numbers mean? So if I compare 16 QAM with 16 Psk, I get the same probability of error for 16 QAM at 4.2 dB better than 16 Psk, what happens in 64 QAM and 64 Psk? It is 10 dB better, the same probability of error is roughly obtained, but 10 dB better point, so well I have done a dB conversion as well, I mean if you do plug it in, you will get some number you have to convert to dB, so maybe this is not a good expression to use, you can even directly use the sign expression if you want, it is not a big deal. So these are the things that you can do when you, so you see this is one part of digital communication if you will, I mean you draw a constellation, compute the decision regions, compute the probability of error, then make some comparisons at that level and decide which is a good constellation. So here we are roughly deciding that QAM is better, but what advantage does Psk have over QAM? The envelope is very constant, so constant envelope is always better from so many points of view and design, so in practice maybe that is better, but today, I mean analog digital design has evolved to a stage where pretty much QAM is okay, it is not a big deal, you do not have to worry so much about QAM and QAM is almost a de facto standard, except in very very low power devices that you want to use, QAM is pretty much a de facto standard today. And you see there is an advantage over Psk in terms of probability of error. So this kind of a calculation is interesting and you should know how to do it for any two arbitrary constellations. Suppose I give you two different constellations and then I ask you to find out which is better and what is the actual gain at a fixed probability of error, you should be capable of doing all these approximations and coming up to that, okay? So maybe I would not expect you to know the 2D Gaussian integration and all that, that approximation is slightly more difficult, but to the extent possible, you should be able to approximate it and come up with some number like 1 dB, 2 dB, you should not give a complicated integration expression and say go evaluate it, it does not make much sense. So at some level it should be good. Alright, so that's about Psk and QAM. Okay, so a couple of loose ends which we haven't really looked at closely before winding up this part and moving on to strictly band limited type situations and I want to use maximum bandwidth. I'll go to that soon enough, but before that I want to just finish up a few things. One thing I didn't do is how do you come up with what is called MQAM when M is a power of 2, okay? So we did not do this yet, right? What did we do? We did only M squared QAM where M is a power of 2. So those kinds of constructions are called rectangular, square QAM, okay? Maybe rectangular QAM. So M squared QAM is a very square case, right? So I think it's square QAM, okay? So when you have other powers, odd powers of 2, okay, 8, 32, 128 and so on, you have the rectangular QAM case, okay? So you'll see it's not a big deal. You just try to pick points, enough points around to get what you want, but even this is becoming less fashionable these days. If you look at the latest even wireless standards, people will do 4, 16, 64, 256. No, they just tend to avoid the middle points because it just complicates matters, okay? Right? So there's lots of advantage in doing M squared QAM, the X and Y axis become independent. You can do so many things in a much more free fashion, okay? So I'll do this just for completeness. You'll see how it works, okay? So if M is 4, we know what it is, okay? It is a case we considered already. M is 2 I'm not doing, okay? So it's not really QAM anymore. So it's just PAM. So M is 4. You have a simple constellation. What do you do for M equals 8? What do you think you can do? Yeah, you can do anything you want, pretty much nobody's going to stop you. So you can choose. So one thing that's commonly done is either you put two points here or put two points on the Y axis. But you might say I don't want to do it. I want to pick one point here, one point here, one point on top, one point below. You may guess you can do it, okay? So it's okay. If you find that that is easy for you, you can do that also, okay? But this is a very standard 8 QAM constellation. So if you see people talking about 8 QAM, they're usually talking about this constellation, okay? So 16 is once again easy, okay? I'll do 32 also on top of 16. So you'll see I'll do 16 first. And then I show you how to do 32. It's quite easy. Just pick points around the 16 QAM constellation till you get 32, okay? This is 16, okay? So I'll draw a dotted line here to show that this is 16, okay? So this is 16. And for 32, I'll do this. This is again a standard thing to do to get 32. I'll pick four points here. Then I'll pick four points here. What am I leaving out? I'm leaving out that corner point, okay? So then I'll pick four points here. Once again, I'll pick four points here, okay? And then one can join all these guys with the dotted line. Together, now I get 32 QAM. What was, is it, does it make any logical sense to you dropping out the corner points? Why would I drop out the corner points? Sorry? Yeah, though, those are the maximum energy points, right? Let's see why the corner points have maximum energy is the distance is maximum from the origin. So they have a lot of energy. So if at all you want to drop something, you'll be better off dropping maximum energy points, okay? So this is a standard trick you can use. In fact, you can automate this process, okay? So you keep picking one, three, five, seven, so on on the x-axis, same thing on the y-axis and look at the square grid. And then drop maximum energy points till you get to the number of points you want, okay? So that can be like a general algorithm for coming up with MQAM, even if M is not a power of 2. So you might say, why do you want to pick M? Not a power of 2. Maybe, maybe for exam questions, it's a good thing to pick, okay? So maybe for those kind of things, one can do those things, okay? So 64 would be square once again, right? So 8 on each x and y, 128 would be non-square again. So you just keep picking more points and fill out the square grid and then drop the maximum energy points till you get 128. So you would get a nice 128 there, okay? So that's how you proceed for these things, all right? So this is one part which I didn't clearly talk, but you can do that. So what will be one of the complications in, say, 32 QAM and all that, okay? Decision regions will be a little bit more involved, but one can do it. It's not a big problem. You can do it. But there's also approximations to the probability of error for the general MQAM, okay? I'm not talking much about it. Okay, so other things which I've not talked at all about is the other signaling schemes which were popular and I think which are popular among particularly the low power communication devices. So you might say, what is this low power communication device? So usually when you think of sensors and all that, so what sensors would you imagine are sensing some physical quantity, like temperature, whatever, pressure and all that, and you want to put it over a large geographical area and leave it unattended kind of, you know? I mean then maybe you fly an aircraft over it and try to read information from the sensors, okay? So you can't maintain the sensors. So you can't change the battery every so often. So you want to use very little power from the sensors. So for those kind of things, you want to put a very simple communication system out there. For those kind of things, maybe something else makes sense, okay? So the problem with QAM is one of the significant problems in detecting QAM is it needs to be coherent for getting good performance and all that. There are other schemes which give you a good non-coherent detector. So FSK for instance is a very popular scheme, which you can think of in this picture also, but FSK is a popular scheme which allows a non-coherent detector, okay? I haven't talked much about it, but maybe later on if we have time, we'll do it, okay? So there are two types here, one that I left out, one I'll call, one is typically called continuous phase modulation, okay? It's also called CPM, okay? So if you don't like the likes of Prakash Karat and other people, you might want to avoid this also, okay? The other is FSK for instance, I mean, I think I talked about FSK, but I didn't do it in great detail, okay? So there's another version of it called CPFSK, okay? It's continuous phase FSK. So this continuous phase is considered one more thing which is useful in electronics from an analog electronics point of view, but today once again, it's not a big deal, okay? Even if you don't have continuous phase in your signal, people can deal with it, so it's gone out of fashion, okay? So the CPM has several, I almost said factions to it, it's not factions, several different types. One is called MSK, it's called Minimum Shift King, okay? So another one is Offset QPSK, okay? So all these things are different schemes which I have not talked at all about, but if you pick any standard textbook on digital communication, all these things will be elaborated, okay? So you might want to read through and understand what this CPM is and FSK and CPFSK. All right. So the last piece of missing information is labeling points with bits, okay? That is something I did not talk about, okay? So that's one thing and one more thing I did not talk about is bit error rate, okay? So far we've been only dealing with symbol error rates, right? So what is the probability that my received symbol is not equal to my transmitted symbol, okay? So from symbols, I have to go back to bits and that might cause some differences as far as error rates are concerned. So those two things I'll quickly talk about, okay? So one very popular way of labeling points with bits is what's called gray coding, okay? So the logic in gray coding is adjacent points must differ only in one bit, differ in one bit, okay? So it's possible to do this for almost all of our signaling schemes, okay? So adjacent points should differ only in one bit. So you start with a very simple four PAM, okay? So you have four points, okay? How do you label so that adjacent points differ in one bit? So you can't do sequential. That's the only thing you can't do. You can't do 001, 1011. So because 01 and 10 are different, two places. So all you have to do is 00, 01, 1110. It's a small change to it, okay? So you can also do 8 BAM, okay? So I'll just, there are, in fact, there are several ways of doing gray coding. This is not one way of doing unique gray coding, right? You, for instance, if you flip this or you rotate it, anything you do maintain all of these things, okay? So those, the several ways of doing it, this is just one way. And most, in most cases, you can just by trial and error figure out what the gray coding is. So you don't have to have any gray theoretical algorithm in your mind to do this. So for instance, 8 BAM, okay? So there are four points on the side, four points on the side, okay? So what shall we begin with? We'll begin with 00, what can I do next? 001, what can I do next? 011, okay? What can I do next? 010, okay? What can I do next? 110, okay? 111, okay? 101, 10, okay? So this is, so like I said, I mean, there's no real confusion. There are enough bits, enough length 3 bits, so you can just keep playing around with it and eventually you'll get to the gray code. It's not a big deal, okay? So 16 QAM maybe is a little bit more interesting, okay? So we'll do that next. I'll come to that. So right now I'm just using it as one way of coding. You might choose any other logic if you want, but I'll come to it soon, okay? So you have 16 points, okay? So how do you think you should do it? This time you look at it, it might be scary, but just start somewhere and keep going, okay? So for 2D things, it's good to split it into 2 bits first and then do the 2 bits and then do the remaining 2 bits, okay? So it always works out that way. So maybe I can try, I can try what? I'll try, I'll try the last 2 bits here, 00, 01, 11, 10, okay? And then the first 2 bits I'll keep the same for all 4, okay? And then what can I do? I can do a gray code for the first 2 bits column once, okay? So I'll do 01, 11, 10, okay? So and then retain the same 0000, okay? Okay, 01, 01, 01, 11, 01, 11, 11, 11, 10, then I do 10, 01, 10, 11, 10, okay? This is just once again, one way of doing gray coding in 16 km, you might want to do it any other way, okay? So what's the logic once again? One of the perceived advantages of gray coding is, okay? One of the easily intuitive understandings is, suppose you transmit one symbol, okay? What is your most likely erroneous symbol going to be? The next one, right? So that's one symbol error anyway, you've made an error, but when you make that one symbol error, how many bitters would you make? Only one if you did gray coding, okay? But maybe it doesn't matter in many cases, okay? But in some cases, it might matter for you to minimize the bit error rate given that you made a symbol error, okay? So if you're looking at such kind of things, if those things make sense to you, then you might want to do it. But actually it turns out today people do something called coded modulation. Suppose you do coding and modulation together, something like gray coding has very deep benefits. There are some benefits because of gray coding fundamentally, okay? So those things, one might say it's still a research type topic, okay? So people are still working on it. There are a lot of advantages here. Maybe if we have time towards the end, we'll see some of these things, okay? So but gray coding is something good. You might also do other things. It's not a big deal, okay? Ultimately, we'll see symbol error and bit error are very closely, they have to be very close. They can't be too far off, okay? After all, you're taking just log m base two bits and mapping it to a symbol, okay? It can't be two way off. We'll do that also later, okay? So but I want to point out that there are other labeling schemes out there and other, in fact, other ways of doing, multiple ways of doing gray coding itself, okay? So all these things have their own advantages. There is one thing called set partitioning, which is also considered a very good way of doing labeling, okay? So which is again something that one can look at, okay? So this said it just for completeness, so that you have a way of doing this. Okay, so the last, well the last and final thing I'm going to do is look at symbol errors versus bit errors, okay? So it's very simple. I'll do it for MQAM. You'll see it's a relatively simple idea. I'll just quickly go through it without any problem. So here's an intuitive way of thinking about it without going into the rigorous probabilities and all that, okay? If you make one symbol error in MQAM, what can happen in terms of bit errors, okay? There are several possibilities, right? If I tell you that the symbol I received is not the symbol I transmitted, right? Each symbol corresponds to log M base 2 bits. So next question to ask is how many bit errors did I make? What are the possible answers? Okay, zero is not a possibility because I already told you I made an error, okay? So it can go from one to log M base 2. So this can result in either one bit error and all the way to log M base 2 bit errors, okay? So this is the intuitive basis for what we'll be doing next, okay? Suppose I say now I transmit n symbols, okay? And the result of the transmission and detection, I made n sub s symbol errors. Suppose this happened, okay? So now if I look at the bits picture, when I transmitted n symbols, how many bits did I transmit? n times log M base 2 bits were transmitted and how many bit errors did I make? I cannot be sure but roughly it will be between, well it will definitely be between ns bit errors and ns times log M base 2 bit errors, okay? So this is the possibility. So now in this situation my symbol error rate worked out to what? Assuming all these numbers are really, really large, I am doing it for a long time, my symbol error rate will roughly be ns by n, right? What will be my bit error rate? Well I cannot be sure but I can bound it. I know at best at worst it will be ns by n and at best it will be ns by n log M base 2, okay? Right? So this is the, this is, this is very true. One can also show it very rigorously if you want. Probability of bit error is bounded between probability of symbol error and probability of symbol error divided by number of bits per symbol, okay? So it is a very simple intuitive thing to remember. So if I look at a case where everything is going to 0, if I force everything to 0 then it does not matter. And symbol error rate goes to 0, bit error rate will also go to 0, okay? Because it is sandwiched in between, okay? So that is the, that is the logic, all right? So we do not have to worry too much about the distinction between bit errors and symbol errors. You can look one on any one thing and build a, build a certain result and that will also be valid typically for bit error rates, okay? So that is, I think that pretty much ties up our loose ends. I want to briefly summarize where we are and then move to the next logical step, okay? So here is the summary, okay? Remember, so far we have been looking at an ideal AWGN channel but also very large bandwidth, okay? So I have been trying to emphasize this very large bandwidth. How did I, where did I make that assumption of very large bandwidth? Okay? Yeah, so I was saying my signals are going to have started 0 and ended T, okay? So once I say that, my bandwidth is going to be very, very large and I love to receive that signal. So I am assuming my bandwidth is very large there, okay? So because of that assumption, everything worked out properly for me, okay? So if I did not make that assumption, so many things would not have worked out. So because of that, I could pick my bases in a very simple way, okay? I can simply window the bases and pick it, okay? So the first thing we spent some time understanding is the equivalence between real base band and one of the very crucial things and complex pass band, okay? So this is a very, very, okay, sorry, real pass band and complex base band, okay? This equivalence is very, very crucial and how did we go back and forth? By up conversion and down conversion by multiplying suitably, okay? You have to take a real part root 2 times and all these things, okay? So that was one of the most important concepts that we introduced in this context, okay? So real base pass band and complex base band and that's very useful, okay? And so what else did we do? Okay? And then we assumed that the bandwidth I have is much, much larger than 1 by T, okay? So what is T now? Okay? So once I assumed this, I was able to pick a very simple signaling scheme, okay? So signaling became very, very simple because of this. In what sense, okay? I can now pick just one basis function, phi of T, okay? Which is what? It's simply constant between 0 and T, say 1 by root T, okay? And then what can I let every other signal to be?  The reason why I was able to do this is because since my bandwidth is much, much larger than 1 by T, I know that this signal will come through unaffected, no problem. It won't exactly come through as it is, okay? And if I now send another symbol after that, what will happen? That will also come through exactly, right? So I can even string symbol after symbol in this way and get them faithfully at the other end because I have enough bandwidth, okay? I assumed a huge bandwidth was there. So even if I send symbol after symbol, none of them will cause any problem. So I can repeat this for every 0 to T and I will get it, okay? So in practice, if your bandwidth is not very large, what would you do? Yeah, just increase the T, keep on sending it for a long time till you are sure that it will definitely come through, okay? So don't change it too fast, okay? So this is definitely an implementable scheme for any system except that you won't be using the bandwidth optimally, okay? So we did that, signaling was simple and I want to write down how that signaling worked out, okay? So this is how this complex baseband QAM worked out for us, okay? So we started with B which was 2 times log m base 2 bits, okay? This is going to give me what? What is the first step? The way we picture it? Or do you take the bits and then pick a point from my constellation, okay? So it gives me this a plus jb which is the point in the constellation. Then what do you do? You multiply this a plus jb by this basis to get my complex baseband signal, okay? This is my complex baseband signal. Then what do I do? I upconvert, okay? So once I do upconversion, I get my real passband signal xabt, okay? So this is going to go through some additive noise and they receive something and then what do I do? I do downconversion to get something and then I do a correlation receiver. In this case, the correlation simply becomes an integrate and dump, you have to integrate over a long time to make sure you are using the bandwidth and all that, but this becomes an integrate and dump, there's no problem, okay? So it's actually, it comes from, we know that this is the optimal thing to do from the correlation receiver ideas, okay? So we know the optimum receiver has to do the correlation and which worked out to this. So once you do integrate and dump, what do you get?  Two-dimensional noise and what is the pdf of this noise? iid normal means 0, variance n0 by 2, what is this n0 by 2? PSD of the n of t, okay? So in our model, what do we do? We jump directly from here to here for probability of error calculation and all that, but you can choose to jump from anywhere to anywhere, right? Go in this scheme anywhere and see the correspondence, but for various calculations, some things are easy. So here then you do a detection, okay? And your detection is, okay? The various types possible, MAP, ML, but the simplest thing is what? Minimum distance, okay? And whether it is optimal or not depends on several conditions, but that might be okay, okay? And you get your b hat, okay? So this is the picture that we have been looking at so far, okay? And we did several calculations with it, tried to convince ourselves that it works and it is good enough and people who are doing 471, this might be a first-cut model to implement and see whether it works or not, okay? So that is a very simple nice model, all right? So now we have to start using the bandwidth better, okay? So you might say, why do I want to use the bandwidth better? For one, you might want a faster rate of communication, okay? Given a certain bandwidth, you might want, for instance, the maximum rate at which you can communicate, okay? If such a thing exists, okay? So there are all, so there are some several problems with that. So once you do that, once you say, I am going to also occupy a lot of bandwidth, what will happen? What will happen? One of the crucial things that will happen is, I can't just think of each of these symbols separately, okay? So right now I can run this continuously, why? I can send the first symbol, wait till 0 to t and then send the second symbol and I know I will receive all of them properly and my entire thing will work because my bandwidth is so large compared to this 1 by t, I know everything is going to go through, there is no problem. Now if I start occupying larger and larger bandwidths or decreasing t, okay? So I am increasing my bandwidth, first thing that will happen is, right? What do you think will happen? First thing that will happen is one symbol will spill over into the other symbol, okay? So I will maybe draw another picture and show you how it can happen. So as you guys keep occupying more and more bandwidth, okay? So your time for the signal is becoming shorter and shorter, right? So before the first symbol kind of dies out and it's enough, you'll be starting the next one, okay? So eventually you will have spill over from one symbol to another. So you have to worry about continuous operation, okay? That's the first thing you have to worry about, okay? When you go and want to fill up your bandwidth and occupy a lot of the bandwidth and communicate at a faster rate with limited bandwidth and you do that, you have to worry about continuous operation. You have to look at one symbol to the other, okay? So that will be one significant change that will happen. But beyond that, most of the things will be similar. The same model we'll try to carry over, okay? So we will not drop this correspondence between real pass band and complex base band. It's really useful to us. We want to retain it. We will not suddenly drop the signal constellation. We will still retain it, okay? We will not drop this view of signal space, correlation receiver and detection principle. We will not drop all of that. All of them will be the same. We will try to manage with the same type of setup but change some things crucially here and there and try to make the same thing work. And you'll see it's possible, okay? Definitely for ideal AWGN band limited channels, you can do it with very simple changes. When you don't have an ideal channel, you have to do more tweaks, but it's possible, okay? So that's where we are headed in the next few classes, okay? So the next thing we'll do is we'll look at what are we doing next. Ideal band limited AWGN. Not really large bandwidth. I don't have too many too much bandwidth to burn, okay? So that's the next thing we'll see. Okay? Once again, there are two ways of viewing it. I'm saying band limited. Well any system is really band limited. But what did I do in the previous scenario? I did not use all my band. I used a very small bandwidth, okay? So now there are two ways of viewing it. I'll either say I want to occupy all the bandwidth or signal at a very fast rate. I want those constraints, okay? Those conditions. Those conditions are important, okay? So right now, so you see, what was missing in the previous picture was this trade-off. The bandwidth never really entered the picture because I assumed I'm not going to worry about it. Now we're bringing bandwidth in, okay? So that will give us a nice complete picture of the entire trade-off between bandwidth, power, probability of error, noise power and everything, okay? So this will kind of complete the picture, okay? So this is ideal band limited AWGN. So what is the picture that I'm going to have? Well, so the old picture still remains, okay? So the problem I have is still the same. It's not in any way different. I have n bits, which I want to transmit. So I'm going to use a transmitter and put out some XB of T, which is going to go through a channel, okay? And I'll get a Y of T, which I want the receiver to process and get a B hat, okay? So this is my picture and how am I going to model the channel? Once again, I'm going to model the channel with an impulse response H of T, okay? And that impulse response will correspond to a Fourier transform H of F, okay? So now I might either have a pass band channel or a base band channel, okay? Both possibilities are there. My channel could be either a pass band channel or a base band channel. What do I mean by that? At my disposal, I either have a bandwidth which is in pass band or base band, okay? Usually in wireless and all that, you always have pass band, okay? So but in wire line in some situations, it's possible to imagine having a base band channel, okay? So but I'm going to say my channel right now is ideal. What do I mean by ideal? Within that band, it's flat. H of F is flat. That's what I mean by ideal. Whatever bandwidth I have within that bandwidth, my channel is flat, okay? So that's my assumption, okay? So if you think of H of F, since it's flat, maybe if you say pass band, okay? It's pass band, then it's going to be some W frequency in pass band. So if you, since I'm going to say H of T is real and all that, it will also have a W on the negative side. So I know if I think of down conversion, I can down convert this pass band real channel response into a complex envelope equivalent. If I do that, what will be my H tilde of F? It's going to be between minus W by 2 and W by 2. And since I'm assuming it's ideal, right? What will be the H tilde of T? That will also be real, okay? So you see the complex baseband picture actually becomes a real baseband picture because of my ideal channel assumption. So I don't have to worry too much about complex in this case, okay? So I might as well take without losing any generality about the channel, a real baseband impulse response, okay? Since my channel is ideal, that is good enough, okay? So that doesn't mean my XB of T will be real, okay? This is only for H of T, okay? Why will my XB of T still have to be complex? Yeah, but I still want to use the entire bandwidth. If it's pass band channel, right? I want to use the entire bandwidth, which will mean I have to make my XB of T still complex so that when it goes to pass band, I will be using the entire bandwidth. So my XB of T can still be complex, but I'm going to say since it's ideal, my H of T will be baseband real, okay? So I can make that assumption because even if it is pass band real, it's going to be baseband real anyway and baseband I'm assuming it's ideal. So it's all ideal. So without loss of generality, we'll take H of T to be baseband real, okay? So when I introduce non-ideal channels, maybe at that point you'll have to assume H of T can be baseband complex, okay? But still baseband is good enough, okay? Because I know I can down convert and view the whole thing in baseband, okay? So that's the first thing we'll do, okay? All right? So now this is simple. It's not too bad. So let me go back and look at requirements on XB of T, okay? So did I have the picture here? Okay. So let me just cut and paste this picture. I don't want to once again draw this. Oh, I'm running out of time. So let me see, okay? All right. So this is my picture now. I'm my H of T. What am I going to assume my H of T to be? I'm going to say H of T is baseband real, okay? So I can do that without any real problems here because of my ideal assumption, okay? So once I do that, so what should my XB of T necessarily be, okay? So the first constraint you need is yeah, it has to be band limited between minus W by 2 and W by 2, okay? Also, I want to be able to repeat this, right? I mean, I want to do it at a reasonable time. So XB of T should also have finite support. It should also be time limited, okay? So this XB of T is seemingly, I mean, the requirement is it has to be both time limited and band limited, okay? Band limited between minus W by 2, W by 2, time limited say maybe 0 to Tn, okay? Some Tn, okay? So picking that we use some time limit, okay? We know definitely that these two are strictly, fully, rigorously not satisfiable. So we'll satisfy them only approximately, okay? So usually the time limit is strictly satisfied because you know in your system you can't keep transmitting one signal forever, okay? So time limit is strictly satisfied which means the band limitation will only be approximately satisfied. So approximation in the sense to an arbitrary accuracy say for instance outside of W by 2, the spectrum will go down to say minus 50 dB, minus 40 dB, minus 30 dB, whatever. Some very low numbers so that you're not interfering with anybody else who wants to use that spectrum, okay? So outside of W by 2 my spectrum will have to drop down to really, really low. That will be my, that will be the way I'll be enforcing this limitation but usually like I said time limitation is, will have to be strictly enforced, okay? So today that's how people do it. Alright, so that's the first point to note but the second point is more critical, okay? There's another requirement on XB of T which comes because of the requirement of continuous operation, okay? So what is the second requirement? This is the, this is, this is because of continuous operation and we'll see it in the next class, okay? The fact that I want to send the next symbol as well. I send the first symbol, first set of n bits then I want to send the next set of n bits as well and if I'm using a lot of bandwidth I'm going to get interference between these two signals and how do I avoid that? Is it possible and all that is what we'll look at next, okay? So because of continuous operation we get that. We'll see that beginning next class.


Hello and welcome to the session. In this session we discussed the following question which says two triangles A, B, C and D, B, C are on the same base B, C are on the same side of D, C in which angle A equal to angle D equal to 90 degrees. If C, A and B, D meet each other at E, show that A, E into E, C is equal to B, E into E, D. Let's move on to the solution. This is the figure where we have triangle A, B, C and triangle D, B, C on the same base B, C and on the same side of B, C and we have angle A and angle D as 90 degrees and C, A and B, D meet at the point E. So first let's write down what all is true to us. We have that angle A is equal to angle D equal to 90 degrees and we have to show that A, E into E, C is equal to B, E into E, D. First we have that in triangle A, B and triangle D, E, C, angle A is equal to, angle D is equal to 90 degrees which is already given to us. Then we have angle A, E, B is equal to angle D, E, C since they are vertically opposite angles. Thus we say triangle A, E, B is similar to triangle D, E, C by A, A similarity criterion and thus the corresponding sides would be in the same ratio. Therefore we have A, E upon D, E is equal to B, E upon C, E equal to A, B upon D, C. Let's consider this. So from here we get A, E into C, E is equal to B, E into D, E or we can also say A, E into E, C is equal to B, E into E, D. So hence proved. So this completes the session. Hope you have understood the solution of this question.


I am Lloyd Kelly, and this is the Bull Swap Challenge. Can I stand as close as I want to this table like this? Boom! A strong, silent type. He did what he had to do. Yeah! 29! Number one.