1 00:00:00,012 --> 00:00:06,029 In this video, we're going to learn about how to process signals on a computer. 2 00:00:06,029 --> 00:00:12,410 we'll venture into the world known as digital signal processing. It turns out 3 00:00:12,410 --> 00:00:18,295 that my research area is DSP, you're going to hear me talk about DSP a lot. 4 00:00:18,295 --> 00:00:23,262 And so, we're going to to start just like we did for analog signal. 5 00:00:23,262 --> 00:00:27,880 We're going to start talking about fundamental signals and the basic 6 00:00:27,880 --> 00:00:31,403 systems. And one of the points of this video is 7 00:00:31,403 --> 00:00:36,196 that the, in the digital world and in the analog world, there are a lot of 8 00:00:36,196 --> 00:00:40,852 similarities about how you think about signals and their spectra. 9 00:00:40,852 --> 00:00:46,372 So we'll see that you're going to already know a lot of what [UNKNOWN] say but 10 00:00:46,372 --> 00:00:49,976 there's a few little things a little bit different. 11 00:00:49,976 --> 00:00:53,268 Alright. And the first thing, of course, is we're 12 00:00:53,268 --> 00:00:56,432 going to start with the complex exponential. 13 00:00:56,432 --> 00:01:00,139 Our friend, this is our most important signal that we 14 00:01:00,139 --> 00:01:05,922 have just about. And if you recall, a discrete-time signal 15 00:01:05,922 --> 00:01:12,567 is a function only of the integers. So we call this a digital signal. 16 00:01:12,567 --> 00:01:18,537 I'm being a little careful here about saying discrete-time. 17 00:01:18,537 --> 00:01:25,949 Digital signals usually refer to discrete in time, functions of the integers, and 18 00:01:25,949 --> 00:01:31,316 discrete in amplitude. Well, I'm going to just talk about 19 00:01:31,316 --> 00:01:39,133 discrete-time signals pretending that the amplitude is a continuos value variable, 20 00:01:39,133 --> 00:01:43,272 and it could, it could be any real number. 21 00:01:43,272 --> 00:01:48,818 It turns out that's not really true. In a computer, you can't represent all 22 00:01:48,818 --> 00:01:53,276 numbers exactly. Everything is discrete-valued but we're 23 00:01:53,276 --> 00:01:57,552 going to hide that detail in the, in the way we do our theory. 24 00:01:57,552 --> 00:02:00,923 Alright. The first thing to note is in this 25 00:02:00,923 --> 00:02:05,760 complex exponential here, the frequency variable has to 26 00:02:05,760 --> 00:02:10,439 dimensionless. Has no dimensions, because n has no 27 00:02:10,439 --> 00:02:16,173 dimensions, and you cannot exponentiate anything that has units. 28 00:02:16,173 --> 00:02:23,542 So, f is dimensionless, and furthermore, here's a very interesting property. 29 00:02:23,542 --> 00:02:33,547 Suppose I consider, the frequency f plus an integer, so l is another integer. 30 00:02:33,547 --> 00:02:41,522 And if I write this as a product, e^j 2pi times an integer is one. 31 00:02:41,522 --> 00:02:49,842 So, you get that this is equal to that. That's the definition of a periodic 32 00:02:49,842 --> 00:02:55,265 function. So, f is periodic for any integer and, of 33 00:02:55,265 --> 00:03:05,628 course, one with the smallest period. So, this is periodic, the period of one. 34 00:03:05,628 --> 00:03:14,094 That's very important. So, every function that frequency that 35 00:03:14,094 --> 00:03:22,212 we're going to talk about has to be periodic with period one. 36 00:03:22,212 --> 00:03:29,032 Because of, of the dimensionalist nature of f and the fact that n is an integer. 37 00:03:29,032 --> 00:03:35,581 We didn't have this for the analog complex exponential because t was any 38 00:03:35,581 --> 00:03:43,867 real number and f had to have units of inverse seconds in order for the exponent 39 00:03:43,867 --> 00:03:49,140 to be dimensionless. n here is dimensionless that makes f 40 00:03:49,140 --> 00:03:51,357 dimensionless. Alright. 41 00:03:51,357 --> 00:03:59,151 But this periodic behavior has a interesting consequence so f is periodic 42 00:03:59,151 --> 00:04:04,018 with period one. And it turns out, let's consider this 43 00:04:04,018 --> 00:04:11,676 complex exponential which has a frequency of 1-f and if you go through all the math 44 00:04:11,676 --> 00:04:18,916 again, that's one and that's the same as the complex exponential at negative 45 00:04:18,916 --> 00:04:22,242 frequency. So, here's our f-axis. 46 00:04:22,242 --> 00:04:30,518 And here's 1/2, -1/2, and 1. Let's extend it out to -1. 47 00:04:30,518 --> 00:04:42,557 So, if you have some it's got to be periodic with period one so that means 48 00:04:42,557 --> 00:04:49,900 this part looks like that. It turns out that this part, the part 49 00:04:49,900 --> 00:04:58,499 greater than a half, has to be the same as this part because it's periodic. 50 00:04:58,499 --> 00:05:05,002 So, this is the same as that. So, a frequency at 0.6, let's say, a 51 00:05:05,002 --> 00:05:12,597 little bit bigger than a half, according to this formula, well, that is 0.6 is 52 00:05:12,597 --> 00:05:20,767 that makes this f 0.4, 0.4 which means that f is got to be the same of the same 53 00:05:20,767 --> 00:05:27,382 value as -0.4. So, the highest frequency you can have, 54 00:05:27,382 --> 00:05:36,437 it turns out, is a 1/2 because once you go above a 1/2, that winds you up in 55 00:05:36,437 --> 00:05:43,169 negative frequency. So, here's the name of the game. 56 00:05:43,169 --> 00:05:50,751 The lowest frequency sinusoid occurs at f=0, the highest frequency complex 57 00:05:50,751 --> 00:05:54,881 exponential whatever is at frequency of 0.5, 58 00:05:54,881 --> 00:06:00,112 that's the highest frequency that makes any sense. 59 00:06:00,112 --> 00:06:07,099 You got little bit higher than that, you wind up back at may be frequency. 60 00:06:07,099 --> 00:06:13,920 so, in this highest frequency complex exponential, it turns out to be an 61 00:06:13,920 --> 00:06:23,237 alternating between plus and -1 forever. So, when we talk about signals, there are 62 00:06:23,237 --> 00:06:29,517 functions of quantities, there are functions of frequency. 63 00:06:29,517 --> 00:06:34,622 We're either going to define them over -1/2 to 1/2. 64 00:06:34,622 --> 00:06:40,099 That's a period. Or we can talk about them going as a 65 00:06:40,099 --> 00:06:47,716 function from 0 to 1 and realize that this part is the same as that part. 66 00:06:47,716 --> 00:06:56,645 This is positive frequency, this part is negative frequency and then there, that's 67 00:06:56,645 --> 00:07:03,243 the one difference, a very important difference between discrete-time signals 68 00:07:03,243 --> 00:07:05,862 and analog signals. Alright. 69 00:07:05,862 --> 00:07:12,472 Let's then extend this to a sinusoid. the formula looks the same and the 70 00:07:12,472 --> 00:07:18,097 difference is, is that n is an integer, which again, makes f have no no 71 00:07:18,097 --> 00:07:21,972 dimensions. And we're usually going to pick f around, 72 00:07:21,972 --> 00:07:25,472 in that range. So, the highest value of f makes any 73 00:07:25,472 --> 00:07:30,032 sense to talk about is f. And you get what looks a sinusoid but, of 74 00:07:30,032 --> 00:07:34,682 course, it's only defined with integers so you get a stem plot. 75 00:07:34,682 --> 00:07:42,480 And what doesn't change, of course, is Euler's formula. 76 00:07:42,480 --> 00:07:51,068 So, this sinusoid can be written as the real part of Ae to the j phi times 77 00:07:51,068 --> 00:07:55,767 e^j2pifn. So again, that's the complex amplitude. 78 00:07:55,767 --> 00:08:01,042 That all falls through nothing really changes in that regard. 79 00:08:01,042 --> 00:08:05,227 So, let's talk about some other fundamental signals. 80 00:08:05,227 --> 00:08:11,077 And here's our friend, the unit step. And I want to point out that I'm now 81 00:08:11,077 --> 00:08:15,317 defining it everywhere. [LAUGH] Be happy I guess. 82 00:08:15,317 --> 00:08:20,212 So, here's the n-axis and I'll plot u of n. 83 00:08:20,212 --> 00:08:29,507 And it's zero with, and this, zero pops up to one at the origin and there's one 84 00:08:29,507 --> 00:08:31,987 forevermore, okay? 85 00:08:31,987 --> 00:08:39,146 So, that's the unit step. it's a familiar quantity we've seen 86 00:08:39,146 --> 00:08:42,996 before. Here's a new basic signal that we didn't 87 00:08:42,996 --> 00:08:46,821 have in the [UNKNOWN] called the unit sample. 88 00:08:46,821 --> 00:08:52,301 And this one is very simple. It is 0 basically everywhere except at 89 00:08:52,301 --> 00:08:57,857 the original where it's 1. That's why it's called a unit, and it's 90 00:08:57,857 --> 00:09:04,387 called a unit sample, because it looks like it's one value, okay, and is being 91 00:09:04,387 --> 00:09:06,912 rewritten by delta(n). Okay. 92 00:09:06,912 --> 00:09:11,392 Now, here's the reason we talk about the unit sample. 93 00:09:11,392 --> 00:09:19,660 Let's sketch out here some signal which I am just going to call S(n) and let's 94 00:09:19,660 --> 00:09:23,889 assume that this is the origin n=1, n=2, etc. 95 00:09:23,889 --> 00:09:28,969 along that scale, the horizontal scale there. 96 00:09:28,969 --> 00:09:35,652 The value of the signal at the origin is, of course, S(0). 97 00:09:37,020 --> 00:09:49,182 What is the signal at the origin? Well, it's a unit sample whose amplitude is 98 00:09:49,182 --> 00:09:51,177 S(0), okay? 99 00:09:51,177 --> 00:09:59,827 S(0) is just a number. So, what the signal is at the orgin is a 100 00:09:59,827 --> 00:10:08,652 unit sample. This signal, the value, the signal at n=1 101 00:10:08,652 --> 00:10:16,632 is S(1) times a unit sample which is a delayed version of the unit sample. 102 00:10:16,632 --> 00:10:25,362 It's delta(n)-1, alright? Because this signal is a delayed version of that and 103 00:10:25,362 --> 00:10:27,072 it's delayed by 1 unit, etc. 104 00:10:28,807 --> 00:10:35,612 This is S(2), S(3), S(4), S(5), etc. because it's just a 5 down there. 105 00:10:35,612 --> 00:10:41,687 So, what we get is a somewhat confusing but very important formula. 106 00:10:41,687 --> 00:10:47,887 That a signal, any signal can be expressed as a superposition of unit 107 00:10:47,887 --> 00:10:51,837 samples. In fact, that's the definition of a 108 00:10:51,837 --> 00:10:56,942 discrete-time signal. It is a superposition of unit samples 109 00:10:56,942 --> 00:11:03,207 where we use amplitude at every sample expresses whatever the value the signal 110 00:11:03,207 --> 00:11:07,927 has at that lay. So this may look a little funny here but 111 00:11:07,927 --> 00:11:13,362 the idea here is that the real signal is the part that depends on n. 112 00:11:13,362 --> 00:11:17,803 Here's the only part that depends on the n in the formula. 113 00:11:17,803 --> 00:11:23,361 We're going to find this expression to be extremely handy a little bit later. 114 00:11:23,361 --> 00:11:27,575 Alright. Now, let's move on to some simple systems 115 00:11:27,575 --> 00:11:33,015 and we've seen this one before. The simple amplifier where G is the gain, 116 00:11:33,015 --> 00:11:38,216 of course. Now we had to use operational amplifiers, 117 00:11:38,216 --> 00:11:43,238 op amps, when we talk about analog signals that amplified. 118 00:11:43,238 --> 00:11:49,257 Well, now an amplifier is easy, which corresponds to a multiply. 119 00:11:50,733 --> 00:11:55,905 So, you just kind of do it. So, I've written this in kind of a 120 00:11:55,905 --> 00:12:01,630 computer like code thing, because that's exactly the way it works. 121 00:12:01,630 --> 00:12:05,868 Multiplies are very simple to do. So, are delays 122 00:12:05,868 --> 00:12:12,117 and time delay is simply delaying, of course, only by an integer because all 123 00:12:12,117 --> 00:12:18,730 discrete-time signals are defined only if the integer makes no sense to delay by f, 124 00:12:18,730 --> 00:12:25,079 for example, because must have an integer argument signals. 125 00:12:25,079 --> 00:12:29,708 So, and a delay is also easy to implement in a computer. 126 00:12:29,708 --> 00:12:37,040 no, no real dificulty thre. Also, the definition of linear system is 127 00:12:37,040 --> 00:12:41,909 the same basically as it was for analog systems. 128 00:12:41,909 --> 00:12:49,721 Notice the change in terminology here. We say shift-invariant because the delay 129 00:12:49,721 --> 00:12:56,004 can only be in integers. So, the word shift is supposed to mean 130 00:12:56,004 --> 00:13:03,133 only delaying by an integer, so it was just a slight terminology change. So, 131 00:13:03,133 --> 00:13:09,577 linear time invariant systems basically refers to an analog system and your 132 00:13:09,577 --> 00:13:14,506 shift-invariant system refers to a discrete-time system. 133 00:13:14,506 --> 00:13:20,620 So, the linear part of the definition is the same as it was for analog, 134 00:13:20,620 --> 00:13:27,601 superposition applies. So, whenever you express an input as a 135 00:13:27,601 --> 00:13:33,268 sum of simpler signals, the output is also, is equal to the super 136 00:13:33,268 --> 00:13:40,148 position of the outputs that you got when you put each analog. 137 00:13:40,148 --> 00:13:46,758 So, nothing changes at all. And shift-invariant is the same, is the 138 00:13:46,758 --> 00:13:53,218 same basic form as time invariant. If you delay the input by some amount, 139 00:13:53,218 --> 00:13:59,905 the output that you get is the original input to this, this, when the signal 140 00:13:59,905 --> 00:14:03,888 wasn't delayed. And then, you just delay that and that's 141 00:14:03,888 --> 00:14:07,638 what the output is. No matter what delay you pick, the system 142 00:14:07,638 --> 00:14:11,134 doesn't change with time. And all of the examples that we 143 00:14:11,134 --> 00:14:15,879 encountered for the linear and time invariance systems apply here, through 144 00:14:15,879 --> 00:14:20,545 this special case of discrete-time. All these examples follow through so 145 00:14:20,545 --> 00:14:25,951 there's really no difference here. So, let's summarize the basics that here, 146 00:14:25,951 --> 00:14:31,619 digital signals, discrete-time signals are functions of the integers that has a 147 00:14:31,619 --> 00:14:35,952 very important consequence. We're talking about the complex 148 00:14:35,952 --> 00:14:40,032 exponential, things that are functions of frequency. 149 00:14:40,032 --> 00:14:46,582 Frequency is dimensionless and is only defined uniquely over unit-length 150 00:14:46,582 --> 00:14:51,657 intervals. Usually it's going to be 0 to 1 or -1/2 151 00:14:51,657 --> 00:14:57,607 to 1/2 and it's the -1/2 to 1/2 is the one we're going to use a lot wehn we're 152 00:14:57,607 --> 00:15:01,432 doing theory. It's going to turn out that in a 153 00:15:01,432 --> 00:15:06,848 practical, if you do the calculation, the, it's convenient to take frequency 154 00:15:06,848 --> 00:15:10,820 going over zero to 1. I'll point this out when we get to it. 155 00:15:10,820 --> 00:15:15,781 The most intriguing thing and the simplest thing from your viewpoint, is 156 00:15:15,781 --> 00:15:20,461 that linear signal in systems theory is exactly the same as it is for analog 157 00:15:20,461 --> 00:15:23,130 signals. There is no difference, you don't have to 158 00:15:23,130 --> 00:15:26,191 learn anything new. So, we're on our way and now we're going 159 00:15:26,191 --> 00:15:30,442 to start talking about some more details, in particular, the frequency domain in 160 00:15:30,442 --> 00:15:31,164 discrete-time.