There. So now what I'm going to show you is this. I'm going to sample this over and over again. Okay so in other words suppose I have my detector send out a read a signal. I read a signal this. I keep reading 30 second slices of time. Okay and presumably I keep getting different noise every time, right, cause white noise. So what I'm going to do is ask what happens to these if I go through and I start sampling over and over again. Okay. I can do anything I want. I am master of my code. I can make noise a million. And by the way, that might just be one realization. I run it again. Okay, so there's a little bit of a spike there, fine, we'll go 30. I want to try to clean that up. As far as you can see in that blue there is no evidence of anything right remember you got to launch a missile or do something cool like that or save your dog. So you got to figure this out, don't want any dead dogs in this class, cuz I'll be held accountable, probably. Alright, here's what we're going to do, we're going to do a little loop, for J equals 1-30. So what I going to do in this loop is the following. I'm going to take my. Deal here. Let's, let's actually this just needs to be defined once so let's bring this outside Lou so I have some noise which is 30. Yeah let me take away these sub-plotting routines for a moment. Okay. Here's what I want to do. In this loop we've gone this loop 30 times and each time we do it I'm going to generate a new signal. Sorry I have the same signal, but I'm going to generate a new signal because I'm going to add noise to it. So it's the same signal that I keep reading, right? So in a radar problem if there's a plane out there, I keep picking up that signal from the plane but it's buried, but it's buried inside noise which keeps changing in time. Okay so every time I do this I have this issue of t that stays the same but now the noise changes every time. So every time I do this I get different noise on it, different noise on it. So each one of'em just looks like just what we had before nothing there. So what I'm going to do is I'm going to just keep doing this. And I'm going to ask if I do this and I go through this loop I want to actually just calculate the average of what my spectrum looks like. I'm going to add if I take 30 measurements. I'm going to add them together and divide by 30. What happens to the noise? What I know is, is white noise, when it's uncorrelated. All that noise should have mean. Sweet. Everything just going to just fair anybody. One. Tough crowd. Tough crowd. Alright. I'm going to show ya a magic trick, right? Okay, all right laptops usually don't come out of your sleeves [LAUGH] iPhones can. but. Okay. One believer in the class. Let's see how many of the others I can make believe in this. Alright, so here we go. . What's that? Inverse. Inverse voice transform. So let's go through this and say, okay, here's what I'm going to do. I've got to keep track of all this, right? So what I'm going to do is the following. I'm going to make a vector, called average, And I'm going to start off with just a bunch of 0s in it. And what I'm going to do with this vector is after I've done computing the signal I'll say well my average is what it was before plus this UTN. We'll just keep stacking the information in it. And at the very end, after done this 30 times, we go through this loop 30 times, keep stacking my average information there. At the end I'm just going to take this signal, and divide by the total number of times I did this, right. So I could say, alright well, how about we do this? Average is equal to absolute value of. So first I'm going to shift it. I took 30 slices so just divide by 30 we'll make this a little more general in a minute actually let's do the following. so we took 30 realizations is a, I don't like to make variable names that long. Cuz I misspelled them that long. so what I'm going to do is I'm going to take, I'm going to basically, remember av is basically I've added it all together, by the way you don't add the absolute value, okay? So I'm like you take the, , absolute value of each, an add them together you take the raw signal, otherwise you've, the minus and plus's that are there don't cancel, it's all positive, and it all adds up and it'll look like no it's worse if you take more data, right? It should always be better you sample 30 times, you got 30 things now to make a decision with, right? Okay, so I add them all together. I'm going to ask that you shift it, take steps of five, divided by the realization and I want to plot that, okay? So, let's go ahead and plot it. All right, so here's why I don't have a plot in here first. The original signal. The absolute value at oop. So this is my perfect signal, we crop that in red. So remember what I did is I, before I polluted this thing with noise, I had this, I know what the answer's supposed to be, right, and I've added noise to it. So this is what the answer's supposed to be. That red line is going to come out, okay? Now, let's look at this compared to the average, which is I added everything up, divided by the total number of realizations, and I'm going to plot that in black. Okay, and by the way, let me plot a single realization. If, if we go through this loop, we went through this loop from J equals one to realizations. The last time we went through the loop we had this thing called UTN. So that was just one example of realization. Let's also plot that. So, KS versus the absolute value of, and I, FFT shift of ETN, there and we'll plot that in yellow. I want it to be sort of subtle. Okay, how about cyan? Okay, I want it to be sort of not a strong, dominant color. Or else, it'll take up the whole picture. Okay, so first of all, so let's talk about this picture. The psy N is one measurement. My last one. I took 30, that's what the psy an is. The red is the exact answer and the black. That's averaged over 30, okay? Actually, that's not so bad look at that kind of get's my peak, right? Let's see how well we can do. So right, so un fact, what, here's what I'm going to do. We're going to start looking at realizations. What happe ns if I have one realization, were I get the blue? If I have two, how well do I do? You know and then we'll start stepping it up to see how well does this converge. What's the answer if I have a thousand reali, you know, a million, okay? What's the answer of a thousa, infinity. Sorry, that's the answer I was looking for. My daughters their nine and six. And their trying to understand this thing called infinity. They've heard of it like, my youngest daughter, six, is like what happens if you, and she always makes up these toy problems. Like, you know ten billion 35, is that bigger than infinity? . Now, all you got to go figure what happens though if you multiply that plus twenty . The older one king of gets at me, be a little pissed and the younger one, she's, she, she's there, gettin in concept infinity, and if you go to infinity. That red line will be black. The black line will go red to the red line. And you had a question. No. Yes. Okay. Yes. Why don't you need to FFT shift to average? Oh, we did already. I did. You did it when you add it . Yeah. I . So now, so now let's look at this thing here. And, in fact, you know what? This is going to be pretty sweet. We're going to make a little movie. Ready? You're clearly not. But anyway, okay. . Alright, let's, let's try to do this. Let's put this inside the loop. And I will plot it inside the loop. So when J is one, we're going to plot this, hold. And so then we're going to do this pause for half a second. And so when it goes through the first time, you'll see. In fact, what we're going to do, is take out the cyan line, that's the individual run. And all we're going to plot is. Essentially the average verses the what were suppose to get ready? Okay let's see. J, thanks. Gary, any, anybody else, I think that, hopefully is it. And now, we're going to go also through and do this a hundred times. Oh yeah, it's not a good idea either, right? Hold on, hold on. Oh, so I, I just, I should call this something else. How about that? I faked my code out. Thank you. I have tw o, okay? Are we ready? I think we're ready to push the go button. It will, hold on, here it, I got pull this in so you can see it, oh come on, come on, no, okay, now I got to kill it, okay, there it is okay, fine, it's going through, see that, see what's happening. Dang. I know what's it look like its doing to you. Okay it's looking pretty good to me. Is it looking good to you? I don't know what realization we're on. And what you can see, as we take more and more realizations, right? We take more and more averages, we keep sampling this thing out. The noise cancels itself out. And you basically get the black line is just folding right on to the red but it's suppose to. There's a real signal in there, okay? Now, if there was no signal in there it would all just go to zero. Okay, so this is another way to take your data subtract the noise out. You know something about noise make use of it. If there's anything in the problem that you're not making use of you're probably not doing the problem right, okay? Every piece of information you have should be used. Here we're using information now about the noise. Okay, after a hundred, this is what you get. So, this can be like your dog problem. Your dog problem is the following, right? You're going to first of all, I haven't told you what the center frequency of your dog problem is. Here I kind of knew. You know, I embedded, I have the answer, right? It's on my computer. I said make a little signal right there in the middle of your domain. I don't do that with the dog problem. I make it up, and I don't tell you where it is. So you've got to figure out where I should even filter, right? All right, so in this process you notice if I sample a lot, I clearly have a spike right there. So even if I didn't know where to filter I'd say Oh, maybe I should filter right around here. There seems to be something there that's not just noise. We go that?