Thumbnail for null by null

5m 8s854 words~5 min read
Auto-Generated

[0:06]So one way to do that is we can actually use some information that we already know about the original signal. So we know that the original signal has a certain number of features, like we talked about earlier. We have a certain number of samples in the original signal. And we know that we can, if we know something about what we're sampling, then we can use that information to kind of help us fill in the gaps for all those missing data points. And the way that we're going to do that is we're going to make a copy of this array, but it's going to be a blank copy. So we're going to, so we're making this new array that's made up of zeros in this case, and we're just going to call it interpolated signal. And what we're going to do is we're just going to take all of our original data points, and we're just going to fill them in at the corresponding locations within our interpolated signal. So basically, we're just taking these guys, and we're just moving them over into these guys right here. And so then what we're left with is basically this is basically our original signal, but then we've got all these missing data points, all these zeros in between, that are just kind of filling in for where we don't have that data. And the way that we're going to fill in these data points is actually using a method called linear interpolation. So if you remember from, I don't know, maybe like eighth grade math or something like that, you probably learned about how to calculate a linear equation of a line. And you may have learned something about the equation of a line, where it's y equals mx plus b, where m is your slope, and b is your y-intercept. And really, what we're doing here is we're taking the two data points that we know and that are closest to where we're going to try to estimate a point. And we're just going to connect a straight line in between those two points. And then we're going to basically use that line to predict what all the points along that line would be for all of the missing data points in between. So in this case, we've got two samples that we know. We've got this sample right here, and we've got this sample right here. And we want to figure out what are these two sample values right here going to be that are in between these two known points. So we know that we can do that by basically creating a line in between those two points. And we're just going to do that, and we're going to calculate it by doing a simple equation. We're going to take the slope, and we're going to multiply it by the x value, and then we're going to add the y-intercept. And we're going to do this for all the points that are in between that line. And so basically, what that does is it basically gives us this kind of jagged-looking signal right here, which is basically an estimate of what the original signal would look like had we actually sampled it at that higher sampling rate. So now you might be thinking, well, we've got this jagged-looking signal, but we want a smooth signal because we want to be able to recreate that original analog signal, which is smooth. And the way that we're going to do that is we're going to apply a low-pass filter to this signal right here. So if you remember from our earlier talks, a low-pass filter basically takes out all the high frequencies within the signal and only lets the low frequencies pass through. And basically, what it's going to do is it's going to kind of round out all of these sharp corners and make the signal more smooth. So it's going to kind of smooth out the signal right here, just like that. And so basically, what we're left with is basically this signal right here, which is a fairly good estimate of the original signal that we originally sampled. Now, it's not going to be a perfect estimate of the original signal. You'll notice that the amplitude is not going to be quite as high as the original signal was. But really, what it allows us to do is it allows us to reconstruct a signal that is a higher sampling rate than the original signal was. So we're able to take a signal that was sampled at a low sampling rate and then reconstruct a signal that is at a higher sampling rate. And so that's basically how upsampling is going to work. You're basically interpolating new data points in between the original data points. And then you're applying a low-pass filter to smooth out all the edges, and you're getting a reconstructed signal that is a higher sampling rate. So now that we've talked about upsampling, let's go into Python and try to actually upsample a signal.

Need another transcript?

Paste any YouTube URL to get a clean transcript in seconds.

Get a Transcript