1 00:00:00,090 --> 00:00:02,490 The following content is provided under a Creative 2 00:00:02,490 --> 00:00:04,030 Commons license. 3 00:00:04,030 --> 00:00:06,330 Your support will help MIT OpenCourseWare 4 00:00:06,330 --> 00:00:10,720 continue to offer high-quality educational resources for free. 5 00:00:10,720 --> 00:00:13,320 To make a donation or view additional materials 6 00:00:13,320 --> 00:00:17,280 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,280 --> 00:00:18,450 at ocw.mit.edu. 8 00:00:25,404 --> 00:00:26,945 DENNIS FREEMAN: So hello and welcome. 9 00:00:30,520 --> 00:00:32,766 As I mentioned last time, we're essentially 10 00:00:32,766 --> 00:00:33,640 done with the course. 11 00:00:33,640 --> 00:00:36,370 We've done all the theoretical underpinnings. 12 00:00:36,370 --> 00:00:40,080 What remains is to talk about two important applications 13 00:00:40,080 --> 00:00:43,420 of Fourier, in fact some applications that 14 00:00:43,420 --> 00:00:47,620 are very difficult to do if we didn't have Fourier analysis 15 00:00:47,620 --> 00:00:49,920 and in fact quite simple to think about 16 00:00:49,920 --> 00:00:51,830 once we have Fourier analysis. 17 00:00:51,830 --> 00:00:53,934 So today I'm going to talk about sampling. 18 00:00:53,934 --> 00:00:56,350 We'll spend this lecture and the next lecture on sampling. 19 00:00:56,350 --> 00:01:01,060 And then the following two lectures will be on modulation 20 00:01:01,060 --> 00:01:02,300 and we're done. 21 00:01:02,300 --> 00:01:05,170 So we're almost done. 22 00:01:05,170 --> 00:01:08,030 So we've talk about sampling lots in the past. 23 00:01:08,030 --> 00:01:11,370 In fact, it was on the very first homework. 24 00:01:11,370 --> 00:01:13,470 That's in fact I think one of the strong points 25 00:01:13,470 --> 00:01:17,100 of this course is that we regard continuous time signals 26 00:01:17,100 --> 00:01:19,960 and discrete time signals on equal footing. 27 00:01:19,960 --> 00:01:23,100 And part of the goal is to be very comfortable to convert 28 00:01:23,100 --> 00:01:27,720 back and forth, because both representations are 29 00:01:27,720 --> 00:01:28,890 so important. 30 00:01:28,890 --> 00:01:32,604 We see CT coming up in fundamental ways, 31 00:01:32,604 --> 00:01:34,770 because a lot of the things that we're interested in 32 00:01:34,770 --> 00:01:38,160 are systems based on physics, and that's just the way it is. 33 00:01:38,160 --> 00:01:42,060 Physics works in continuous time by and large. 34 00:01:42,060 --> 00:01:43,950 However, because of digital electronics, 35 00:01:43,950 --> 00:01:47,130 we like to process things with digital electronics, 36 00:01:47,130 --> 00:01:49,650 because it's so inexpensive. 37 00:01:49,650 --> 00:01:52,290 So for that reason, we want to go back and forth. 38 00:01:52,290 --> 00:01:54,630 And what we'll see today is that when 39 00:01:54,630 --> 00:01:57,090 we think about system levels, when we think about 40 00:01:57,090 --> 00:02:00,000 signal level conversion, Fourier transform is the key. 41 00:02:00,000 --> 00:02:02,040 So keep in mind we've already thought 42 00:02:02,040 --> 00:02:07,430 about how you would convert a CT system into a DT 43 00:02:07,430 --> 00:02:08,340 representation. 44 00:02:08,340 --> 00:02:11,400 We did that back in about Homework 3 or so. 45 00:02:11,400 --> 00:02:13,830 So what's special today is thinking about-- 46 00:02:13,830 --> 00:02:15,450 rather than thinking about systems, 47 00:02:15,450 --> 00:02:17,040 thinking about signals. 48 00:02:17,040 --> 00:02:19,710 And as you can imagine, there's enormous reasons 49 00:02:19,710 --> 00:02:21,570 why you would want to think about signals 50 00:02:21,570 --> 00:02:23,670 from a digital point of view. 51 00:02:23,670 --> 00:02:26,610 Virtually all the things that you play with all the time 52 00:02:26,610 --> 00:02:27,930 are digital. 53 00:02:27,930 --> 00:02:30,780 So you think about audio signals, 54 00:02:30,780 --> 00:02:33,550 they're now stored digitally. 55 00:02:33,550 --> 00:02:36,340 Thing about pictures, digital. 56 00:02:36,340 --> 00:02:37,872 Video, digital. 57 00:02:37,872 --> 00:02:40,330 Everything on the web, because there's no other way the web 58 00:02:40,330 --> 00:02:42,250 can work. 59 00:02:42,250 --> 00:02:44,650 If it's on the web, it's digital. 60 00:02:44,650 --> 00:02:46,210 So there's just an enormous reason 61 00:02:46,210 --> 00:02:49,630 why we would like to understand how to take a continuous time 62 00:02:49,630 --> 00:02:53,370 signal and turn it into a discrete representation. 63 00:02:53,370 --> 00:02:54,940 This is just motivation. 64 00:02:54,940 --> 00:02:57,700 We tend to think about common signals 65 00:02:57,700 --> 00:02:59,620 that we deal with everyday as though they 66 00:02:59,620 --> 00:03:04,000 were in continuous time, continuous space, same thing. 67 00:03:04,000 --> 00:03:05,650 We think about things like pictures 68 00:03:05,650 --> 00:03:07,810 as though they were continuous. 69 00:03:07,810 --> 00:03:08,680 They aren't. 70 00:03:08,680 --> 00:03:10,930 Anybody who has a digital camera knows 71 00:03:10,930 --> 00:03:16,000 that if you zoom in enough, you see individual pixels. 72 00:03:16,000 --> 00:03:17,980 They are not continuous representations. 73 00:03:17,980 --> 00:03:20,090 They're discrete representations. 74 00:03:20,090 --> 00:03:25,610 Even some kinds of pictures that are ancient-- 75 00:03:25,610 --> 00:03:29,360 well, ancient by your standards at least. 76 00:03:29,360 --> 00:03:35,780 Even well-known kinds of pictures like newsprint, 77 00:03:35,780 --> 00:03:38,890 in an underlying sense, they are discrete representations. 78 00:03:38,890 --> 00:03:40,960 So what's showed here is a picture 79 00:03:40,960 --> 00:03:44,800 of a rose and a halftone image of the type 80 00:03:44,800 --> 00:03:47,410 that would be printed in a newspaper. 81 00:03:47,410 --> 00:03:51,760 And if you zoom in, you can see this-- 82 00:03:51,760 --> 00:03:53,650 so if you zoom into this square so you 83 00:03:53,650 --> 00:03:58,840 can see this better, this, which is not really continuous, 84 00:03:58,840 --> 00:04:01,540 I'm showing it on a digital projector, 85 00:04:01,540 --> 00:04:03,700 it's actually got pixels too. 86 00:04:03,700 --> 00:04:05,890 But the pixels are small enough for the time being 87 00:04:05,890 --> 00:04:07,220 I'm going to ignore that. 88 00:04:07,220 --> 00:04:10,655 So consider this continuous even though it isn't. 89 00:04:10,655 --> 00:04:13,030 And you can see the discrete nature of this one much more 90 00:04:13,030 --> 00:04:13,530 clearly. 91 00:04:13,530 --> 00:04:17,190 In fact, the halftone pictures that you 92 00:04:17,190 --> 00:04:23,160 see in a newspaper are not only discrete in space, 93 00:04:23,160 --> 00:04:24,750 but they're discrete in amplitude, 94 00:04:24,750 --> 00:04:26,970 because they're printed with ink. 95 00:04:26,970 --> 00:04:32,850 Ink comes in two flavors, ink or no ink. 96 00:04:32,850 --> 00:04:36,090 So they are a binary representation in intensity 97 00:04:36,090 --> 00:04:37,060 as well. 98 00:04:37,060 --> 00:04:39,910 And we'll talk about that a little bit more the next time. 99 00:04:39,910 --> 00:04:42,180 So in order to have a complete digital representation, 100 00:04:42,180 --> 00:04:46,220 you need to think about not only sampling in the time or here 101 00:04:46,220 --> 00:04:49,290 the space dimension, but also sampling 102 00:04:49,290 --> 00:04:54,480 in the voltage or the amplitude dimension. 103 00:04:54,480 --> 00:04:57,540 Even the highest resolution picture you have ever seen 104 00:04:57,540 --> 00:04:58,990 is digital. 105 00:04:58,990 --> 00:05:01,560 So this refers to the completely ancient technology of 106 00:05:01,560 --> 00:05:03,640 how do you make a digital print? 107 00:05:03,640 --> 00:05:06,270 So a very high-quality picture is 108 00:05:06,270 --> 00:05:11,910 made from an emulsion of some sort of a chemical, originally 109 00:05:11,910 --> 00:05:13,680 silver bromide. 110 00:05:13,680 --> 00:05:15,930 The idea was that you had very small crystals 111 00:05:15,930 --> 00:05:19,440 of silver bromide that could be reduced by a photon 112 00:05:19,440 --> 00:05:22,680 to turn them into silver metal. 113 00:05:22,680 --> 00:05:25,710 And the idea was that exposure to light 114 00:05:25,710 --> 00:05:28,770 would therefore convert silver bromide to silver. 115 00:05:28,770 --> 00:05:32,670 And then developing meant washing away the silver bromide 116 00:05:32,670 --> 00:05:35,400 salt that remained that was not converted, 117 00:05:35,400 --> 00:05:37,350 leaving behind the silver that had. 118 00:05:37,350 --> 00:05:39,570 And that was the basis for the chemical reaction 119 00:05:39,570 --> 00:05:41,400 that gave rise to pictures. 120 00:05:41,400 --> 00:05:44,700 The point being that even there, these crystals 121 00:05:44,700 --> 00:05:47,670 are on the order of a micron in size, 122 00:05:47,670 --> 00:05:50,680 and they're either on or off. 123 00:05:50,680 --> 00:05:54,010 So even there it was a sampled version. 124 00:05:54,010 --> 00:05:59,430 And if it weren't enough, everything you've ever seen 125 00:05:59,430 --> 00:06:03,510 is sampled, because that's the way your eye works. 126 00:06:03,510 --> 00:06:06,270 Your eye has individual cells that either respond to light 127 00:06:06,270 --> 00:06:08,070 or don't. 128 00:06:08,070 --> 00:06:11,940 There's about 100 million rods, about 6 million cones. 129 00:06:11,940 --> 00:06:16,510 So every image you have ever seen is sampled. 130 00:06:19,240 --> 00:06:22,520 So one question is-- 131 00:06:22,520 --> 00:06:25,470 and it's such a good sampling that you don't even notice. 132 00:06:25,470 --> 00:06:28,610 But maybe that's because you're, well, unaware, to be polite. 133 00:06:33,060 --> 00:06:38,420 So think about, how well sampled is it? 134 00:06:38,420 --> 00:06:42,680 So I know that this picture is sampled, because I can come up 135 00:06:42,680 --> 00:06:44,690 and I can see the individual pixels. 136 00:06:44,690 --> 00:06:47,150 I can see a little grid of pixels. 137 00:06:47,150 --> 00:06:52,630 There's 1,024 by 768. 138 00:06:52,630 --> 00:06:55,720 I want you to think about how well your eye is sampling that 139 00:06:55,720 --> 00:06:58,810 by thinking about whether or not you should 140 00:06:58,810 --> 00:07:03,070 be able to see the pixels from where 141 00:07:03,070 --> 00:07:09,350 you're sitting based on the sampling that's in your retina. 142 00:07:09,350 --> 00:07:14,060 So look at your neighbor, say hi. 143 00:07:14,060 --> 00:07:17,840 Figure out whether you have enough rods and cones to see 144 00:07:17,840 --> 00:07:19,580 individual pixels or not. 145 00:08:55,280 --> 00:08:55,780 OK. 146 00:08:55,780 --> 00:08:59,050 Does anybody-- so who can tell me a way to think about this? 147 00:08:59,050 --> 00:09:00,520 Or who can tell me the answer? 148 00:09:00,520 --> 00:09:03,430 Do you have enough rods and cones to sample the pixels 149 00:09:03,430 --> 00:09:04,030 on the screen? 150 00:09:04,030 --> 00:09:04,770 Yes? 151 00:09:04,770 --> 00:09:05,339 AUDIENCE: No. 152 00:09:05,339 --> 00:09:06,130 DENNIS FREEMAN: No. 153 00:09:06,130 --> 00:09:07,276 AUDIENCE: I can't see them. 154 00:09:07,276 --> 00:09:08,900 DENNIS FREEMAN: You can't-- you cannot. 155 00:09:08,900 --> 00:09:09,580 AUDIENCE: I don't see the pixels. 156 00:09:09,580 --> 00:09:09,880 DENNIS FREEMAN: OK. 157 00:09:09,880 --> 00:09:11,860 Well, that could be because you don't 158 00:09:11,860 --> 00:09:13,496 have enough rods and cones. 159 00:09:13,496 --> 00:09:15,440 [LAUGHTER] 160 00:09:16,412 --> 00:09:18,160 AUDIENCE: I have slight astigmatism. 161 00:09:18,160 --> 00:09:18,951 DENNIS FREEMAN: Ah. 162 00:09:18,951 --> 00:09:19,520 Astigmatism. 163 00:09:19,520 --> 00:09:21,157 Is that a rod and cone problem? 164 00:09:21,157 --> 00:09:22,490 AUDIENCE: That's a lens problem. 165 00:09:22,490 --> 00:09:23,510 DENNIS FREEMAN: That's a lens problem. 166 00:09:23,510 --> 00:09:26,470 So maybe you have enough rods and cones and not enough lens. 167 00:09:28,785 --> 00:09:31,410 There's actually another reason you might not be able to do it, 168 00:09:31,410 --> 00:09:34,540 besides rods, cones, and lenses. 169 00:09:34,540 --> 00:09:35,520 AUDIENCE: Your brain. 170 00:09:35,520 --> 00:09:36,530 DENNIS FREEMAN: Brain. 171 00:09:36,530 --> 00:09:37,710 There's even another one. 172 00:09:37,710 --> 00:09:38,210 OK. 173 00:09:38,210 --> 00:09:39,800 We're up to-- there's another reason why 174 00:09:39,800 --> 00:09:41,130 you might not be able to do it. 175 00:09:43,840 --> 00:09:47,308 Rods, cones, lenses, brains. 176 00:09:47,308 --> 00:09:49,688 AUDIENCE: Photons. 177 00:09:49,688 --> 00:09:51,720 AUDIENCE: Photons? 178 00:09:51,720 --> 00:09:52,720 DENNIS FREEMAN: Photons. 179 00:09:52,720 --> 00:09:53,740 That's an interesting thought. 180 00:09:53,740 --> 00:09:55,870 I think you could probably pull that off, yeah. 181 00:09:55,870 --> 00:09:59,390 The number of photons-- if the lighting were low enough-- 182 00:09:59,390 --> 00:10:01,550 your eyes are very sensitive. 183 00:10:01,550 --> 00:10:04,970 You can see-- you can see-- 184 00:10:04,970 --> 00:10:09,360 you can report a difference with one photon, one. 185 00:10:09,360 --> 00:10:10,730 It's pretty little. 186 00:10:10,730 --> 00:10:13,110 It's kind of the limit, ? right? 187 00:10:13,110 --> 00:10:14,372 Yeah? 188 00:10:14,372 --> 00:10:16,830 AUDIENCE: It's so far away that I can't see the pixels. 189 00:10:16,830 --> 00:10:19,454 DENNIS FREEMAN: It's so far away that you can't see the pixels. 190 00:10:19,454 --> 00:10:20,290 But why? 191 00:10:20,290 --> 00:10:22,562 Is it because you don't have enough rods and cones, 192 00:10:22,562 --> 00:10:24,020 because your lenses are screwed up? 193 00:10:24,020 --> 00:10:25,484 AUDIENCE: [INAUDIBLE]. 194 00:10:29,795 --> 00:10:32,170 DENNIS FREEMAN: So you might be using your rods and cones 195 00:10:32,170 --> 00:10:33,770 for different things. 196 00:10:33,770 --> 00:10:37,390 Your cones are focused in an area called the fovea, right? 197 00:10:37,390 --> 00:10:40,120 So one way you could improve that would be to look at it. 198 00:10:44,590 --> 00:10:48,140 Can somebody think of something besides rods, cones, lenses, 199 00:10:48,140 --> 00:10:50,610 and brains? 200 00:10:50,610 --> 00:10:52,740 Can somebody think of convolution lecture 201 00:10:52,740 --> 00:10:58,750 with some sort of application that we did in convolution? 202 00:10:58,750 --> 00:10:59,500 No, of course not. 203 00:10:59,500 --> 00:11:03,050 That was more than 10 lectures ago. 204 00:11:03,050 --> 00:11:08,430 In convolution, we looked at the Hubble Space Telescope 205 00:11:08,430 --> 00:11:09,720 and we looked at a microscope. 206 00:11:09,720 --> 00:11:11,478 Yes? 207 00:11:11,478 --> 00:11:14,710 AUDIENCE: There's going to be tons of particles in the air, 208 00:11:14,710 --> 00:11:15,210 so-- 209 00:11:15,210 --> 00:11:16,751 DENNIS FREEMAN: Particles in the air. 210 00:11:16,751 --> 00:11:18,960 That was something that happened in Hubble. 211 00:11:18,960 --> 00:11:22,680 So smoke-filled rooms, that's bad. 212 00:11:22,680 --> 00:11:25,110 From the Hubble experiment, from the Hubble lecture 213 00:11:25,110 --> 00:11:27,360 we talked about how there was a point spread function 214 00:11:27,360 --> 00:11:30,680 associated with diffraction. 215 00:11:30,680 --> 00:11:32,630 And there's also a diffraction limit because 216 00:11:32,630 --> 00:11:33,713 of the size of your pupil. 217 00:11:35,980 --> 00:11:39,250 Because you're looking through a narrow aperture, 218 00:11:39,250 --> 00:11:41,269 that limits the resolution as well. 219 00:11:41,269 --> 00:11:43,060 But let's get back to this, rods and cones. 220 00:11:43,060 --> 00:11:44,351 You have enough rods and cones. 221 00:11:44,351 --> 00:11:47,110 How you do that? 222 00:11:47,110 --> 00:11:50,761 How do you think about whether you have enough rods and cones? 223 00:11:50,761 --> 00:11:51,260 OK. 224 00:11:51,260 --> 00:11:54,020 Step 1, look at the previous slide. 225 00:11:54,020 --> 00:11:56,436 What was the important thing on the previous slide? 226 00:11:56,436 --> 00:11:58,210 AUDIENCE: [INAUDIBLE]? 227 00:11:58,210 --> 00:12:01,319 DENNIS FREEMAN: Three microns per rod and cone, right? 228 00:12:01,319 --> 00:12:03,360 So rods and cones are separated by three microns. 229 00:12:03,360 --> 00:12:06,720 So what do I do with that? 230 00:12:06,720 --> 00:12:09,430 How do I compare rods and cones three microns to this? 231 00:12:12,750 --> 00:12:14,520 Anybody remember anything about optics? 232 00:12:17,420 --> 00:12:20,059 So I have this big lens, right? 233 00:12:20,059 --> 00:12:21,850 And we have the eye on one side and we have 234 00:12:21,850 --> 00:12:23,620 the object on the other side. 235 00:12:23,620 --> 00:12:28,330 And we need to map some retina over here 236 00:12:28,330 --> 00:12:31,395 to some screen over here. 237 00:12:31,395 --> 00:12:33,520 What's important to do-- what's the important thing 238 00:12:33,520 --> 00:12:34,228 to do in the map? 239 00:12:38,271 --> 00:12:39,982 Oh, come on. 240 00:12:39,982 --> 00:12:41,690 Do you all remember going to high school? 241 00:12:44,540 --> 00:12:45,290 No. 242 00:12:45,290 --> 00:12:46,580 OK. 243 00:12:46,580 --> 00:12:50,607 So if you have a lens, rays go straight through a lens 244 00:12:50,607 --> 00:12:51,690 without being bent, right? 245 00:12:51,690 --> 00:12:53,270 That's one of the rules for lenses. 246 00:12:53,270 --> 00:12:56,325 So that is enough information actually to tell us the map. 247 00:12:56,325 --> 00:12:58,450 The map through a lens is so as to preserve angles. 248 00:13:01,610 --> 00:13:05,050 So if we figure out how closely spaced 249 00:13:05,050 --> 00:13:07,450 are the rods and cones on this side, 250 00:13:07,450 --> 00:13:10,997 that'll give me some angle that I can resolve. 251 00:13:10,997 --> 00:13:12,580 And the question is whether that angle 252 00:13:12,580 --> 00:13:14,350 is bigger or smaller than the angle that's 253 00:13:14,350 --> 00:13:15,680 required to resolve the pixels. 254 00:13:19,690 --> 00:13:22,450 So the angle-- so if we make a small angle approximation, 255 00:13:22,450 --> 00:13:25,600 say that theta is on the order of sine theta, 256 00:13:25,600 --> 00:13:31,360 then the spacing between these is like three micrometers. 257 00:13:31,360 --> 00:13:34,660 The distance between the lens in your eye and the retina 258 00:13:34,660 --> 00:13:37,690 is on the order of, say, three centimeters, something 259 00:13:37,690 --> 00:13:39,570 like that. 260 00:13:39,570 --> 00:13:43,280 So that's the angle at your eye. 261 00:13:43,280 --> 00:13:45,190 And the question is, how does that compare 262 00:13:45,190 --> 00:13:46,855 to the angle at the screen? 263 00:13:50,490 --> 00:13:55,360 And so the screen, this is like three meters. 264 00:13:57,900 --> 00:14:02,650 But the pixels, there's 1,024 pixels in that range. 265 00:14:02,650 --> 00:14:09,430 And this distance is like 10 meters, something like that. 266 00:14:09,430 --> 00:14:11,620 So the question is whether or not 267 00:14:11,620 --> 00:14:13,930 the angle subtended by the pixels 268 00:14:13,930 --> 00:14:16,630 is bigger or smaller than the angle subtended 269 00:14:16,630 --> 00:14:20,260 by the rods and cones, right? 270 00:14:20,260 --> 00:14:21,710 That's the issue. 271 00:14:21,710 --> 00:14:24,850 And so if you work that out, the angle 272 00:14:24,850 --> 00:14:26,890 between the rods and cones is on the order of 10 273 00:14:26,890 --> 00:14:29,270 to the minus 4 radian. 274 00:14:29,270 --> 00:14:31,990 And the angle between pixels is on the order 275 00:14:31,990 --> 00:14:34,700 of three times that. 276 00:14:34,700 --> 00:14:36,340 So a couple of interesting things. 277 00:14:36,340 --> 00:14:44,710 You have enough rods and cones to see it, but only barely, 278 00:14:44,710 --> 00:14:47,200 by a factor of three, roughly. 279 00:14:47,200 --> 00:14:48,640 I'm not worrying about the fovea. 280 00:14:48,640 --> 00:14:49,690 The fovea has more. 281 00:14:52,147 --> 00:14:53,730 So this is just a crude approximation. 282 00:14:53,730 --> 00:14:57,720 I'm not worried about your eyeglasses. 283 00:14:57,720 --> 00:15:01,080 But crudely speaking, you have enough rods and cones 284 00:15:01,080 --> 00:15:03,930 to resolve the pixels and another factor of three or so, 285 00:15:03,930 --> 00:15:07,050 which means, for example, that making a projector with three 286 00:15:07,050 --> 00:15:11,450 by three times more pixels makes sense. 287 00:15:11,450 --> 00:15:15,270 And making one that's got 100 times 100 times more pixels 288 00:15:15,270 --> 00:15:15,770 doesn't. 289 00:15:18,035 --> 00:15:19,410 And that's the kind of thing we'd 290 00:15:19,410 --> 00:15:20,910 like to work out when we're thinking 291 00:15:20,910 --> 00:15:25,170 about discrete representations for signals. 292 00:15:25,170 --> 00:15:28,050 How many samples do you need? 293 00:15:28,050 --> 00:15:28,920 OK. 294 00:15:28,920 --> 00:15:30,750 So what we'd like to do today is figure out 295 00:15:30,750 --> 00:15:34,230 how sampling affects the information that's 296 00:15:34,230 --> 00:15:36,650 contained in a signal. 297 00:15:36,650 --> 00:15:39,330 We'd like to sample a signal-- 298 00:15:39,330 --> 00:15:41,240 so think about the blue signal here 299 00:15:41,240 --> 00:15:42,680 and think about the red samples. 300 00:15:42,680 --> 00:15:45,020 We'd like to sample a signal in a way 301 00:15:45,020 --> 00:15:47,480 that we preserve all of the information about that signal. 302 00:15:50,640 --> 00:15:53,160 And as you can see from the example that I picked, 303 00:15:53,160 --> 00:15:56,780 it's not at all clear that you can do that. 304 00:15:56,780 --> 00:15:58,960 In fact, if you look at the bottom picture, 305 00:15:58,960 --> 00:16:03,550 I have coerced two signals to follow on the same samples. 306 00:16:03,550 --> 00:16:08,110 So the green signal is the cos 7 pi n over 3 307 00:16:08,110 --> 00:16:11,710 and the red signal is the cos pi n over 3. 308 00:16:11,710 --> 00:16:16,070 And they all go through the same blue samples. 309 00:16:16,070 --> 00:16:19,600 The same blue samples is shared by both of those signals. 310 00:16:19,600 --> 00:16:26,940 So it's patently obvious that I cannot uniquely reconstruct 311 00:16:26,940 --> 00:16:28,220 a signal from the samples. 312 00:16:28,220 --> 00:16:31,660 That's absolutely clear. 313 00:16:31,660 --> 00:16:36,700 It's also clear by just thinking about the basic mathematics 314 00:16:36,700 --> 00:16:37,970 of signals. 315 00:16:37,970 --> 00:16:42,190 A CT signal could move up and down arbitrarily 316 00:16:42,190 --> 00:16:45,550 between two samples. 317 00:16:45,550 --> 00:16:47,290 How could you possibly learn information 318 00:16:47,290 --> 00:16:49,810 about what happened between the samples 319 00:16:49,810 --> 00:16:52,670 by looking just at the samples? 320 00:16:52,670 --> 00:16:54,170 So it's not at all clear that you're 321 00:16:54,170 --> 00:16:56,520 going to be able to do this. 322 00:16:56,520 --> 00:16:59,100 So let's take the opposite tact, which is to say, 323 00:16:59,100 --> 00:17:01,190 let's assume I only have the samples. 324 00:17:01,190 --> 00:17:03,890 What can I tell you about what the signal might have been? 325 00:17:03,890 --> 00:17:09,099 What's the relationship between the samples and the signal? 326 00:17:09,099 --> 00:17:10,480 And the way to think about that-- 327 00:17:10,480 --> 00:17:12,849 one way is to think about something that we will 328 00:17:12,849 --> 00:17:15,339 call impulse reconstruction. 329 00:17:15,339 --> 00:17:18,099 If I only had the samples, what could I 330 00:17:18,099 --> 00:17:22,660 do to reproduce a CT signal? 331 00:17:22,660 --> 00:17:25,839 The simplest thing I might conceive of doing 332 00:17:25,839 --> 00:17:32,680 is replace every sample with some non-zero component 333 00:17:32,680 --> 00:17:35,900 of the CT representation. 334 00:17:35,900 --> 00:17:39,790 So I only have samples up here at nT, 335 00:17:39,790 --> 00:17:43,890 so generate a new CT signal that contains 336 00:17:43,890 --> 00:17:48,640 the information in the samples, that is to say x of n, 337 00:17:48,640 --> 00:17:51,370 which means I only have an integer 338 00:17:51,370 --> 00:17:59,370 number of non-zero elements in the CT representation. 339 00:17:59,370 --> 00:18:03,020 So in order to make that signal have a non-zero integral, 340 00:18:03,020 --> 00:18:05,570 the things I represent each sample with better 341 00:18:05,570 --> 00:18:08,780 be an impulse, otherwise I would have 342 00:18:08,780 --> 00:18:13,664 finitely many non-zero points in a finite time interval, 343 00:18:13,664 --> 00:18:15,080 and the integral over the interval 344 00:18:15,080 --> 00:18:17,150 would be 0 always, right? 345 00:18:17,150 --> 00:18:18,687 So I have to use impulses. 346 00:18:18,687 --> 00:18:20,270 So the simplest thing I could do would 347 00:18:20,270 --> 00:18:22,130 be to take every one of these samples 348 00:18:22,130 --> 00:18:26,780 and replace it by an impulse located at the right time, 349 00:18:26,780 --> 00:18:31,790 so put the n-th one at time t equals n cap T, 350 00:18:31,790 --> 00:18:34,190 put it where the sample came from, 351 00:18:34,190 --> 00:18:36,650 and scale the weight to be in proportion 352 00:18:36,650 --> 00:18:39,170 to the amplitude of x of n. 353 00:18:39,170 --> 00:18:41,420 That's kind of the simplest thing I could possibly do. 354 00:18:41,420 --> 00:18:43,250 That's called impulse reconstruction. 355 00:18:43,250 --> 00:18:45,110 And then lets ask the question, how 356 00:18:45,110 --> 00:18:52,520 does the x that I started with relate to this xP, this impulse 357 00:18:52,520 --> 00:18:55,352 reconstruction thing that I just made? 358 00:18:55,352 --> 00:18:57,560 And as you might imagine from the theory of lectures, 359 00:18:57,560 --> 00:19:00,860 that relationship is going to be simple, right? 360 00:19:00,860 --> 00:19:04,440 So think about, what am I doing? 361 00:19:04,440 --> 00:19:07,235 I'm trying to think about I started with x of n-- 362 00:19:07,235 --> 00:19:10,400 I started with x of T, sorry. 363 00:19:10,400 --> 00:19:14,570 I turned that into samples. 364 00:19:14,570 --> 00:19:17,750 I turned that into xP of t. 365 00:19:17,750 --> 00:19:20,600 And now I'm trying to compare those two signals. 366 00:19:20,600 --> 00:19:22,440 That's the game plan. 367 00:19:22,440 --> 00:19:26,990 So think about x of P from the previous slide. 368 00:19:26,990 --> 00:19:30,020 It's weighted impulses shifted in time 369 00:19:30,020 --> 00:19:31,100 to the appropriate place. 370 00:19:33,840 --> 00:19:40,770 This x of n was derived by uniform sampling of x of t, 371 00:19:40,770 --> 00:19:41,970 so x of n was x of nT. 372 00:19:45,830 --> 00:19:50,750 And since this impulse is 0 everywhere except where 373 00:19:50,750 --> 00:19:54,970 the argument is 0, it doesn't matter 374 00:19:54,970 --> 00:19:59,490 whether I call this thing nT or T, same thing, 375 00:19:59,490 --> 00:20:05,100 because the impulse only looks at t equals nT. 376 00:20:05,100 --> 00:20:08,220 So whether I call it nT or t is irrelevant. 377 00:20:08,220 --> 00:20:12,210 If I call it t, then this part has no n in it 378 00:20:12,210 --> 00:20:15,390 and I can factor it outside and I just get an impulse train. 379 00:20:15,390 --> 00:20:21,440 And not too surprisingly, xP is just the product-- 380 00:20:21,440 --> 00:20:27,290 this signal is just this signal multiplied by an impulse train. 381 00:20:32,180 --> 00:20:37,460 So if I derive xP by multiplying by an impulse train, 382 00:20:37,460 --> 00:20:39,220 your knee-jerk reaction is to say-- 383 00:20:42,090 --> 00:20:43,380 multiply by an impulse train? 384 00:20:48,310 --> 00:20:50,060 AUDIENCE: Sounds like a Fourier transform. 385 00:20:50,060 --> 00:20:52,670 DENNIS FREEMAN: Sounds like a Fourier transform somewhere. 386 00:20:52,670 --> 00:20:54,770 If I multiply in time by an impulse train, 387 00:20:54,770 --> 00:20:59,250 what do I do in Fourier transform land? 388 00:20:59,250 --> 00:21:01,490 Convolve, right? 389 00:21:01,490 --> 00:21:04,650 Multiply in time, convolve in frequency. 390 00:21:04,650 --> 00:21:07,370 So if this was my original x, this thing, 391 00:21:07,370 --> 00:21:11,860 if this is the transform of that thing, 392 00:21:11,860 --> 00:21:15,120 and if this is the transform of my impulse train-- 393 00:21:15,120 --> 00:21:17,580 transform of an impulse train in time 394 00:21:17,580 --> 00:21:20,820 is an impulse train in frequency. 395 00:21:20,820 --> 00:21:25,140 The impulses in frequency are separated by omega 396 00:21:25,140 --> 00:21:27,810 s equal to 2 pi over t. 397 00:21:27,810 --> 00:21:31,890 And the amplitude is equal to omega s, 2 pi over t. 398 00:21:31,890 --> 00:21:34,800 So there's space and have an amplitude, both the spacing 399 00:21:34,800 --> 00:21:38,430 and the amplitude are 2 pi over t, right? 400 00:21:38,430 --> 00:21:43,131 And if I'm multiplying in time x times P, 401 00:21:43,131 --> 00:21:45,270 I convolve in frequency. 402 00:21:45,270 --> 00:21:48,780 So this is my answer. 403 00:21:48,780 --> 00:21:52,590 What's the relationship between x and xP? 404 00:21:52,590 --> 00:21:55,710 It's multiplied in time by an impulse train, 405 00:21:55,710 --> 00:22:00,660 or it's convolved in frequency with an impulse train. 406 00:22:00,660 --> 00:22:04,020 So the answer how does xP relate to x, 407 00:22:04,020 --> 00:22:08,730 it looks very similar for some frequencies. 408 00:22:08,730 --> 00:22:10,410 But there's a lot more frequencies. 409 00:22:13,260 --> 00:22:14,090 Not too surprising. 410 00:22:14,090 --> 00:22:15,180 I multiply by impulses. 411 00:22:15,180 --> 00:22:18,990 Impulses have all frequencies, right? 412 00:22:18,990 --> 00:22:23,040 So what I've done when I've sampled it, 413 00:22:23,040 --> 00:22:26,100 if I think about the sampled signal being represented 414 00:22:26,100 --> 00:22:30,960 in CT as the multiplication by an infinite impulse train, 415 00:22:30,960 --> 00:22:36,180 I've introduced new frequency components 416 00:22:36,180 --> 00:22:37,800 to the Fourier representation. 417 00:22:37,800 --> 00:22:39,450 That's the main message. 418 00:22:39,450 --> 00:22:42,600 This slide is today's lecture. 419 00:22:42,600 --> 00:22:46,530 The way we can think about sampling in time 420 00:22:46,530 --> 00:22:48,881 is as convolution in frequency. 421 00:22:51,650 --> 00:22:53,300 OK. 422 00:22:53,300 --> 00:22:55,326 So let's think about that a little more. 423 00:22:55,326 --> 00:22:57,200 What I just talked about was the relationship 424 00:22:57,200 --> 00:23:00,451 between the Fourier transforms of x and xP. 425 00:23:03,680 --> 00:23:05,510 But the goal is to think about the samples. 426 00:23:05,510 --> 00:23:09,320 So what's the relationship between the DT, the Discrete 427 00:23:09,320 --> 00:23:14,780 Time Fourier transform of the sampled signal, 428 00:23:14,780 --> 00:23:18,560 and the continuous time Fourier transform of this impulse 429 00:23:18,560 --> 00:23:19,550 reconstruction? 430 00:23:22,650 --> 00:23:24,810 So I've already for you-- 431 00:23:24,810 --> 00:23:26,670 I've compared the frequency-- 432 00:23:26,670 --> 00:23:29,220 the Fourier representations of these two. 433 00:23:29,220 --> 00:23:32,220 As an exercise, you compare the frequency representations 434 00:23:32,220 --> 00:23:33,270 of those two. 435 00:23:33,270 --> 00:23:35,640 And figure out if any of these are the right way 436 00:23:35,640 --> 00:23:37,479 to look at it. 437 00:23:37,479 --> 00:23:38,520 So look at your neighbor. 438 00:25:15,370 --> 00:25:17,500 So which one best describes the relationship 439 00:25:17,500 --> 00:25:19,240 between those Fourier representations? 440 00:25:19,240 --> 00:25:21,490 Number 1, 2, 3, or none of the above? 441 00:25:27,881 --> 00:25:28,380 OK. 442 00:25:28,380 --> 00:25:30,690 So 100%, I think. 443 00:25:30,690 --> 00:25:36,960 So easier question, is x of e to the j omega-- 444 00:25:39,470 --> 00:25:46,430 x of e to the j omega, so this one, x of e to the j omega, 445 00:25:46,430 --> 00:25:51,840 is that a periodic or aperiodic function of omega? 446 00:25:51,840 --> 00:25:53,289 AUDIENCE: Periodic. 447 00:25:53,289 --> 00:25:54,330 DENNIS FREEMAN: Periodic. 448 00:25:54,330 --> 00:25:55,079 What's the period? 449 00:25:59,679 --> 00:26:01,470 What's the period of x of e to the j omega? 450 00:26:06,020 --> 00:26:09,698 What's the period of e to the j omega? 451 00:26:09,698 --> 00:26:11,189 AUDIENCE: [INAUDIBLE]. 452 00:26:14,670 --> 00:26:17,280 DENNIS FREEMAN: So I'm hearing about the three not quite 453 00:26:17,280 --> 00:26:19,230 correct answers. 454 00:26:19,230 --> 00:26:21,750 They all kind of have the right stuff in them. 455 00:26:21,750 --> 00:26:24,000 What's the period of e to the j omega? 456 00:26:26,794 --> 00:26:27,960 What's the period of cosine? 457 00:26:33,195 --> 00:26:35,482 What's the period of cosine? 458 00:26:35,482 --> 00:26:36,265 AUDIENCE: 2 pi. 459 00:26:36,265 --> 00:26:37,140 DENNIS FREEMAN: 2 pi. 460 00:26:37,140 --> 00:26:39,431 Thank you. 461 00:26:39,431 --> 00:26:39,930 OK. 462 00:26:39,930 --> 00:26:42,870 So this one's periodic in 2 pi, so x of e to the j omega 463 00:26:42,870 --> 00:26:45,630 is periodic in 2 pi because e to the j omega 464 00:26:45,630 --> 00:26:47,250 is periodic in 2 pi, right? 465 00:26:47,250 --> 00:26:51,180 How about xP of j omega? 466 00:26:51,180 --> 00:26:53,340 Is that periodic or aperiodic? 467 00:26:57,330 --> 00:26:59,690 xP of j omega. 468 00:26:59,690 --> 00:27:03,890 xP is the signal that I got when I multiplied in the time domain 469 00:27:03,890 --> 00:27:06,430 x of t times p of t, p of t being an impulse train. 470 00:27:06,430 --> 00:27:09,470 Take an impulse train times the time domain signal, 471 00:27:09,470 --> 00:27:10,780 and that's how I got xP. 472 00:27:10,780 --> 00:27:14,240 And then xP is the transform of that. 473 00:27:14,240 --> 00:27:19,549 Is the transform of xP periodic or aperiodic? 474 00:27:19,549 --> 00:27:20,340 AUDIENCE: Periodic. 475 00:27:20,340 --> 00:27:21,381 DENNIS FREEMAN: Periodic. 476 00:27:21,381 --> 00:27:23,764 What's a period of xP? 477 00:27:23,764 --> 00:27:25,612 AUDIENCE: 2 pi over T. 478 00:27:25,612 --> 00:27:28,070 DENNIS FREEMAN: 2 pi over T precisely. 479 00:27:28,070 --> 00:27:32,470 So this one is periodic in omega. 480 00:27:32,470 --> 00:27:41,090 2 pi-- I shouldn't write it that way, 481 00:27:41,090 --> 00:27:45,850 I should say that the period is 2 pi. 482 00:27:45,850 --> 00:27:53,190 And here, the period of omega is 2 pi over T. 483 00:27:53,190 --> 00:27:55,620 So what's the relationship between omega and omega? 484 00:27:58,570 --> 00:28:01,180 In order to make a function-- 485 00:28:01,180 --> 00:28:04,070 in order to make a function that is similar, 486 00:28:04,070 --> 00:28:11,120 we're going to have to have omega is omega over T. 487 00:28:11,120 --> 00:28:12,016 OK? 488 00:28:12,016 --> 00:28:14,140 We're going to have to convert the units of capital 489 00:28:14,140 --> 00:28:17,930 omega, which are radians, into the units of little omega, 490 00:28:17,930 --> 00:28:21,620 which is radians per second. 491 00:28:21,620 --> 00:28:25,067 So we need a time in the bottom. 492 00:28:25,067 --> 00:28:27,400 And if you want to be a little bit more formal about it, 493 00:28:27,400 --> 00:28:29,620 you can just write out the definitions. 494 00:28:29,620 --> 00:28:30,760 I did this last time. 495 00:28:30,760 --> 00:28:33,490 This was from two lectures ago. 496 00:28:33,490 --> 00:28:35,989 So here's the definition of the discrete time 497 00:28:35,989 --> 00:28:37,030 Fourier transform, right? 498 00:28:37,030 --> 00:28:38,530 You take the samples and weight them 499 00:28:38,530 --> 00:28:41,650 by e to the minus j omega n. 500 00:28:41,650 --> 00:28:44,710 Here's the definition of the CT Fourier transform, 501 00:28:44,710 --> 00:28:50,340 where I've substituted xP of t is this thing. 502 00:28:50,340 --> 00:28:56,770 It's a string of impulses, each weighted by x of n. 503 00:28:56,770 --> 00:28:59,694 And then I interchanged the integral and the summation. 504 00:28:59,694 --> 00:29:02,110 And I don't worry about whether it's going to work or not. 505 00:29:02,110 --> 00:29:04,443 You have to take a following course, Course 18, in order 506 00:29:04,443 --> 00:29:07,390 to figure out whether that makes sense or not, but it does. 507 00:29:07,390 --> 00:29:12,830 So I interchange the order and then the end part factors out 508 00:29:12,830 --> 00:29:18,010 and this just sifts out the value of omega-- 509 00:29:18,010 --> 00:29:20,410 the value of t and nT. 510 00:29:20,410 --> 00:29:22,600 So I replace then this t with nT. 511 00:29:22,600 --> 00:29:24,220 The integral goes away. 512 00:29:24,220 --> 00:29:27,280 And I end up with something that looks almost exactly like that, 513 00:29:27,280 --> 00:29:29,230 except that capital omega has turned 514 00:29:29,230 --> 00:29:33,930 into a little omega times T. 515 00:29:33,930 --> 00:29:36,390 So the discrete time Fourier transform 516 00:29:36,390 --> 00:29:41,350 is just a scaled in frequency version 517 00:29:41,350 --> 00:29:45,570 of this impulse-sampled original signal. 518 00:29:48,430 --> 00:29:51,586 So the impulse reconstruction is related to the Fourier-- 519 00:29:51,586 --> 00:29:53,710 the Fourier transform of the impulse reconstruction 520 00:29:53,710 --> 00:29:57,930 is related to the Fourier transform in samples 521 00:29:57,930 --> 00:29:59,650 by scaling frequencies that way. 522 00:30:03,680 --> 00:30:06,800 So those representations have the same information 523 00:30:06,800 --> 00:30:11,610 precisely, except for the scaling of frequency. 524 00:30:11,610 --> 00:30:14,010 The period in the bottom waveform is 2 pi. 525 00:30:14,010 --> 00:30:20,280 The period in this one is 2 pi over capital T. 526 00:30:20,280 --> 00:30:23,035 So the answer to the question then is easy. 527 00:30:26,540 --> 00:30:28,160 The original question was, under what 528 00:30:28,160 --> 00:30:30,320 conditions can I sample in a way that 529 00:30:30,320 --> 00:30:33,650 preserves the information in the original signal? 530 00:30:33,650 --> 00:30:37,820 Well, this diagram makes it relatively clear. 531 00:30:37,820 --> 00:30:40,340 If the original x was just one of these triangles 532 00:30:40,340 --> 00:30:47,860 and xP is the periodic extension of that, then so long 533 00:30:47,860 --> 00:30:53,180 as the periodic extensions don't overlap with each other, 534 00:30:53,180 --> 00:30:59,890 I can derive x from xP by simply low-pass filtering. 535 00:30:59,890 --> 00:31:01,810 Throw away the frequencies that got 536 00:31:01,810 --> 00:31:04,520 introduced by the convolution with an impulse train. 537 00:31:07,430 --> 00:31:11,060 So as long as the frequencies don't overlap, 538 00:31:11,060 --> 00:31:14,210 as long as there's a clean spot here where there's nothing 539 00:31:14,210 --> 00:31:17,290 happening, as long as the frequencies 540 00:31:17,290 --> 00:31:20,650 of the periodic extensions don't overlap, 541 00:31:20,650 --> 00:31:24,160 then I can sample in a way that contains 542 00:31:24,160 --> 00:31:26,660 all of the information of the original, 543 00:31:26,660 --> 00:31:31,570 so long as when I'm all done, I low-pass filter. 544 00:31:31,570 --> 00:31:34,550 That's called the sampling theorem. 545 00:31:34,550 --> 00:31:37,900 So the sampling theorem, which is not at all obvious 546 00:31:37,900 --> 00:31:41,640 if you don't think about the Fourier space-- 547 00:31:41,640 --> 00:31:44,760 if you only started with the time domain representations 548 00:31:44,760 --> 00:31:46,440 that I showed in the first few slides, 549 00:31:46,440 --> 00:31:49,320 it's not at all obvious that there even 550 00:31:49,320 --> 00:31:53,220 is a way to sample in an information-preserving fashion. 551 00:31:53,220 --> 00:31:54,840 But what we've just seen is that it's 552 00:31:54,840 --> 00:31:58,200 really simple to think about it in the Fourier domain. 553 00:31:58,200 --> 00:32:00,390 Thinking about it in the Fourier domain gives rise 554 00:32:00,390 --> 00:32:02,550 to what we call the sampling theorem, which 555 00:32:02,550 --> 00:32:05,070 says that if a signal is bandlimited-- 556 00:32:05,070 --> 00:32:07,680 that has to do with this overlap part-- 557 00:32:07,680 --> 00:32:09,180 if the signal is bandlimited that 558 00:32:09,180 --> 00:32:11,490 means that all of the non-zero frequency elements 559 00:32:11,490 --> 00:32:16,380 are in some band of frequencies, nothing outside that band. 560 00:32:16,380 --> 00:32:18,690 Outside some band, I don't care what the band is, 561 00:32:18,690 --> 00:32:22,680 but outside that band, the Fourier transform has to be 0. 562 00:32:22,680 --> 00:32:25,920 If the Fourier transform is 0 outside some band, 563 00:32:25,920 --> 00:32:29,070 then it's possible to sample in a way that 564 00:32:29,070 --> 00:32:35,100 preserves all the information so long as I sample fast enough. 565 00:32:35,100 --> 00:32:38,900 So if the original signal is bandlimited so that the Fourier 566 00:32:38,900 --> 00:32:45,350 transform is 0 for frequencies above some frequency omega m, 567 00:32:45,350 --> 00:32:49,410 then x is uniquely determined by its samples. 568 00:32:49,410 --> 00:32:52,250 Uniquely means that I can do an inverse. 569 00:32:52,250 --> 00:32:54,000 So it's uniquely determined by the samples 570 00:32:54,000 --> 00:32:59,050 if and only if omega s, this is sampling frequency, 571 00:32:59,050 --> 00:33:01,030 which is 2 pi over t-- 572 00:33:01,030 --> 00:33:05,130 that's the period of the impulse train. 573 00:33:05,130 --> 00:33:12,910 So if 2 pi over t exceeds twice the frequency of the band 574 00:33:12,910 --> 00:33:14,170 limit. 575 00:33:14,170 --> 00:33:16,480 We'll see in a minute where the factor of 2 comes from. 576 00:33:16,480 --> 00:33:20,630 The factor of 2 comes from negative frequencies. 577 00:33:20,630 --> 00:33:22,600 So the sampling theorem says that there 578 00:33:22,600 --> 00:33:24,760 is a way for a certain kind of signal. 579 00:33:24,760 --> 00:33:26,950 Signals that are bandlimited can be 580 00:33:26,950 --> 00:33:31,610 sampled in a way that preserves all the information. 581 00:33:31,610 --> 00:33:32,980 So here is a summary. 582 00:33:32,980 --> 00:33:35,920 If you sample uniformly-- that's not the only kind of sampling 583 00:33:35,920 --> 00:33:39,312 we do in practice, but it's the basis of all of our theories 584 00:33:39,312 --> 00:33:41,770 for the way sampling works, so that's the only one we're do 585 00:33:41,770 --> 00:33:42,940 in 003. 586 00:33:42,940 --> 00:33:45,910 But just for your intellectual edification, 587 00:33:45,910 --> 00:33:48,640 there are more sophisticated ways to sample. 588 00:33:48,640 --> 00:33:51,784 And in fact, that's a topic of current research. 589 00:33:51,784 --> 00:33:53,200 But for the time being, we're only 590 00:33:53,200 --> 00:33:55,210 going to worry about uniform sampling. 591 00:33:55,210 --> 00:33:57,700 If you sample a signal uniformly in time, 592 00:33:57,700 --> 00:34:02,920 that is every capital T seconds, then you 593 00:34:02,920 --> 00:34:05,920 can do bandlimited reconstruction, 594 00:34:05,920 --> 00:34:10,330 which means that replace every sample with an impulse weighted 595 00:34:10,330 --> 00:34:13,750 by the sample weight and spaced in time 596 00:34:13,750 --> 00:34:17,110 where it would have come from. 597 00:34:17,110 --> 00:34:20,380 Then run it through an ideal low-pass filter 598 00:34:20,380 --> 00:34:23,710 to get rid of the stuff that high frequency copies. 599 00:34:23,710 --> 00:34:26,020 And what comes out will be equal to that, 600 00:34:26,020 --> 00:34:29,110 as long as you've satisfied this relationship, 601 00:34:29,110 --> 00:34:33,340 that the frequencies that are contained in the signal 602 00:34:33,340 --> 00:34:36,600 must be less than the sampling frequency over 2. 603 00:34:40,640 --> 00:34:41,139 OK. 604 00:34:41,139 --> 00:34:42,909 So what's the implication of the sampling theorem? 605 00:34:42,909 --> 00:34:44,199 Think about a particular problem. 606 00:34:44,199 --> 00:34:46,490 We can hear sounds with frequency components that range 607 00:34:46,490 --> 00:34:48,100 from 20 hertz to 20 kilohertz. 608 00:34:51,739 --> 00:34:55,520 What's the minimum-- what's the biggest sampling interval T 609 00:34:55,520 --> 00:34:59,632 that we can use to retain all of the information in a signal 610 00:34:59,632 --> 00:35:00,340 that we can hear? 611 00:37:03,725 --> 00:37:04,600 So what's the answer? 612 00:37:04,600 --> 00:37:05,640 1, 2, 3, 4, 5, 6? 613 00:37:12,011 --> 00:37:12,510 OK. 614 00:37:12,510 --> 00:37:14,720 A sort of shrinking number of votes and sort 615 00:37:14,720 --> 00:37:17,470 of a shrinking number of correct votes. 616 00:37:17,470 --> 00:37:20,950 So it's about 75%. 617 00:37:20,950 --> 00:37:24,010 The only tricky part really is thinking about frequencies. 618 00:37:24,010 --> 00:37:28,191 So I told you frequencies in the commonly used engineering 619 00:37:28,191 --> 00:37:28,690 terms-- 620 00:37:28,690 --> 00:37:30,370 I told you that we hear frequencies 621 00:37:30,370 --> 00:37:33,747 from 20 to 20,000 hertz. 622 00:37:33,747 --> 00:37:35,830 In this course, we usually think about frequencies 623 00:37:35,830 --> 00:37:38,100 as omega radian frequency. 624 00:37:38,100 --> 00:37:41,530 Hertz are cycles per second. 625 00:37:41,530 --> 00:37:44,690 There's 2 pi radians-- 626 00:37:44,690 --> 00:37:46,290 hertz are cycles per second. 627 00:37:46,290 --> 00:37:53,260 Radian frequency is cycles per second radians per second. 628 00:37:53,260 --> 00:37:57,424 There's 2 pi radians per cycle. 629 00:37:57,424 --> 00:37:58,340 OK. 630 00:37:58,340 --> 00:37:58,840 Sorry. 631 00:37:58,840 --> 00:38:00,460 I screwed that up. 632 00:38:00,460 --> 00:38:02,980 Hertz is cycles per second. 633 00:38:02,980 --> 00:38:05,230 Omega is radians per second. 634 00:38:05,230 --> 00:38:09,100 The conversion is 2 pi radians per cycle. 635 00:38:09,100 --> 00:38:11,452 So we need to have-- 636 00:38:11,452 --> 00:38:12,910 the highest frequency in the signal 637 00:38:12,910 --> 00:38:14,980 has to be smaller than the sampling frequency divided 638 00:38:14,980 --> 00:38:15,480 by 2. 639 00:38:18,952 --> 00:38:20,410 The highest frequency in the signal 640 00:38:20,410 --> 00:38:26,330 is 2 pi fm, if f is frequencies 20 to 20 kilohertz. 641 00:38:26,330 --> 00:38:31,204 And the sampling frequency is 2 pi over capital T. 642 00:38:31,204 --> 00:38:32,870 So you clear the fraction and figure out 643 00:38:32,870 --> 00:38:36,820 that T has to be smaller than 25 microseconds. 644 00:38:39,350 --> 00:38:39,850 OK. 645 00:38:39,850 --> 00:38:43,690 So the idea then is that there's a way 646 00:38:43,690 --> 00:38:50,190 of thinking about any signal with a finite bandwidth-- 647 00:38:50,190 --> 00:38:52,720 there's a way of sampling using uniform 648 00:38:52,720 --> 00:38:55,420 sampling so that you can sample that signal without loss 649 00:38:55,420 --> 00:38:56,950 of information. 650 00:38:56,950 --> 00:38:59,324 All you need to do is figure out how frequently 651 00:38:59,324 --> 00:39:00,240 you need to sample it. 652 00:39:00,240 --> 00:39:01,987 Yes? 653 00:39:01,987 --> 00:39:02,945 AUDIENCE: Implications? 654 00:39:02,945 --> 00:39:05,932 A signal is not badlimited. 655 00:39:05,932 --> 00:39:07,890 DENNIS FREEMAN: If a signal is not bandlimited, 656 00:39:07,890 --> 00:39:08,681 you have a problem. 657 00:39:08,681 --> 00:39:10,970 AUDIENCE: Is it possible to [INAUDIBLE]? 658 00:39:13,800 --> 00:39:16,700 DENNIS FREEMAN: So the question is, to what extent-- 659 00:39:16,700 --> 00:39:20,420 is it possible to sample a signal that is not bandlimited? 660 00:39:20,420 --> 00:39:23,570 So that's the next topic. 661 00:39:23,570 --> 00:39:26,370 So the question I'm going to address now 662 00:39:26,370 --> 00:39:29,160 is, well, what happens if you don't satisfy the sampling 663 00:39:29,160 --> 00:39:30,450 theorem? 664 00:39:30,450 --> 00:39:32,430 What if there are frequency components that are 665 00:39:32,430 --> 00:39:36,820 outside the admissible band-- 666 00:39:36,820 --> 00:39:42,455 the admissible region of frequencies? 667 00:39:42,455 --> 00:39:43,830 So to think about that, I'm going 668 00:39:43,830 --> 00:39:48,760 to think about this as a model of sampling. 669 00:39:48,760 --> 00:39:49,976 So I think about-- 670 00:39:49,976 --> 00:39:54,420 and the value of the model is that it's entirely in CT. 671 00:39:54,420 --> 00:39:56,880 It gets confusing when you mix domains 672 00:39:56,880 --> 00:40:00,000 and you have to compare this kind of a frequency 673 00:40:00,000 --> 00:40:02,230 to that kind of frequency. 674 00:40:02,230 --> 00:40:05,250 So what I'm going to do is think about it entirely in CT 675 00:40:05,250 --> 00:40:08,130 by making a model of how sampling works. 676 00:40:08,130 --> 00:40:12,120 Sampling is equivalent to take the original signal that you're 677 00:40:12,120 --> 00:40:14,780 trying to sample, multiply by an impulse train showed here. 678 00:40:17,490 --> 00:40:21,240 You get out this xP thing that we've been talking about. 679 00:40:21,240 --> 00:40:23,550 And then run that through an ideal low-pass filter. 680 00:40:23,550 --> 00:40:25,290 And if this comes out looking like that, 681 00:40:25,290 --> 00:40:31,872 then the sampling preserves all of the information. 682 00:40:31,872 --> 00:40:33,580 Now what I want to do is think about what 683 00:40:33,580 --> 00:40:37,462 happens when I put in a signal for which that doesn't hold. 684 00:40:37,462 --> 00:40:39,420 So let's start with the simplest possible case. 685 00:40:39,420 --> 00:40:42,910 Let's think about a tone, so a signal 686 00:40:42,910 --> 00:40:46,130 that contains a single frequency components. 687 00:40:46,130 --> 00:40:51,040 So I'm representing that by a cosine wave, cosine omega o T. 688 00:40:51,040 --> 00:40:55,570 So I'm representing that by two impulses, Euler's equation. 689 00:40:55,570 --> 00:41:00,430 And I'm thinking about some sampling waveform, where 690 00:41:00,430 --> 00:41:02,920 I'm looking at it here in frequency, so the spacing is 691 00:41:02,920 --> 00:41:07,420 2 pi over T. And if the frequencies in the signal 692 00:41:07,420 --> 00:41:10,300 are smaller than 1/2 of the maximum frequency omega 693 00:41:10,300 --> 00:41:12,587 s, everything should work. 694 00:41:12,587 --> 00:41:14,170 And you can sort of see in the Fourier 695 00:41:14,170 --> 00:41:16,390 picture what's happening. 696 00:41:16,390 --> 00:41:18,730 When I convolve these two signals-- 697 00:41:18,730 --> 00:41:22,140 I multiply in time, so I'm convolving in frequency. 698 00:41:22,140 --> 00:41:24,670 When I convolve this with the impulse train, 699 00:41:24,670 --> 00:41:32,390 this impulse brings this pair of frequencies here. 700 00:41:32,390 --> 00:41:36,330 But this impulse brings this pair up here. 701 00:41:36,330 --> 00:41:39,990 And then this one brings this pair up here. 702 00:41:39,990 --> 00:41:41,630 So I repeat. 703 00:41:41,630 --> 00:41:45,540 So I get a repetition then of the original two 704 00:41:45,540 --> 00:41:49,341 at integer multiples of omega s. 705 00:41:49,341 --> 00:41:49,840 OK. 706 00:41:49,840 --> 00:41:52,180 So if I low-pass filter then with the red line, 707 00:41:52,180 --> 00:41:52,930 everything's fine. 708 00:41:52,930 --> 00:41:54,804 I end up with a signal with the output that's 709 00:41:54,804 --> 00:41:58,530 the same single as the input, no problem. 710 00:41:58,530 --> 00:42:02,240 What happens, however, as I increase frequency? 711 00:42:02,240 --> 00:42:03,410 Same thing. 712 00:42:03,410 --> 00:42:05,540 The originals are reproduced here. 713 00:42:05,540 --> 00:42:08,880 The modulation by this brings this up to here. 714 00:42:08,880 --> 00:42:11,100 The low-pass filter still separates it out. 715 00:42:11,100 --> 00:42:13,960 The problem is here. 716 00:42:13,960 --> 00:42:19,760 Now I'm running into trouble, because the original signal 717 00:42:19,760 --> 00:42:24,936 fell right on the edge of my limit, omega s over 2. 718 00:42:24,936 --> 00:42:26,310 And the problem's even more clear 719 00:42:26,310 --> 00:42:27,890 if I go to an even higher frequency. 720 00:42:27,890 --> 00:42:30,720 So now, this component is coming out here, 721 00:42:30,720 --> 00:42:34,662 which is outside the box. 722 00:42:34,662 --> 00:42:36,120 The thing that's happening, though, 723 00:42:36,120 --> 00:42:38,320 is that convolution with this guy 724 00:42:38,320 --> 00:42:42,570 is bringing in an element that is spaced by omega s 725 00:42:42,570 --> 00:42:45,450 and is now inside the box. 726 00:42:45,450 --> 00:42:46,280 That's bad. 727 00:42:49,060 --> 00:42:50,710 Everybody see what's happening? 728 00:42:50,710 --> 00:42:53,790 So I'm just studying what happens as I have one frequency 729 00:42:53,790 --> 00:42:55,890 and vary the frequency-- if I have 730 00:42:55,890 --> 00:42:57,360 a tone at a single frequency and I 731 00:42:57,360 --> 00:43:00,330 vary the frequency of the tone, as long 732 00:43:00,330 --> 00:43:04,020 as the frequency is inside my limit, omega s over 2, 733 00:43:04,020 --> 00:43:06,080 I'm fine. 734 00:43:06,080 --> 00:43:08,760 The low-pass filter reconstructs the original. 735 00:43:08,760 --> 00:43:13,110 But something bizarre happens whenever I'm outside. 736 00:43:13,110 --> 00:43:16,829 And to see what's going on, it's easiest to see 737 00:43:16,829 --> 00:43:18,870 what's going on by making a map between the input 738 00:43:18,870 --> 00:43:22,470 frequency and the apparent frequency, 739 00:43:22,470 --> 00:43:24,580 the apparent frequency of the output. 740 00:43:24,580 --> 00:43:27,370 So what happens if I'm at a low frequency, 741 00:43:27,370 --> 00:43:29,580 I'm on a linear relationship between the input 742 00:43:29,580 --> 00:43:31,230 frequency and the output. 743 00:43:31,230 --> 00:43:35,390 The output reproduces the input exactly. 744 00:43:35,390 --> 00:43:38,420 And you can see as I'm increasing the frequency, 745 00:43:38,420 --> 00:43:41,750 I'm just sampling this function at a different place. 746 00:43:41,750 --> 00:43:45,106 But when I go higher, it appears as though the frequency 747 00:43:45,106 --> 00:43:45,605 got smaller. 748 00:43:50,050 --> 00:43:53,430 We call that aliasing. 749 00:43:53,430 --> 00:43:56,500 This is a question to get you to think through aliasing. 750 00:43:56,500 --> 00:43:59,800 But in the interest of time, because I have a demo, 751 00:43:59,800 --> 00:44:02,570 I'll leave this for you to think about. 752 00:44:02,570 --> 00:44:05,230 So the question is, thinking about what's 753 00:44:05,230 --> 00:44:08,350 the effect of aliasing and where do the new frequencies 754 00:44:08,350 --> 00:44:11,380 land relative to the input frequency-- 755 00:44:11,380 --> 00:44:13,600 they have this funny folding property. 756 00:44:13,600 --> 00:44:16,885 And the effect of the folding property kind of wreaks havoc. 757 00:44:20,010 --> 00:44:26,250 So I'll skip this for now and just jump to the idea 758 00:44:26,250 --> 00:44:28,650 that the intuition that we get by thinking 759 00:44:28,650 --> 00:44:31,620 about single frequencies carries over to complex frequency 760 00:44:31,620 --> 00:44:32,830 representations. 761 00:44:32,830 --> 00:44:36,390 So now what if my message, what if my input had this triangular 762 00:44:36,390 --> 00:44:39,890 frequency Fourier transform, rather than 763 00:44:39,890 --> 00:44:42,840 just a single spike? 764 00:44:42,840 --> 00:44:45,360 And so I'm sampling it as showed here, 765 00:44:45,360 --> 00:44:47,830 so this is my impulse train and frequency. 766 00:44:47,830 --> 00:44:51,780 And as before, the message gets reproduced at integer multiples 767 00:44:51,780 --> 00:44:53,960 of omega s. 768 00:44:53,960 --> 00:44:58,020 And as long as the bandwidth of the message is small enough, 769 00:44:58,020 --> 00:45:01,050 I can put the red low-pass filter 770 00:45:01,050 --> 00:45:07,140 to eliminate the copies from the periodic extension, 771 00:45:07,140 --> 00:45:10,700 and I get an output that's equal to the input. 772 00:45:10,700 --> 00:45:12,390 The problem is that if I increase 773 00:45:12,390 --> 00:45:18,440 the bandwidth of the input, as I increase 774 00:45:18,440 --> 00:45:21,050 the bandwidth of the input, the margin 775 00:45:21,050 --> 00:45:26,450 between the base signal and the periodic extension 776 00:45:26,450 --> 00:45:28,430 gets smaller. 777 00:45:28,430 --> 00:45:34,900 And if the bandwidth gets too great, they begin to overlap. 778 00:45:34,900 --> 00:45:38,520 So now if I low-pass filter this signal, 779 00:45:38,520 --> 00:45:41,430 I pick up the desired blue part of this, 780 00:45:41,430 --> 00:45:44,670 but the undesired green part of that. 781 00:45:44,670 --> 00:45:47,940 And the result is that the signal is not 782 00:45:47,940 --> 00:45:50,820 a faithful reproduction of what I started with. 783 00:45:50,820 --> 00:45:54,420 Same sort of thing happens if I hold the message constant 784 00:45:54,420 --> 00:45:57,800 and change the frequency spacing. 785 00:45:57,800 --> 00:46:00,350 As long as I sample with big enough frequencies-- 786 00:46:00,350 --> 00:46:02,000 that is small enough times. 787 00:46:02,000 --> 00:46:05,240 There's an inverse relationship between frequency and time. 788 00:46:05,240 --> 00:46:08,210 If the frequency is big enough so the times are short enough, 789 00:46:08,210 --> 00:46:12,084 I can reproduce what the signal looked like. 790 00:46:12,084 --> 00:46:18,400 But now if I change the sampling to happen slower, 791 00:46:18,400 --> 00:46:20,590 I start to get aliasing. 792 00:46:20,590 --> 00:46:22,570 So it's exactly analogous. 793 00:46:22,570 --> 00:46:25,780 So that means that if you have a fixed signal, 794 00:46:25,780 --> 00:46:28,210 there's some minimum rate at which you 795 00:46:28,210 --> 00:46:32,860 have to sample it in order to not lose information. 796 00:46:32,860 --> 00:46:34,870 So what I want to do now is demonstrate that 797 00:46:34,870 --> 00:46:37,220 by thinking about music. 798 00:46:37,220 --> 00:46:42,430 So I have a cut of music that was originally taken from a CD, 799 00:46:42,430 --> 00:46:44,830 so it was sampled at 44.1 kilohertz. 800 00:46:44,830 --> 00:46:48,620 That's standard CD frequency sampling. 801 00:46:48,620 --> 00:46:55,000 And I've re-sampled it at 1/2, 1/4, 1/8, 1/16. 802 00:46:55,000 --> 00:46:59,130 And I'm going to play what happens when I 803 00:46:59,130 --> 00:47:01,717 do these various re-samplings. 804 00:47:01,717 --> 00:47:04,697 [MUSIC PLAYING - JOHANN SEBASTIAN BACH, "SONATA NO. 805 00:47:04,697 --> 00:47:05,196 1"] 806 00:47:14,639 --> 00:47:17,727 [MUSIC PLAYING - JOHANN SEBASTIAN BACH, "SONATA NO. 807 00:47:17,727 --> 00:47:26,567 1"] 808 00:47:26,567 --> 00:47:29,547 [MUSIC PLAYING - JOHANN SEBASTIAN BACH, "SONATA NO. 809 00:47:29,547 --> 00:47:30,046 1"] 810 00:47:37,998 --> 00:47:40,978 [MUSIC PLAYING - JOHANN SEBASTIAN BACH, "SONATA NO. 811 00:47:40,978 --> 00:47:41,477 1"] 812 00:47:49,429 --> 00:47:52,517 [MUSIC PLAYING - JOHANN SEBASTIAN BACH, "SONATA NO. 813 00:47:52,517 --> 00:48:01,357 1"] 814 00:48:01,357 --> 00:48:01,870 OK. 815 00:48:01,870 --> 00:48:05,930 Some you may have been able to tell the difference. 816 00:48:05,930 --> 00:48:09,590 So the idea is that by decreasing 817 00:48:09,590 --> 00:48:11,930 the rate at which I'm sampling it in time, 818 00:48:11,930 --> 00:48:15,140 I get fewer samples in the total signal, which makes it easier 819 00:48:15,140 --> 00:48:17,540 to store and increases the amount of stuff 820 00:48:17,540 --> 00:48:19,730 that I could put on a given medium. 821 00:48:19,730 --> 00:48:21,500 That's good. 822 00:48:21,500 --> 00:48:24,020 Problem is, it doesn't sound as good. 823 00:48:24,020 --> 00:48:28,160 So every step down this path resulted in 1/2 824 00:48:28,160 --> 00:48:30,650 the information of the previous one, 825 00:48:30,650 --> 00:48:32,540 which means that I could double the capacity 826 00:48:32,540 --> 00:48:36,260 of your MP3 player. 827 00:48:36,260 --> 00:48:40,250 But there was distortions added because of this aliasing 828 00:48:40,250 --> 00:48:44,150 problem, because some of the frequencies at the lower 829 00:48:44,150 --> 00:48:49,850 sampling rates were too large to be faithfully reproduced 830 00:48:49,850 --> 00:48:51,950 by the sampling. 831 00:48:51,950 --> 00:48:55,970 They got moved, they got aliased to the wrong place. 832 00:48:55,970 --> 00:48:58,659 That gives rise to sounds that are inharmonic 833 00:48:58,659 --> 00:48:59,450 and they sound bad. 834 00:49:08,190 --> 00:49:11,640 So this just recapitulates what we were seeing in the demo. 835 00:49:11,640 --> 00:49:15,930 I started out barely having enough bandwidth to represent 836 00:49:15,930 --> 00:49:17,750 the original signal. 837 00:49:17,750 --> 00:49:22,550 And as I made the sampling frequency smaller, 838 00:49:22,550 --> 00:49:27,290 making the distance between samples bigger-- 839 00:49:27,290 --> 00:49:30,770 as I made the frequency of the sampling smaller, 840 00:49:30,770 --> 00:49:33,830 I started to get overlap, and that's what sounded funny. 841 00:49:33,830 --> 00:49:37,160 So the slower I sampled, the more overlap and the funnier 842 00:49:37,160 --> 00:49:38,210 it sounded. 843 00:49:38,210 --> 00:49:40,370 So the question is, what can you-- 844 00:49:40,370 --> 00:49:41,960 how can you deal with that? 845 00:49:41,960 --> 00:49:46,790 One way you can deal with that is what we call anti-aliasing. 846 00:49:46,790 --> 00:49:50,870 So it's very bad if you put a frequency into a sampling 847 00:49:50,870 --> 00:49:55,400 system where the frequency is too big to be faithfully 848 00:49:55,400 --> 00:49:58,580 reproduced, because it comes out at a different frequency that 849 00:49:58,580 --> 00:50:02,480 cannot be determined from the output alone. 850 00:50:02,480 --> 00:50:03,730 So how can you deal with that? 851 00:50:03,730 --> 00:50:07,660 One way you can deal with it is to pre-filter, 852 00:50:07,660 --> 00:50:12,960 take out everything that could be offensive before you sample. 853 00:50:12,960 --> 00:50:15,780 That's called anti-aliasing. 854 00:50:15,780 --> 00:50:22,040 And the result is not faithful reproduction of the original. 855 00:50:22,040 --> 00:50:24,530 But it's at least faithful reproduction 856 00:50:24,530 --> 00:50:29,410 of the part of the band that is reproduced. 857 00:50:29,410 --> 00:50:32,910 So it's not distortion-free. 858 00:50:32,910 --> 00:50:36,420 The transformation from the very input to the very output 859 00:50:36,420 --> 00:50:37,410 is not-- 860 00:50:37,410 --> 00:50:39,420 there's not a unity transformation, 861 00:50:39,420 --> 00:50:41,430 because you violated the sampling theorem. 862 00:50:41,430 --> 00:50:46,180 But at least you don't alias frequencies to the wrong place. 863 00:50:46,180 --> 00:50:47,850 So the result t-- 864 00:50:47,850 --> 00:50:52,206 I'll play without anti-aliasing, with anti-aliasing, without, 865 00:50:52,206 --> 00:50:53,996 with, without, with. 866 00:50:53,996 --> 00:50:57,092 [MUSIC PLAYING - JOHANN SEBASTIAN BACH, "SONATA NO. 867 00:50:57,092 --> 00:52:03,390 1"] 868 00:52:03,390 --> 00:52:03,935 OK. 869 00:52:03,935 --> 00:52:07,400 So the final one didn't sound exactly like the original, 870 00:52:07,400 --> 00:52:10,250 but at least it wasn't grating. 871 00:52:10,250 --> 00:52:12,822 So the idea, then, is just that sampling's very important. 872 00:52:12,822 --> 00:52:14,780 And by thinking about it in the Fourier domain, 873 00:52:14,780 --> 00:52:17,720 we get a lot of insights that we wouldn't have gotten otherwise. 874 00:52:17,720 --> 00:52:19,510 See you tomorrow.