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:26,534 --> 00:00:27,840 DENNIS FREEMAN: Hello, welcome. 9 00:00:31,080 --> 00:00:34,500 As you expect, the big news is that there's a quiz next week. 10 00:00:34,500 --> 00:00:38,010 So hopefully, that's all square, everybody knows everything. 11 00:00:38,010 --> 00:00:39,640 Questions, comments? 12 00:00:39,640 --> 00:00:41,790 Everybody's pretty comfortable with what's 13 00:00:41,790 --> 00:00:44,950 going on with the quiz? 14 00:00:44,950 --> 00:00:47,410 If you have a conflict, please contact me shortly, 15 00:00:47,410 --> 00:00:52,000 because I have to arrange rooms and proctors. 16 00:00:52,000 --> 00:00:53,740 No questions? 17 00:00:53,740 --> 00:00:55,090 Good. 18 00:00:55,090 --> 00:00:59,470 So last time we looked at discrete time frequency 19 00:00:59,470 --> 00:01:01,180 responses. 20 00:01:01,180 --> 00:01:02,530 Lots of things were similar. 21 00:01:02,530 --> 00:01:05,140 A few things were different. 22 00:01:05,140 --> 00:01:08,420 The first difference we saw was that in discrete time, 23 00:01:08,420 --> 00:01:12,040 we like to think about complex geometric sequences rather than 24 00:01:12,040 --> 00:01:14,410 complex exponential sequences. 25 00:01:14,410 --> 00:01:18,940 And the effect of that is that the frequency response 26 00:01:18,940 --> 00:01:20,660 lives on the unit circle. 27 00:01:20,660 --> 00:01:23,530 So if you try to think about a discrete time system, 28 00:01:23,530 --> 00:01:27,005 say, characterized by a z-transform 29 00:01:27,005 --> 00:01:29,130 and think about what would be its output when there 30 00:01:29,130 --> 00:01:32,500 is a sinusoidal input, just like CT, 31 00:01:32,500 --> 00:01:34,270 if you have a sinusoidal input, there's 32 00:01:34,270 --> 00:01:38,674 going to be a sinusoidal output at the same frequency. 33 00:01:38,674 --> 00:01:40,465 But the amplitude and phase can be shifted. 34 00:01:40,465 --> 00:01:44,950 But to compute the amplitude and the phase for a DT system, 35 00:01:44,950 --> 00:01:48,510 you look at the unit circle of the z-transform. 36 00:01:48,510 --> 00:01:52,690 That's as distinct from the Laplace transform in CT, 37 00:01:52,690 --> 00:01:54,320 we looked at the j omega-axis. 38 00:01:54,320 --> 00:01:56,710 So now, everything we used to say about the j omega-axis, 39 00:01:56,710 --> 00:01:58,930 we say about the unit circle. 40 00:01:58,930 --> 00:02:03,100 Other than that, things are extremely similar. 41 00:02:03,100 --> 00:02:04,550 And just to boost your confidence 42 00:02:04,550 --> 00:02:09,220 so you know exactly what's going on, here's a question. 43 00:02:09,220 --> 00:02:10,900 What if I gave you a system that had 44 00:02:10,900 --> 00:02:14,560 a single pole and a single zero, and say the pole and zero are 45 00:02:14,560 --> 00:02:18,140 related that way? 46 00:02:18,140 --> 00:02:20,000 How would you think about that system-- 47 00:02:20,000 --> 00:02:23,300 Low pass, high pass, all pass, band pass, band stop, 48 00:02:23,300 --> 00:02:26,720 high stop, low stop, all stop? 49 00:02:37,478 --> 00:02:38,945 AUDIENCE: I say low pass. 50 00:02:38,945 --> 00:02:39,923 AUDIENCE: Low pass. 51 00:02:39,923 --> 00:02:41,390 AUDIENCE: Band pass. 52 00:02:41,390 --> 00:02:43,310 DENNIS FREEMAN: So some very early votes 53 00:02:43,310 --> 00:02:44,600 that are completely correct. 54 00:02:50,490 --> 00:02:53,200 You had the recitation, so then there is no excuse. 55 00:02:53,200 --> 00:02:56,440 So if I see any wrong answers-- 56 00:02:56,440 --> 00:02:58,320 and I see wrong answers. 57 00:02:58,320 --> 00:02:59,820 [LAUGHTER] 58 00:02:59,820 --> 00:03:00,320 Ah! 59 00:03:06,820 --> 00:03:09,370 So maybe I should have the recitation instructor-- well, 60 00:03:09,370 --> 00:03:13,900 no, no, OK, everybody votes. 61 00:03:13,900 --> 00:03:18,400 So high pass, low pass, band pass, all pass, band stop, 62 00:03:18,400 --> 00:03:21,960 none of the above, vote. 63 00:03:21,960 --> 00:03:24,300 The vast majority is 100% correct. 64 00:03:24,300 --> 00:03:27,660 The vast majority is correct, but it's not quite 100%. 65 00:03:27,660 --> 00:03:32,120 So the answer is 4, all pass. 66 00:03:32,120 --> 00:03:33,616 Why? 67 00:03:33,616 --> 00:03:34,990 Can somebody make an argument why 68 00:03:34,990 --> 00:03:37,323 that should be all pass, other than you saw it yesterday 69 00:03:37,323 --> 00:03:38,800 in recitation? 70 00:03:38,800 --> 00:03:39,494 [LAUGHTER] 71 00:03:39,494 --> 00:03:40,660 I mean that's a good reason. 72 00:03:43,500 --> 00:03:44,650 Yeah. 73 00:03:44,650 --> 00:03:49,612 AUDIENCE: It can no longer go through the axis below omega. 74 00:03:49,612 --> 00:03:51,859 The magnitude of the zero divided by the magnitude 75 00:03:51,859 --> 00:03:53,308 of the pole is pretty large. 76 00:03:53,308 --> 00:03:57,172 And then as you go to infinite omega, it goes to 1. 77 00:03:57,172 --> 00:03:58,621 So I think it's going to pass. 78 00:03:58,621 --> 00:04:01,300 DENNIS FREEMAN: So I'm a little bothered by infinite omega. 79 00:04:01,300 --> 00:04:03,640 Where should we be-- 80 00:04:03,640 --> 00:04:06,287 when we think about things as low pass, high pass, whatever, 81 00:04:06,287 --> 00:04:07,870 what are we thinking about when we say 82 00:04:07,870 --> 00:04:09,161 something is a low pass filter? 83 00:04:11,830 --> 00:04:13,267 So somebody says this. 84 00:04:13,267 --> 00:04:14,100 So what's that mean? 85 00:04:14,100 --> 00:04:16,140 That's correct. 86 00:04:16,140 --> 00:04:18,040 So a large fraction of this class 87 00:04:18,040 --> 00:04:20,370 is learning to interpret sign language in the air. 88 00:04:20,370 --> 00:04:25,610 And so what's it mean if a system is low pass? 89 00:04:25,610 --> 00:04:28,256 What do I look for when I look at this diagram 90 00:04:28,256 --> 00:04:29,630 to see that something's low pass? 91 00:04:32,366 --> 00:04:34,190 AUDIENCE: Look for lower frequencies. 92 00:04:34,190 --> 00:04:37,302 DENNIS FREEMAN: Where is low frequencies on this diagram? 93 00:04:37,302 --> 00:04:39,186 AUDIENCE: If you cut in half-- 94 00:04:39,186 --> 00:04:46,397 DENNIS FREEMAN: Cut it in half, top and bottom, take that side. 95 00:04:46,397 --> 00:04:47,830 [LAUGHTER] 96 00:04:47,830 --> 00:04:51,610 So low frequencies are there. 97 00:04:51,610 --> 00:04:54,100 So we're thinking about frequencies 98 00:04:54,100 --> 00:04:59,140 being e to the j omega, because what we're 99 00:04:59,140 --> 00:05:00,640 thinking of or thinking about, we'd 100 00:05:00,640 --> 00:05:03,460 like to think about cosine of omega n. 101 00:05:03,460 --> 00:05:05,650 But we want to make that look like an eigenfunction. 102 00:05:05,650 --> 00:05:09,280 So we want to make that look like e to the j omega n 103 00:05:09,280 --> 00:05:11,950 plus e to the minus j omega n, that kind of thing-- 104 00:05:16,464 --> 00:05:18,030 then divide by 1/2 probably. 105 00:05:23,590 --> 00:05:25,762 So the question is-- so this is all pass. 106 00:05:25,762 --> 00:05:27,220 And that's actually kind of tricky, 107 00:05:27,220 --> 00:05:29,219 if you think about how it would become that way. 108 00:05:29,219 --> 00:05:29,838 Yes. 109 00:05:29,838 --> 00:05:32,710 AUDIENCE: [INAUDIBLE] at any point on the unit circle-- 110 00:05:32,710 --> 00:05:33,543 DENNIS FREEMAN: Yes. 111 00:05:33,543 --> 00:05:36,896 AUDIENCE: It stems from the [INAUDIBLE]. 112 00:05:36,896 --> 00:05:38,800 DENNIS FREEMAN: That's precisely right. 113 00:05:38,800 --> 00:05:44,290 So somehow, if you took this distance and that distance, 114 00:05:44,290 --> 00:05:47,909 which is intended in this figure not to look the same, 115 00:05:47,909 --> 00:05:50,200 but if you took the ratio-- because this one is a zero, 116 00:05:50,200 --> 00:05:51,970 so it's in the top, and this one is a pole, so it's 117 00:05:51,970 --> 00:05:54,940 in the bottom-- and if you took that ratio, somehow if you took 118 00:05:54,940 --> 00:05:57,820 that ratio divided by that ratio and compared it 119 00:05:57,820 --> 00:06:00,970 to this one divided by that one, those numbers 120 00:06:00,970 --> 00:06:03,590 would be the same thing. 121 00:06:03,590 --> 00:06:06,280 That's what would have to happen. 122 00:06:06,280 --> 00:06:09,550 You would compute the magnitude of the frequency response 123 00:06:09,550 --> 00:06:15,460 by taking the ratio of the magnitudes of the vectors 124 00:06:15,460 --> 00:06:17,690 that connect the zero to the point of interest 125 00:06:17,690 --> 00:06:19,270 and the pole to the point of interest-- the point 126 00:06:19,270 --> 00:06:20,811 of interest being on the unit circle. 127 00:06:23,520 --> 00:06:27,720 It's not at all obvious to me that that ratio is a constant, 128 00:06:27,720 --> 00:06:29,040 if you move along a circle. 129 00:06:29,040 --> 00:06:30,456 That's another one of those things 130 00:06:30,456 --> 00:06:32,540 that I think I need Greek to convince me. 131 00:06:32,540 --> 00:06:34,540 AUDIENCE: [INAUDIBLE] because he figured it out. 132 00:06:34,540 --> 00:06:35,998 DENNIS FREEMAN: Oh, somebody knows. 133 00:06:35,998 --> 00:06:37,980 AUDIENCE: Yeah, the guy [INAUDIBLE]. 134 00:06:37,980 --> 00:06:39,180 DENNIS FREEMAN: Wonderful. 135 00:06:39,180 --> 00:06:40,523 So you should explain it to me. 136 00:06:40,523 --> 00:06:41,022 [LAUGHS] 137 00:06:41,022 --> 00:06:42,870 AUDIENCE: He explained it to me. 138 00:06:42,870 --> 00:06:45,585 DENNIS FREEMAN: [LAUGHS] Putting you on the spot. 139 00:06:45,585 --> 00:06:47,240 AUDIENCE: Like right now? 140 00:06:47,240 --> 00:06:49,140 DENNIS FREEMAN: Oh, that's OK. 141 00:06:49,140 --> 00:06:52,820 If you want to, that's fine. 142 00:06:52,820 --> 00:06:56,325 AUDIENCE: [INAUDIBLE] So if you have 143 00:06:56,325 --> 00:06:57,750 any point on the unit circle? 144 00:06:57,750 --> 00:06:58,625 DENNIS FREEMAN: Yeah. 145 00:06:58,625 --> 00:07:01,936 AUDIENCE: You draw like a line from that point to the origin. 146 00:07:01,936 --> 00:07:06,720 DENNIS FREEMAN: So if you have any point on the unit circle, 147 00:07:06,720 --> 00:07:07,555 say that one-- 148 00:07:07,555 --> 00:07:09,821 AUDIENCE: So you draw a line halfway-- 149 00:07:09,821 --> 00:07:12,320 could you do it on the other side, on that side [INAUDIBLE]. 150 00:07:12,320 --> 00:07:14,361 DENNIS FREEMAN: So you like this side better, OK. 151 00:07:14,361 --> 00:07:17,930 AUDIENCE: So you draw a line from that point to the origin. 152 00:07:17,930 --> 00:07:21,120 [INAUDIBLE] 1 over a and a on the x-axis. 153 00:07:21,120 --> 00:07:23,950 DENNIS FREEMAN: So 1 over a and a. 154 00:07:23,950 --> 00:07:26,695 AUDIENCE: And draw set of lines from those to the point 155 00:07:26,695 --> 00:07:27,320 of [INAUDIBLE]. 156 00:07:27,320 --> 00:07:28,319 DENNIS FREEMAN: Up here? 157 00:07:28,319 --> 00:07:29,546 AUDIENCE: Yeah. 158 00:07:29,546 --> 00:07:31,170 So now like you have two triangles that 159 00:07:31,170 --> 00:07:34,883 have the same side and the same angle. 160 00:07:34,883 --> 00:07:37,753 And if you just use the law of cosines-- 161 00:07:37,753 --> 00:07:39,510 DENNIS FREEMAN: You have two-- 162 00:07:39,510 --> 00:07:41,927 AUDIENCE: So you have a big triangle and a small triangle. 163 00:07:41,927 --> 00:07:43,593 DENNIS FREEMAN: So we have this triangle 164 00:07:43,593 --> 00:07:45,220 and we have this triangle. 165 00:07:45,220 --> 00:07:46,415 Those are the two you want? 166 00:07:46,415 --> 00:07:47,206 AUDIENCE: And yeah. 167 00:07:47,206 --> 00:07:49,290 So like they have-- 168 00:07:49,290 --> 00:07:53,266 the line of the leftmost is like the same for both. 169 00:07:53,266 --> 00:07:57,154 And the angle at the center is the same for both. 170 00:07:57,154 --> 00:07:59,376 DENNIS FREEMAN: So this angle is equal to this angle? 171 00:07:59,376 --> 00:07:59,917 AUDIENCE: No. 172 00:07:59,917 --> 00:08:01,360 AUDIENCE: The central angle. 173 00:08:01,360 --> 00:08:03,150 The central angle with the-- 174 00:08:03,150 --> 00:08:06,104 AUDIENCE: You take the whole be triangle and-- 175 00:08:06,104 --> 00:08:07,900 DENNIS FREEMAN: Take the big triangle-- 176 00:08:07,900 --> 00:08:08,941 AUDIENCE: And the origin. 177 00:08:08,941 --> 00:08:10,580 AUDIENCE: And then the one you just-- 178 00:08:10,580 --> 00:08:11,996 AUDIENCE: The angle at the origin. 179 00:08:11,996 --> 00:08:15,083 DENNIS FREEMAN: And the angle at the origin. 180 00:08:15,083 --> 00:08:16,556 AUDIENCE: Yes, that one. 181 00:08:16,556 --> 00:08:18,909 AUDIENCE: So that angle is in both the big triangle 182 00:08:18,909 --> 00:08:19,700 and the little one. 183 00:08:19,700 --> 00:08:20,750 DENNIS FREEMAN: That angle is in the big triangle 184 00:08:20,750 --> 00:08:21,541 and the little one? 185 00:08:21,541 --> 00:08:22,080 Yes! 186 00:08:22,080 --> 00:08:23,040 [LAUGHTER] 187 00:08:23,040 --> 00:08:24,470 Got it! 188 00:08:24,470 --> 00:08:26,653 AUDIENCE: And the size of the bottom 189 00:08:26,653 --> 00:08:29,196 are like 1/a and a for the two triangles. 190 00:08:29,196 --> 00:08:30,070 DENNIS FREEMAN: Yeah. 191 00:08:30,070 --> 00:08:32,485 AUDIENCE: So you just use the law of cosines and-- 192 00:08:32,485 --> 00:08:33,860 DENNIS FREEMAN: That's very good. 193 00:08:33,860 --> 00:08:34,790 AUDIENCE: Isn't that pretty? 194 00:08:34,790 --> 00:08:36,185 DENNIS FREEMAN: What was that? 195 00:08:36,185 --> 00:08:37,120 AUDIENCE: Isn't that pretty? 196 00:08:37,120 --> 00:08:38,411 DENNIS FREEMAN: That's amazing. 197 00:08:40,730 --> 00:08:41,848 So wonderful. 198 00:08:41,848 --> 00:08:42,514 Congratulations. 199 00:08:42,514 --> 00:08:46,740 [APPLAUSE] 200 00:08:46,740 --> 00:08:49,747 So you're also working on the triangle thing? 201 00:08:49,747 --> 00:08:50,580 Don't have that yet. 202 00:08:50,580 --> 00:08:52,100 OK. 203 00:08:52,100 --> 00:08:53,810 I'll keep checking in. 204 00:08:53,810 --> 00:08:59,030 So the way people who don't do quite so well in trig do it, 205 00:08:59,030 --> 00:09:03,620 so you can also just empty-headedly substitute z 206 00:09:03,620 --> 00:09:06,702 equals e to the j omega. 207 00:09:06,702 --> 00:09:09,160 And then if you want to make the top look a little bit more 208 00:09:09,160 --> 00:09:13,280 like the bottom, you could take out the e to the j omega part. 209 00:09:15,980 --> 00:09:18,803 And then you see that these look like complex conjugates. 210 00:09:21,447 --> 00:09:22,780 So this is kind of the math way. 211 00:09:22,780 --> 00:09:24,238 And what you said was the trig way. 212 00:09:24,238 --> 00:09:28,480 I like the trig way much better, the [INAUDIBLE] way, yes. 213 00:09:28,480 --> 00:09:32,320 So complex conjugates, same magnitude done. 214 00:09:32,320 --> 00:09:34,790 So the whole point was just to motivate the idea 215 00:09:34,790 --> 00:09:36,170 of thinking about an all pass. 216 00:09:36,170 --> 00:09:39,094 Why would you build an all pass? 217 00:09:39,094 --> 00:09:40,260 What's an all pass good for? 218 00:09:43,669 --> 00:09:48,260 It's 6.003 exercises, of course. 219 00:09:48,260 --> 00:09:50,185 So an all pass doesn't change the magnitudes. 220 00:09:50,185 --> 00:09:51,484 So what's it good for? 221 00:09:51,484 --> 00:09:52,650 AUDIENCE: Changes the phase. 222 00:09:52,650 --> 00:09:54,066 DENNIS FREEMAN: Changes the phase. 223 00:09:54,066 --> 00:09:55,820 So if you were to think about what's 224 00:09:55,820 --> 00:10:00,530 the phase of the all pass, you get a function 225 00:10:00,530 --> 00:10:03,770 that depends differently. 226 00:10:03,770 --> 00:10:06,500 So you have to compute the angles of these vectors. 227 00:10:06,500 --> 00:10:10,550 So this one-- the angle at the zero starts out at pi. 228 00:10:10,550 --> 00:10:14,690 The angle associated with the pole starts out at zero. 229 00:10:14,690 --> 00:10:18,710 There's actually a minus sign in here, because I took 1 minus z 230 00:10:18,710 --> 00:10:20,786 compared to z minus a. 231 00:10:20,786 --> 00:10:22,160 So I put the z at the two places. 232 00:10:22,160 --> 00:10:25,560 So there's a net minus sign in the whole transfer function. 233 00:10:25,560 --> 00:10:27,050 So the pi cancels out the pi. 234 00:10:27,050 --> 00:10:29,587 So we start at zero at zero. 235 00:10:29,587 --> 00:10:30,920 Everybody know what I just said? 236 00:10:33,860 --> 00:10:38,420 So the angle associated with the zero is pi. 237 00:10:38,420 --> 00:10:44,390 But there's also a negative sign associated with the transfer 238 00:10:44,390 --> 00:10:48,470 function, because we would normally like to write z 239 00:10:48,470 --> 00:10:52,670 minus a 0 divided by z minus a pole. 240 00:10:55,280 --> 00:10:58,070 And I didn't write it that way. 241 00:10:58,070 --> 00:11:01,730 The top one, I wrote backwards. 242 00:11:01,730 --> 00:11:03,790 So there's a net minus sign. 243 00:11:03,790 --> 00:11:05,870 Because of the minus sign, the phase 244 00:11:05,870 --> 00:11:09,230 starts out at zero instead of pi. 245 00:11:09,230 --> 00:11:10,910 That's how that got to be zero. 246 00:11:10,910 --> 00:11:13,520 So this starts out at pi-- 247 00:11:13,520 --> 00:11:14,810 the angle starts out at pi. 248 00:11:14,810 --> 00:11:19,820 It becomes less, and then it goes back to being pi. 249 00:11:19,820 --> 00:11:23,510 But the angle associated with the pole starts at zero 250 00:11:23,510 --> 00:11:25,580 and goes around the pi. 251 00:11:25,580 --> 00:11:28,850 So the net from the pole is a pi shift, 252 00:11:28,850 --> 00:11:33,530 which accounts for why this goes from 0 to minus pi. 253 00:11:33,530 --> 00:11:36,530 You can all do that, right? 254 00:11:36,530 --> 00:11:40,220 So the idea is that the all pass would alter the phase. 255 00:11:40,220 --> 00:11:43,100 And that's one of the things I wanted to talk about. 256 00:11:43,100 --> 00:11:45,440 What's the effect of changing the phase? 257 00:11:45,440 --> 00:11:48,380 And I'll do a demo now, thinking about how it affects audio. 258 00:11:48,380 --> 00:11:49,880 And at the end of the hour, thinking 259 00:11:49,880 --> 00:11:52,040 about how it affects video. 260 00:11:52,040 --> 00:11:56,240 So to think about this, I took this fraction. 261 00:11:56,240 --> 00:12:04,490 And I used a equals 0.95. 262 00:12:04,490 --> 00:12:09,860 And I took a waveform that I generated with Python. 263 00:12:09,860 --> 00:12:12,290 I just added together three tones in the ratio 264 00:12:12,290 --> 00:12:16,370 1, 3, 5 in frequencies, so it sounds like more harmonic. 265 00:12:16,370 --> 00:12:19,520 And when you add those together, you get a sound like this. 266 00:12:19,520 --> 00:12:22,160 [TONES PLAYING] 267 00:12:22,160 --> 00:12:27,200 What you hear is a very dominant tone-- a very dominant pitch, 268 00:12:27,200 --> 00:12:31,730 because I made the harmonics be integer multiples. 269 00:12:31,730 --> 00:12:34,070 So I made the overtones be integer multiples 270 00:12:34,070 --> 00:12:35,750 of the fundamental. 271 00:12:35,750 --> 00:12:38,420 So the fundamental was at 8,440. 272 00:12:38,420 --> 00:12:41,880 And I put in some third harmonic and some fifth harmonic. 273 00:12:41,880 --> 00:12:47,450 So you get something that sounds very constant pitch. 274 00:12:47,450 --> 00:12:51,670 Then I took that waveform and put it through this filter. 275 00:12:51,670 --> 00:12:53,980 And that changes this looking wave form 276 00:12:53,980 --> 00:12:56,000 into that looking waveform. 277 00:12:56,000 --> 00:12:59,550 Those are real waveforms. 278 00:12:59,550 --> 00:13:02,010 And then it changes the sound, so 279 00:13:02,010 --> 00:13:07,620 that instead of sounding like this [TONES PLAYING], 280 00:13:07,620 --> 00:13:12,332 it sounds like [TONES PLAYING]. 281 00:13:12,332 --> 00:13:14,810 [LAUGHTER] 282 00:13:14,810 --> 00:13:18,440 You can all hear the enormous difference, right? 283 00:13:18,440 --> 00:13:22,640 So even with headphones, I can't hear any difference at all. 284 00:13:22,640 --> 00:13:25,190 And that's kind of a property of the way you hear. 285 00:13:25,190 --> 00:13:27,080 You kind of hear-- 286 00:13:27,080 --> 00:13:28,820 I'll say some caveats about this. 287 00:13:28,820 --> 00:13:31,290 This is not exactly true. 288 00:13:31,290 --> 00:13:34,100 So Ohm's law of hearing-- 289 00:13:34,100 --> 00:13:40,100 the same Ohm-- says that you hear sounds by the frequencies 290 00:13:40,100 --> 00:13:42,260 that they contain. 291 00:13:42,260 --> 00:13:44,381 Roughly speaking, you hear sounds 292 00:13:44,381 --> 00:13:46,880 according to the magnitude of the frequencies that you hear. 293 00:13:46,880 --> 00:13:50,120 Now, that's not quite true, but it's sort of true. 294 00:13:50,120 --> 00:13:53,000 So let me do a more complicated example. 295 00:13:53,000 --> 00:13:57,118 So the first sound is a consonant vowel consonant. 296 00:13:57,118 --> 00:13:57,784 [AUDIO PLAYBACK] 297 00:13:57,784 --> 00:13:58,283 - Bat. 298 00:13:58,283 --> 00:13:59,370 [END PLAYBACK] 299 00:13:59,370 --> 00:14:01,870 DENNIS FREEMAN: And then I put it through the same all pass. 300 00:14:01,870 --> 00:14:03,800 So I screw up the phases. 301 00:14:03,800 --> 00:14:06,170 So it goes from looking like this to looking like this 302 00:14:06,170 --> 00:14:07,446 and sounding like-- 303 00:14:07,446 --> 00:14:08,112 [AUDIO PLAYBACK] 304 00:14:08,112 --> 00:14:08,612 - Bat. 305 00:14:08,612 --> 00:14:11,210 [END PLAYBACK] 306 00:14:11,210 --> 00:14:13,687 DENNIS FREEMAN: Hard to hear the difference. 307 00:14:13,687 --> 00:14:15,270 Here's an even more complicated sound. 308 00:14:15,270 --> 00:14:16,550 This is Bob Donovan's thesis. 309 00:14:16,550 --> 00:14:17,216 [AUDIO PLAYBACK] 310 00:14:17,216 --> 00:14:22,002 - [INAUDIBLE] but you see I have no brain. 311 00:14:22,002 --> 00:14:23,961 [END PLAYBACK] 312 00:14:23,961 --> 00:14:26,460 DENNIS FREEMAN: Put that through the all pass, and you get-- 313 00:14:26,460 --> 00:14:27,126 [AUDIO PLAYBACK] 314 00:14:27,126 --> 00:14:31,780 - [INAUDIBLE] for seeking [INAUDIBLE] but you see I have 315 00:14:31,780 --> 00:14:32,280 no brain. 316 00:14:32,280 --> 00:14:33,467 [END PLAYBACK] 317 00:14:33,467 --> 00:14:35,550 DENNIS FREEMAN: If I listen to that on headphones, 318 00:14:35,550 --> 00:14:37,140 I can actually hear a difference. 319 00:14:37,140 --> 00:14:40,380 But I study hearing, and I know what to listen for. 320 00:14:40,380 --> 00:14:42,450 It's still difficult to tell the difference. 321 00:14:42,450 --> 00:14:46,400 Now, that's because I kind of cheated. 322 00:14:46,400 --> 00:14:48,180 To let you know how I cheated, let 323 00:14:48,180 --> 00:14:52,010 me do something more drastic to the phase. 324 00:14:52,010 --> 00:14:56,394 Let me play the waveform backwards. 325 00:14:56,394 --> 00:14:57,060 [AUDIO PLAYBACK] 326 00:14:57,060 --> 00:15:01,947 - [INAUDIBLE] 327 00:15:01,947 --> 00:15:02,530 [END PLAYBACK] 328 00:15:02,530 --> 00:15:05,140 DENNIS FREEMAN: Now, you could probably hear the difference. 329 00:15:05,140 --> 00:15:06,670 [LAUGHTER] 330 00:15:06,670 --> 00:15:10,130 So now, check yourself. 331 00:15:10,130 --> 00:15:12,520 How does the phase of the second signal 332 00:15:12,520 --> 00:15:14,390 compare to the phase of the first signal? 333 00:15:29,620 --> 00:15:32,029 So look at each other so you can blame each other. 334 00:15:32,029 --> 00:15:34,570 If you work on this in solitary, then I'll have to blame you. 335 00:15:39,052 --> 00:15:42,538 [INTERPOSING VOICES] 336 00:16:49,227 --> 00:16:51,060 DENNIS FREEMAN: So it's a phase relationship 337 00:16:51,060 --> 00:16:52,950 between the x signal and the y signal. 338 00:16:55,850 --> 00:17:00,940 If I showed you the Fourier transform for the x signal 339 00:17:00,940 --> 00:17:03,640 and looked at the y signal, which is x of minus n, 340 00:17:03,640 --> 00:17:08,150 how would the two look-- the same or different? 341 00:17:08,150 --> 00:17:09,710 I sort of gave it away. 342 00:17:09,710 --> 00:17:13,369 Flipping in time does what to the magnitude of the Fourier 343 00:17:13,369 --> 00:17:15,530 transform? 344 00:17:15,530 --> 00:17:18,522 Flipping time-- 345 00:17:18,522 --> 00:17:20,144 AUDIENCE: Change the magnitude? 346 00:17:20,144 --> 00:17:22,310 DENNIS FREEMAN: Doesn't change the magnitude at all. 347 00:17:22,310 --> 00:17:24,662 What does it do? 348 00:17:24,662 --> 00:17:26,051 AUDIENCE: The phase. 349 00:17:26,051 --> 00:17:28,349 DENNIS FREEMAN: Flips the sign of the phase. 350 00:17:28,349 --> 00:17:30,020 That's exactly right. 351 00:17:30,020 --> 00:17:33,560 So if you're into math-y these sort of things, 352 00:17:33,560 --> 00:17:36,510 you can think of representing the two as Fourier series-- 353 00:17:36,510 --> 00:17:38,460 the ak's and the bk's. 354 00:17:38,460 --> 00:17:40,590 And if you think about what happens 355 00:17:40,590 --> 00:17:43,740 if you have x of minus n, you can do a change of variable, 356 00:17:43,740 --> 00:17:46,050 make that look like x of n. 357 00:17:46,050 --> 00:17:48,790 Then it looks more like the Fourier series equation, 358 00:17:48,790 --> 00:17:52,260 except that now I lost my minus sign. 359 00:17:52,260 --> 00:17:57,080 So a sub k is the same as b sub minus k. 360 00:17:57,080 --> 00:17:59,450 The effect is to flip the sign of the phase. 361 00:17:59,450 --> 00:18:02,770 Why would that be so much more audible than the other things 362 00:18:02,770 --> 00:18:03,520 that I showed you? 363 00:18:06,740 --> 00:18:09,110 Flipping the sign of a phase, why would that be audible? 364 00:18:13,890 --> 00:18:18,520 What would it mean if I flipped the sign from 68 degrees 365 00:18:18,520 --> 00:18:19,895 to minus 68 degrees? 366 00:18:25,560 --> 00:18:26,531 Not a clue. 367 00:18:26,531 --> 00:18:27,030 Yes. 368 00:18:27,030 --> 00:18:29,880 AUDIENCE: For a total time, it wouldn't change a thing. 369 00:18:29,880 --> 00:18:33,680 But for any sign terms, it would invert that over that. 370 00:18:33,680 --> 00:18:35,950 DENNIS FREEMAN: So it'd invert-- 371 00:18:35,950 --> 00:18:40,700 Let's see, if you went from plus 68 to minus 68-- 372 00:18:40,700 --> 00:18:46,940 so say I had cosine of omega n plus 68 degrees 373 00:18:46,940 --> 00:18:52,470 and cosine omega n minus 68 degrees. 374 00:18:52,470 --> 00:18:56,360 So I change the phase by flipping the sign of it. 375 00:18:56,360 --> 00:18:59,276 How would that change the relationship 376 00:18:59,276 --> 00:19:00,275 between the two signals? 377 00:19:05,750 --> 00:19:08,600 What's phase? 378 00:19:08,600 --> 00:19:10,780 Intuitively, what's phase? 379 00:19:10,780 --> 00:19:11,690 Yeah, it's this way. 380 00:19:11,690 --> 00:19:14,060 It's a time shift. 381 00:19:14,060 --> 00:19:16,244 So the problem with this phase shift 382 00:19:16,244 --> 00:19:18,410 is that you're shifting all the different components 383 00:19:18,410 --> 00:19:21,180 by different amounts of phase. 384 00:19:21,180 --> 00:19:24,470 So you might have a little bit of 68 hertz and 72 hertz 385 00:19:24,470 --> 00:19:27,680 and 3 kilohertz and 512 hertz. 386 00:19:27,680 --> 00:19:30,500 And all of those are getting their phase flipped. 387 00:19:30,500 --> 00:19:32,410 So whatever it came out-- 388 00:19:32,410 --> 00:19:37,380 13, 128, whatever-- it becomes minus that. 389 00:19:37,380 --> 00:19:42,170 All of those phase shifts represent a time shift. 390 00:19:42,170 --> 00:19:45,000 All the components are being shifted in time. 391 00:19:45,000 --> 00:19:47,180 So you're shifting around things, 392 00:19:47,180 --> 00:19:51,140 all the different components, by some amount. 393 00:19:51,140 --> 00:19:53,240 And what your ear is actually very sensitive to 394 00:19:53,240 --> 00:19:54,380 is the low frequencies. 395 00:19:54,380 --> 00:19:56,330 When you shift the low frequencies 396 00:19:56,330 --> 00:19:59,930 by an amount of phase, that's a big time. 397 00:19:59,930 --> 00:20:02,510 So if you think about the fundamental frequency that 398 00:20:02,510 --> 00:20:04,520 started when the utterance began and went 399 00:20:04,520 --> 00:20:08,800 to the end of the utterance, that was like two seconds. 400 00:20:08,800 --> 00:20:10,300 So whatever that phase is, it got 401 00:20:10,300 --> 00:20:13,060 inverted, which is a large fraction of two seconds 402 00:20:13,060 --> 00:20:14,530 probably. 403 00:20:14,530 --> 00:20:16,820 You can easily hear a time-shift of two seconds. 404 00:20:16,820 --> 00:20:17,319 Yeah. 405 00:20:17,319 --> 00:20:20,327 AUDIENCE: Could you notice it, if it was just a pure tone? 406 00:20:20,327 --> 00:20:22,160 DENNIS FREEMAN: If it were just a pure tone, 407 00:20:22,160 --> 00:20:23,796 you would have no clue. 408 00:20:23,796 --> 00:20:27,764 AUDIENCE: Or you can [INAUDIBLE] overtones very simple. 409 00:20:27,764 --> 00:20:32,630 DENNIS FREEMAN: So to make Ohm's law a little more precise, 410 00:20:32,630 --> 00:20:37,640 what your ear really does is it does band pass filters. 411 00:20:37,640 --> 00:20:39,890 If the components fall very close to each other, 412 00:20:39,890 --> 00:20:42,380 you can hear the phase shift. 413 00:20:42,380 --> 00:20:47,730 If the components are far from each other, you can't. 414 00:20:47,730 --> 00:20:52,220 Even the second overtone of a fundamental 415 00:20:52,220 --> 00:20:53,840 is far enough away that you can't 416 00:20:53,840 --> 00:20:55,640 hear the relative phase of it. 417 00:20:55,640 --> 00:20:58,650 The frequency components have to be very close together. 418 00:20:58,650 --> 00:21:02,515 So you can hear phase only in a very particular case when 419 00:21:02,515 --> 00:21:03,890 there's frequency components that 420 00:21:03,890 --> 00:21:06,110 are very close to each other and there's 421 00:21:06,110 --> 00:21:08,690 a relatively big shift in the phase of those two signals. 422 00:21:08,690 --> 00:21:12,780 Except for that, Ohm's law is true. 423 00:21:12,780 --> 00:21:16,820 The point is just that the Fourier series gives us 424 00:21:16,820 --> 00:21:19,790 a way of thinking about a very interesting dimension 425 00:21:19,790 --> 00:21:21,530 of a signal-- 426 00:21:21,530 --> 00:21:24,320 one that separates things that are audible from things 427 00:21:24,320 --> 00:21:25,250 that are not audible. 428 00:21:25,250 --> 00:21:26,960 So when you're doing signal processing, 429 00:21:26,960 --> 00:21:30,050 you can pay less attention to the thing that's not audible. 430 00:21:30,050 --> 00:21:33,500 You can go ahead and distort that, and nobody will know. 431 00:21:33,500 --> 00:21:35,414 But you have to pay close attention 432 00:21:35,414 --> 00:21:36,830 to the things that's very audible, 433 00:21:36,830 --> 00:21:39,050 which is the magnitude. 434 00:21:39,050 --> 00:21:41,600 We'll see at the end of the hour that that situation is 435 00:21:41,600 --> 00:21:43,010 completely flipped for video. 436 00:21:45,860 --> 00:21:48,086 But before we get there-- 437 00:21:48,086 --> 00:21:49,460 so the first thing to think about 438 00:21:49,460 --> 00:21:53,540 was the idea of circular frequency-- 439 00:21:53,540 --> 00:21:56,090 the fact that we're looking at frequency responses living 440 00:21:56,090 --> 00:21:58,950 on the unit circle, rather than on the j omega-axis. 441 00:21:58,950 --> 00:22:01,100 The second big difference with the DT 442 00:22:01,100 --> 00:22:04,310 is the frequencies are cyclic. 443 00:22:04,310 --> 00:22:06,620 So rather than having harmonics go the whole way up 444 00:22:06,620 --> 00:22:10,000 to infinity, as we did in CT-- 445 00:22:10,000 --> 00:22:12,230 In CT, we would have a Fourier series constructed 446 00:22:12,230 --> 00:22:14,120 of the fundamental, the second harmonic, the third harmonic, 447 00:22:14,120 --> 00:22:16,370 the fourth harmonic, the fifth harmonic, the whole way 448 00:22:16,370 --> 00:22:18,710 out to infinity, in principle at least. 449 00:22:18,710 --> 00:22:23,480 In DT, they rap, so that you get a finite number of them. 450 00:22:23,480 --> 00:22:28,760 In fact, if you're taking a sequence of length N, here 451 00:22:28,760 --> 00:22:32,540 illustrated for 8, you get eight possible frequencies, 452 00:22:32,540 --> 00:22:34,400 half of which are negative. 453 00:22:34,400 --> 00:22:36,890 And you don't care about those anyway. 454 00:22:36,890 --> 00:22:42,140 So the number of frequency components for a DT signal 455 00:22:42,140 --> 00:22:43,760 is finite-- 456 00:22:43,760 --> 00:22:46,250 for DT Fourier series. 457 00:22:46,250 --> 00:22:48,990 That has enormous implications. 458 00:22:48,990 --> 00:22:52,100 It means that when you do a Fourier series decomposition, 459 00:22:52,100 --> 00:22:53,570 there's a finite number of terms. 460 00:22:53,570 --> 00:22:57,830 That's enormous, because that means that, if you started out 461 00:22:57,830 --> 00:23:03,260 with a sequence of length cap N, say 1,024, 462 00:23:03,260 --> 00:23:05,330 and you take the Fourier series of it 463 00:23:05,330 --> 00:23:08,450 in order to think about the frequency content, 464 00:23:08,450 --> 00:23:12,710 you can replace the 1,024 numbers in time 465 00:23:12,710 --> 00:23:15,340 with 1,024 numbers in frequency. 466 00:23:15,340 --> 00:23:18,740 There's no-- well, no is exaggeration. 467 00:23:18,740 --> 00:23:23,270 There is a factor of two kind of explosion of data, 468 00:23:23,270 --> 00:23:30,230 because I went from N real-valued signals, samples, 469 00:23:30,230 --> 00:23:34,920 to N complex-valued signals. 470 00:23:34,920 --> 00:23:37,950 That's not quite true either, because of the reasons 471 00:23:37,950 --> 00:23:39,630 about how information works. 472 00:23:39,630 --> 00:23:43,260 The-- how do I want to say it? 473 00:23:43,260 --> 00:23:47,130 The resolution that you need for the frequency domain 474 00:23:47,130 --> 00:23:49,730 representation is actually slightly smaller. 475 00:23:49,730 --> 00:23:53,864 To a first order, you're replacing [? N ?] with [? n ?] 476 00:23:53,864 --> 00:23:55,280 That's really good, because if you 477 00:23:55,280 --> 00:23:57,530 think about the alternative in CT, 478 00:23:57,530 --> 00:24:00,987 you would be replacing a signal with an infinite number. 479 00:24:00,987 --> 00:24:02,570 And that's just not reasonable, if you 480 00:24:02,570 --> 00:24:04,520 want to think about processing signals 481 00:24:04,520 --> 00:24:05,720 with digital electronics. 482 00:24:05,720 --> 00:24:07,261 There's no way that you could process 483 00:24:07,261 --> 00:24:10,230 an infinite number of signals in a finite amount of time. 484 00:24:10,230 --> 00:24:14,180 So the fact that you're replacing n samples in time 485 00:24:14,180 --> 00:24:17,630 with n samples in frequency really lends itself 486 00:24:17,630 --> 00:24:22,410 to doing signal processing using digital techniques. 487 00:24:22,410 --> 00:24:24,410 Now, the problem is-- 488 00:24:24,410 --> 00:24:27,622 and just one way of thinking about the finite length 489 00:24:27,622 --> 00:24:29,330 is that you can think about it by matrix. 490 00:24:29,330 --> 00:24:31,770 That's just a mnemonic that helps me a lot, 491 00:24:31,770 --> 00:24:34,040 to think about how, if I have a four-length sequence, 492 00:24:34,040 --> 00:24:35,660 you go through some matrix. 493 00:24:35,660 --> 00:24:38,570 And what comes out is a four-length frequency response. 494 00:24:38,570 --> 00:24:40,340 You have some eight-length sequence, 495 00:24:40,340 --> 00:24:41,540 you go through some matrix. 496 00:24:41,540 --> 00:24:45,560 And then comes out some eight-length frequency 497 00:24:45,560 --> 00:24:47,236 representation. 498 00:24:47,236 --> 00:24:48,860 And there's actually a lot of intuition 499 00:24:48,860 --> 00:24:51,950 that you can draw in making the parallels between matrix 500 00:24:51,950 --> 00:24:55,677 representations and the Fourier representation, 501 00:24:55,677 --> 00:24:58,010 because it is a transformation, a linear transformation, 502 00:24:58,010 --> 00:25:00,800 just like the matrix implies. 503 00:25:00,800 --> 00:25:06,710 There is one problem with that finite representation idea. 504 00:25:06,710 --> 00:25:10,790 And that is that it scales poorly. 505 00:25:10,790 --> 00:25:16,340 If you think about having a two-length sequence, 506 00:25:16,340 --> 00:25:18,710 the two-length sequence has a two-length representation 507 00:25:18,710 --> 00:25:22,990 in frequency via the Fourier series. 508 00:25:22,990 --> 00:25:26,970 And that representation has how many coefficients? 509 00:25:26,970 --> 00:25:29,190 Four-- two and two. 510 00:25:29,190 --> 00:25:35,770 Now, if I do of four, I get four, how many coefficients? 511 00:25:35,770 --> 00:25:37,810 4 by 4 is 16. 512 00:25:37,810 --> 00:25:39,340 Now, some of these are 1's. 513 00:25:39,340 --> 00:25:42,490 Right So all of these are 1's. 514 00:25:42,490 --> 00:25:44,800 As you make the sequence bigger and bigger and bigger, 515 00:25:44,800 --> 00:25:47,380 however, the number of trivial entries 516 00:25:47,380 --> 00:25:51,040 gets smaller and smaller and smaller relative. 517 00:25:51,040 --> 00:25:55,870 So as you go from a two-length sequence 518 00:25:55,870 --> 00:25:59,290 to a four-length sequence to an eight-length sequence, 519 00:25:59,290 --> 00:26:03,820 now we're up to 64 multiplies in order 520 00:26:03,820 --> 00:26:05,710 to convert a time-domain representation 521 00:26:05,710 --> 00:26:07,932 into a frequency-domain representation. 522 00:26:07,932 --> 00:26:10,390 Well, that's bad, because the kinds of things we want to do 523 00:26:10,390 --> 00:26:12,720 are not two and four and eight. 524 00:26:12,720 --> 00:26:14,620 The kinds of things we want to do 525 00:26:14,620 --> 00:26:16,350 are manipulations on signals of 10 526 00:26:16,350 --> 00:26:20,500 to the sixth, 10 to the eighth, 10 to the 12th. 527 00:26:20,500 --> 00:26:24,250 For my doctoral thesis, I did some fluid dynamic problems, 528 00:26:24,250 --> 00:26:29,290 where the calculations had 10 to the sixth unknowns. 529 00:26:29,290 --> 00:26:32,320 And I used frequency domain techniques, 530 00:26:32,320 --> 00:26:35,040 which I was able to implement with things that I'll 531 00:26:35,040 --> 00:26:36,460 talk about in a minute. 532 00:26:36,460 --> 00:26:40,260 If we had used this scaling by the square, 533 00:26:40,260 --> 00:26:41,680 it just wouldn't have worked. 534 00:26:41,680 --> 00:26:43,180 If you have 10 to the sixth unknowns 535 00:26:43,180 --> 00:26:44,320 and if you're using a method that 536 00:26:44,320 --> 00:26:46,960 converts from one representation to another that involves 10 537 00:26:46,960 --> 00:26:51,950 to the 12th operations, that's just not a good idea. 538 00:26:51,950 --> 00:26:54,580 So that's bad. 539 00:26:54,580 --> 00:26:59,605 So by the theory of lectures, what I'm about to tell you is-- 540 00:26:59,605 --> 00:27:01,430 AUDIENCE: [INAUDIBLE]. 541 00:27:01,430 --> 00:27:05,327 DENNIS FREEMAN: There's is a great way to fix this. 542 00:27:05,327 --> 00:27:06,910 If there weren't, I wouldn't tell you. 543 00:27:06,910 --> 00:27:08,840 I wouldn't pose the problem. 544 00:27:08,840 --> 00:27:12,520 So the question is how to think about this scaling 545 00:27:12,520 --> 00:27:15,250 in order to not have the number of calculations 546 00:27:15,250 --> 00:27:19,030 that you need to do blow up with N square. 547 00:27:19,030 --> 00:27:22,510 So in order to motivate this, I've 548 00:27:22,510 --> 00:27:27,850 used a funny notation, where the W represents 549 00:27:27,850 --> 00:27:32,100 the N-th primary root of 1. 550 00:27:32,100 --> 00:27:33,910 That just saves me from writing out e 551 00:27:33,910 --> 00:27:38,660 to the j 2 pi over N 64 times, which when I did it, 552 00:27:38,660 --> 00:27:41,080 it didn't fit on one slide. 553 00:27:41,080 --> 00:27:43,960 I had to compress it too much, and you couldn't see it. 554 00:27:43,960 --> 00:27:48,820 So just to save space, every time I say W8,0, 555 00:27:48,820 --> 00:27:55,920 all I mean is compute the eighth root of 1 and then raise it 556 00:27:55,920 --> 00:27:57,960 to the 0-th power. 557 00:27:57,960 --> 00:28:00,960 Compute the eighth root of 1 and then raise it 558 00:28:00,960 --> 00:28:01,950 to the seventh power. 559 00:28:01,950 --> 00:28:04,530 That's all that means. 560 00:28:04,530 --> 00:28:06,360 So the idea is, is there a way that we 561 00:28:06,360 --> 00:28:09,840 can think about the structure of this matrix more simply? 562 00:28:09,840 --> 00:28:13,610 And in particular, is there a way to use divide and conquer? 563 00:28:13,610 --> 00:28:15,990 That's our best algorithm. 564 00:28:15,990 --> 00:28:21,540 It would be great if we could take the eight-point sequence 565 00:28:21,540 --> 00:28:25,740 and substitute in its place finding the frequency 566 00:28:25,740 --> 00:28:32,700 representations for two four-point sequences. 567 00:28:32,700 --> 00:28:35,590 And by the theory of lecture's, that's what I'm about to do. 568 00:28:35,590 --> 00:28:38,220 So the idea is, what if I just simply took 569 00:28:38,220 --> 00:28:41,970 the even entries in this more complicated problem-- 570 00:28:41,970 --> 00:28:45,300 so I have eight entries, none of which are necessarily 0. 571 00:28:45,300 --> 00:28:47,160 So I have x0 through x7. 572 00:28:47,160 --> 00:28:50,190 And I want to find the frequency representation c0 through c7. 573 00:28:52,710 --> 00:28:56,430 What if I just did the evens and the odds separately? 574 00:28:56,430 --> 00:28:57,870 That'd be great. 575 00:28:57,870 --> 00:29:00,120 In order to do eight in one fell swoop, 576 00:29:00,120 --> 00:29:01,890 I need 64 multiplications. 577 00:29:01,890 --> 00:29:05,370 In order to do each of these problems, I have 16 for each. 578 00:29:05,370 --> 00:29:08,830 That's only 32, I have a big win. 579 00:29:08,830 --> 00:29:12,570 But now, I'm left with, is there a way to relate these things-- 580 00:29:12,570 --> 00:29:18,750 these ak's and bk's back to the original ck? 581 00:29:18,750 --> 00:29:21,510 So the idea then is, how would you 582 00:29:21,510 --> 00:29:25,560 think about the contribution of the evens, 583 00:29:25,560 --> 00:29:30,660 as opposed to the odds in the overall calculation? 584 00:29:30,660 --> 00:29:40,429 So think about the even-numbered entries in the signal, 585 00:29:40,429 --> 00:29:41,970 think about the transformation if you 586 00:29:41,970 --> 00:29:44,280 were to do a frequency representation for that 587 00:29:44,280 --> 00:29:49,230 via the Fourier series, so that you get a0 through a3. 588 00:29:49,230 --> 00:29:51,180 The first thing you see is that these numbers 589 00:29:51,180 --> 00:29:53,910 have W sub 4, the fourth root. 590 00:29:53,910 --> 00:29:57,720 I need W sub 8, the eighth root. 591 00:29:57,720 --> 00:29:59,430 But there's a simple identity. 592 00:29:59,430 --> 00:30:02,040 If I know the eighth root, I can just 593 00:30:02,040 --> 00:30:04,680 square it to get the fourth root. 594 00:30:04,680 --> 00:30:06,480 So I can rewrite the fourth root guys 595 00:30:06,480 --> 00:30:10,710 in terms of equivalent eighth root guys. 596 00:30:10,710 --> 00:30:11,700 That was trivial. 597 00:30:11,700 --> 00:30:15,690 Nod your head, completely trivial. 598 00:30:15,690 --> 00:30:18,240 And then I can say, well, OK here's my problem 599 00:30:18,240 --> 00:30:19,967 that I would like to solve. 600 00:30:19,967 --> 00:30:22,050 What if I was only thinking about the contribution 601 00:30:22,050 --> 00:30:24,960 of the evens? 602 00:30:24,960 --> 00:30:28,020 If I'm only worried about the contributions of the evens, 603 00:30:28,020 --> 00:30:30,240 then I don't need to worry about some of the columns, 604 00:30:30,240 --> 00:30:33,360 because they don't contribute to the evens. 605 00:30:33,360 --> 00:30:36,090 That's worth thinking about things in terms of the matrix 606 00:30:36,090 --> 00:30:37,000 helps us. 607 00:30:37,000 --> 00:30:41,037 We can visualize operations as operations on a matrix. 608 00:30:41,037 --> 00:30:42,870 So now, if I'm only worried about the evens, 609 00:30:42,870 --> 00:30:46,110 I only need to worry about four of these columns. 610 00:30:46,110 --> 00:30:51,960 And if I squint at this, I can see that W8,0 0, 0 0, 611 00:30:51,960 --> 00:30:55,440 that's the same row as up here. 612 00:30:55,440 --> 00:30:58,160 So this is the same as that. 613 00:31:01,490 --> 00:31:03,330 And this one, W8-- 614 00:31:03,330 --> 00:31:05,690 so those are all W8's, I don't even to say that-- 615 00:31:05,690 --> 00:31:11,960 0, 2, 4, 6; 0, 2, 4, 6; 0, 4, 0, 4; 0, 4, 0, 4. 616 00:31:11,960 --> 00:31:15,440 These numbers are just the eight coefficients. 617 00:31:15,440 --> 00:31:17,222 Furthermore, it repeats. 618 00:31:17,222 --> 00:31:20,260 0, 0, 0, 0 is the same as 0, 0, 0, 0. 619 00:31:20,260 --> 00:31:23,210 So that's 8,0, and that's 8,0. 620 00:31:23,210 --> 00:31:25,500 What I just found was that the way the evens effect 621 00:31:25,500 --> 00:31:31,700 the answer is precisely by taking their Fourier 622 00:31:31,700 --> 00:31:34,859 representation and repeating it twice in time. 623 00:31:34,859 --> 00:31:35,900 Well, that's pretty cute. 624 00:31:38,840 --> 00:31:43,550 So therefore, the contribution of the four-length sequences 625 00:31:43,550 --> 00:31:46,910 to the eight-length sequences is showed this way. 626 00:31:46,910 --> 00:31:50,390 Stack up the frequency representations for the four, 627 00:31:50,390 --> 00:31:53,720 and that is their contribution to the eight. 628 00:31:53,720 --> 00:31:57,200 The same sort of thing happens when I do the odds. 629 00:31:57,200 --> 00:32:00,470 Now, if I only look at the odds, I 630 00:32:00,470 --> 00:32:04,010 throw away a different set of four columns. 631 00:32:04,010 --> 00:32:06,110 And now, if I try to compare that 632 00:32:06,110 --> 00:32:10,380 to what I have up here for the odds, 633 00:32:10,380 --> 00:32:12,300 I don't quite get something as easy. 634 00:32:12,300 --> 00:32:16,020 So if I look down this column, they should have all been 0. 635 00:32:16,020 --> 00:32:22,474 But if I look down this column, it's 0, 1, 2, 3, 4, 5, 6, 7. 636 00:32:22,474 --> 00:32:23,640 If I look down this column-- 637 00:32:23,640 --> 00:32:26,460 0, 2, 4; 0, 3, 6-- 638 00:32:26,460 --> 00:32:29,910 I'm not quite getting the right answers. 639 00:32:29,910 --> 00:32:36,960 But it turns out that, if I simply factor this number out, 640 00:32:36,960 --> 00:32:38,867 so that I make the first coefficient right, 641 00:32:38,867 --> 00:32:40,700 all of the other coefficients are right too. 642 00:32:44,070 --> 00:32:49,220 So I got an easy rule now for how the Fourier coefficients 643 00:32:49,220 --> 00:32:53,460 for the odds contribute to the answer 644 00:32:53,460 --> 00:32:55,800 for the eight-length sequence. 645 00:32:55,800 --> 00:33:00,200 And now, all I need to do is glue those two together. 646 00:33:00,200 --> 00:33:04,450 So the way I can calculate the eight-length sequence 647 00:33:04,450 --> 00:33:12,890 is to calculate the a's and b's from four-length sequences 648 00:33:12,890 --> 00:33:16,190 and then paste them together this way. 649 00:33:16,190 --> 00:33:19,230 And I'll get the eight-length answer. 650 00:33:19,230 --> 00:33:23,570 Now, pasting them together takes some multiplies. 651 00:33:23,570 --> 00:33:28,400 So it took me 16 to compute the a0 to a3. 652 00:33:28,400 --> 00:33:34,540 It took me 16 multiplies to figure out b0 to b3. 653 00:33:34,540 --> 00:33:36,660 So I'm up to 32. 654 00:33:36,660 --> 00:33:43,740 Then I have to do eight more to make the b's look right. 655 00:33:43,740 --> 00:33:47,940 So if I just count multiplies, I'm now doing 40. 656 00:33:47,940 --> 00:33:51,750 But that's a win, because that's compared to 64. 657 00:33:51,750 --> 00:33:54,000 And I get precisely the same answer. 658 00:33:54,000 --> 00:33:56,850 That algorithm-- that's an algorithm; 659 00:33:56,850 --> 00:33:59,849 that's a rule-based system for how you take one set of eight 660 00:33:59,849 --> 00:34:01,890 numbers and turn it into a different set of eight 661 00:34:01,890 --> 00:34:05,760 numbers-- that algorithm is called the FFT, the Fast 662 00:34:05,760 --> 00:34:07,050 Fourier Transform. 663 00:34:07,050 --> 00:34:11,500 That's mostly to confuse you, because it's not a transform, 664 00:34:11,500 --> 00:34:13,482 but it is fast. 665 00:34:13,482 --> 00:34:16,485 So it's really a fast Fourier series. 666 00:34:16,485 --> 00:34:18,610 And in fact, the guys who figured it out knew that. 667 00:34:18,610 --> 00:34:21,290 And I don't know why we insist on trying to confuse you. 668 00:34:21,290 --> 00:34:23,090 That's perhaps our job. 669 00:34:23,090 --> 00:34:25,650 But the FFT, fast Fourier transform, 670 00:34:25,650 --> 00:34:28,350 is really the fast Fourier series. 671 00:34:28,350 --> 00:34:32,580 And the idea is that it's a divide and conquer thing. 672 00:34:32,580 --> 00:34:34,424 So if you think about extending it-- 673 00:34:34,424 --> 00:34:36,840 So I motivated it by thinking about how to calculate the 8 674 00:34:36,840 --> 00:34:40,190 by 8 from two 4 by 4's. 675 00:34:40,190 --> 00:34:42,480 But let's start from 0 and say, let's 676 00:34:42,480 --> 00:34:44,639 like capital M represent however multiplies 677 00:34:44,639 --> 00:34:48,989 it took to get an endpoint FFT. 678 00:34:48,989 --> 00:34:53,639 How many multiplies does it take to do a 1-point FFT? 679 00:34:53,639 --> 00:34:56,025 If my signal is periodic in 1-- 680 00:35:00,340 --> 00:35:03,760 so what's the relationship between the series 681 00:35:03,760 --> 00:35:08,230 representation and the time representation if the length is 682 00:35:08,230 --> 00:35:09,550 capital N equals 1? 683 00:35:12,650 --> 00:35:15,710 The relationship is identity. 684 00:35:15,710 --> 00:35:20,480 If my sequence was 17, 17, 17, 17, 17, 17, 17, 17, 17, 685 00:35:20,480 --> 00:35:26,570 17, which is a sequence that has a period of 1, 686 00:35:26,570 --> 00:35:31,520 then the series representation is 17, 17, 17, 17-- not 687 00:35:31,520 --> 00:35:32,660 all that surprising. 688 00:35:32,660 --> 00:35:37,280 So it takes exactly 0 multiplies to calculate that one. 689 00:35:37,280 --> 00:35:41,810 How many multiplies does it take to calculate a length 2? 690 00:35:41,810 --> 00:35:45,210 Well, you do two length 1 problems. 691 00:35:45,210 --> 00:35:46,770 And then because it's length 2, you 692 00:35:46,770 --> 00:35:50,690 have to do those two extra multiplies. 693 00:35:50,690 --> 00:35:53,147 Then take a length 2 and turn it into a 4, 694 00:35:53,147 --> 00:35:54,230 how many multiplies for 4? 695 00:35:54,230 --> 00:35:56,510 Well, you have to do two length 2, 696 00:35:56,510 --> 00:36:02,560 but now it's length 4, so there's 4 gluing multiplies. 697 00:36:02,560 --> 00:36:05,630 To do 32, you have to do two length 16. 698 00:36:05,630 --> 00:36:07,850 And then there's 32 gluing. 699 00:36:07,850 --> 00:36:14,510 When you're all done, it takes eight N times log N. 700 00:36:14,510 --> 00:36:16,080 And the point is that N times log 701 00:36:16,080 --> 00:36:19,830 N can be a lot smaller than N squared. 702 00:36:22,586 --> 00:36:24,460 So let's go back to the motivational example. 703 00:36:24,460 --> 00:36:32,110 The idea was, what if I had about 10 to the sixth unknowns? 704 00:36:32,110 --> 00:36:36,359 So that's about 2 to the 20th? 705 00:36:36,359 --> 00:36:37,150 Yeah, that's right. 706 00:36:37,150 --> 00:36:40,120 So 2 to the 10th is 10 cubed roughly. 707 00:36:40,120 --> 00:36:43,880 1,024 is 1,000 in CS terms. 708 00:36:43,880 --> 00:36:46,190 So I have about 2 to the 20th. 709 00:36:46,190 --> 00:36:50,470 So what would be the savings if I did the FFT rather 710 00:36:50,470 --> 00:36:52,510 than the direct form N squared? 711 00:36:55,968 --> 00:37:02,610 AUDIENCE: That would be 2 to the 20th divided by [INAUDIBLE]. 712 00:37:02,610 --> 00:37:06,110 DENNIS FREEMAN: So I need to take 2 to 20th times 2 713 00:37:06,110 --> 00:37:09,560 to the 20th would be the N squared algorithm. 714 00:37:09,560 --> 00:37:12,316 And the other algorithm would be 2 to the 20th-- 715 00:37:12,316 --> 00:37:13,534 AUDIENCE: By 20. 716 00:37:13,534 --> 00:37:15,609 DENNIS FREEMAN: --divided by 20. 717 00:37:15,609 --> 00:37:17,400 It's enormous difference, that's the point. 718 00:37:20,040 --> 00:37:23,540 So just a little bit of historic context. 719 00:37:23,540 --> 00:37:29,160 That algorithm has been repeatedly invented in time. 720 00:37:29,160 --> 00:37:31,410 So we usually cite Cooley and Tukey. 721 00:37:31,410 --> 00:37:33,540 They wrote a classic paper in 1965. 722 00:37:33,540 --> 00:37:38,100 The title of their paper was "An Algorithm 723 00:37:38,100 --> 00:37:40,990 for the Machine Calculation of Complex Fourier Series." 724 00:37:40,990 --> 00:37:43,060 They knew it was series. 725 00:37:43,060 --> 00:37:44,290 That was 1965. 726 00:37:44,290 --> 00:37:47,640 That was when computers were starting to get big. 727 00:37:47,640 --> 00:37:51,060 They actually went on and solved some very interesting problems, 728 00:37:51,060 --> 00:37:52,080 including neuroscience. 729 00:37:52,080 --> 00:37:55,230 They were the first people who solved Hodgkin-Huxley's model 730 00:37:55,230 --> 00:37:56,700 for a propagated action potential 731 00:37:56,700 --> 00:37:59,160 and showed that the equations that Hodgkin and Huxley had 732 00:37:59,160 --> 00:38:01,690 found for biology actually work. 733 00:38:01,690 --> 00:38:03,350 So that was 1965. 734 00:38:03,350 --> 00:38:08,730 However, before them in 1942, Danielson and Lanczos 735 00:38:08,730 --> 00:38:11,040 had independently discovered it. 736 00:38:11,040 --> 00:38:14,040 In 1903, Runge had discovered it. 737 00:38:14,040 --> 00:38:21,600 And, in 1805, Gauss described it. 738 00:38:21,600 --> 00:38:23,160 Now, there's a good reason why all 739 00:38:23,160 --> 00:38:26,330 these brilliant scientists-- 740 00:38:26,330 --> 00:38:30,210 so Gauss noted it and even used it, 741 00:38:30,210 --> 00:38:32,400 but he commented on how useless it was. 742 00:38:35,060 --> 00:38:36,690 Why would Gauss think it was useless? 743 00:38:36,690 --> 00:38:37,953 He was kind of smart. 744 00:38:37,953 --> 00:38:40,780 AUDIENCE: Was Fourier alive then? 745 00:38:40,780 --> 00:38:42,840 DENNIS FREEMAN: So Gauss actually died 746 00:38:42,840 --> 00:38:44,780 before he published this. 747 00:38:44,780 --> 00:38:47,670 But it got published posthumously 748 00:38:47,670 --> 00:38:50,130 before Fourier started to work. 749 00:38:50,130 --> 00:38:52,966 So this came before Fourier. 750 00:38:52,966 --> 00:38:54,442 AUDIENCE: [INAUDIBLE]. 751 00:38:54,442 --> 00:38:57,890 DENNIS FREEMAN: So why did Gauss think this was useless? 752 00:38:57,890 --> 00:39:00,070 And that's 1805. 753 00:39:00,070 --> 00:39:02,650 And now, we come around to 1965, and Cooley and Tukey 754 00:39:02,650 --> 00:39:03,940 make this huge deal. 755 00:39:03,940 --> 00:39:06,720 And they're world-famous because of their rediscovery 756 00:39:06,720 --> 00:39:09,103 of something that Gauss knew in 1905. 757 00:39:09,103 --> 00:39:11,518 AUDIENCE: I mean, you're not going 758 00:39:11,518 --> 00:39:16,348 to be doing anything that's like 128 by 128 by hand anyway. 759 00:39:16,348 --> 00:39:18,650 DENNIS FREEMAN: That's exactly right. 760 00:39:18,650 --> 00:39:22,300 So when Gauss was thinking about it, he was thinking about 16 761 00:39:22,300 --> 00:39:24,550 by 16. 762 00:39:24,550 --> 00:39:28,360 And so, yeah, you save two, big deal. 763 00:39:28,360 --> 00:39:32,620 He was much more actually impressed with logarithms, 764 00:39:32,620 --> 00:39:36,490 because he was doing the multiplies by hand. 765 00:39:36,490 --> 00:39:39,020 And the log made it much easier to do multiplies, 766 00:39:39,020 --> 00:39:41,260 because you could substitute addition. 767 00:39:41,260 --> 00:39:45,280 So he actually commented on how useful logarithms are. 768 00:39:45,280 --> 00:39:47,590 And he didn't comment on how useful this is. 769 00:39:47,590 --> 00:39:50,800 But now, we make a big deal in the other order. 770 00:39:50,800 --> 00:39:53,110 And it's entirely digital computation. 771 00:39:53,110 --> 00:39:56,493 So when we solve systems of 10 to the sixth or 10 772 00:39:56,493 --> 00:39:59,860 to the 10th unknowns, this is an enormous deal. 773 00:39:59,860 --> 00:40:01,300 And logarithms are good too. 774 00:40:01,300 --> 00:40:01,800 [LAUGHTER] 775 00:40:01,800 --> 00:40:04,090 But this is an enormous deal. 776 00:40:06,640 --> 00:40:10,750 So one more piece of theory and then one more ending thing. 777 00:40:10,750 --> 00:40:13,960 The piece of theory is going from periodic signals 778 00:40:13,960 --> 00:40:15,670 to aperiodic. 779 00:40:15,670 --> 00:40:18,530 And not surprisingly, that works just the way it did in CT. 780 00:40:18,530 --> 00:40:20,920 In fact, there's nothing new here. 781 00:40:20,920 --> 00:40:26,830 We can think about how would you make a Fourier transform 782 00:40:26,830 --> 00:40:28,150 compared to a Fourier series. 783 00:40:28,150 --> 00:40:32,080 With the CT, we developed the theory for series first, 784 00:40:32,080 --> 00:40:33,460 because it was easier. 785 00:40:33,460 --> 00:40:36,700 And then we derived the theory for aperiodic signals. 786 00:40:36,700 --> 00:40:39,160 By something called periodic extension, 787 00:40:39,160 --> 00:40:42,370 we took an aperiodic signal, like this CT signal, 788 00:40:42,370 --> 00:40:46,690 made it periodic, like that DT signal, 789 00:40:46,690 --> 00:40:50,680 and then took the limit as the period goes to infinity. 790 00:40:50,680 --> 00:40:52,930 Had we stayed in time domain the whole time, 791 00:40:52,930 --> 00:40:55,450 that would be a trivial no-op. 792 00:40:55,450 --> 00:40:59,290 But the trick was that after we did the periodic extension, 793 00:40:59,290 --> 00:41:03,580 we then took the series of this and then passed 794 00:41:03,580 --> 00:41:06,550 the limit onto the series. 795 00:41:06,550 --> 00:41:07,420 So that's the trick. 796 00:41:07,420 --> 00:41:12,130 So we think about generalizing the aperiodic into periodic. 797 00:41:12,130 --> 00:41:13,300 Then we take the series. 798 00:41:13,300 --> 00:41:14,680 Then we pass the limit. 799 00:41:14,680 --> 00:41:16,480 And we ask whether the series converges. 800 00:41:16,480 --> 00:41:20,200 And just like CT, the answer for DT will converge. 801 00:41:20,200 --> 00:41:23,110 So you start with a periodic signal. 802 00:41:23,110 --> 00:41:26,800 You write out the DT Fourier series 803 00:41:26,800 --> 00:41:29,680 just as we've been doing. 804 00:41:29,680 --> 00:41:33,010 And you get an answer that for this square pulse looks 805 00:41:33,010 --> 00:41:35,440 very much like the answer we got before. 806 00:41:35,440 --> 00:41:37,780 The tricky thing that I've done here 807 00:41:37,780 --> 00:41:42,220 is I've written this series on two axes, just like CT-- 808 00:41:42,220 --> 00:41:45,280 a k-axis, which is the harmonic number, 809 00:41:45,280 --> 00:41:48,730 and an omega-axis, which is the frequency. 810 00:41:48,730 --> 00:41:51,010 The frequency represents the position 811 00:41:51,010 --> 00:41:52,580 around the unit circle. 812 00:41:52,580 --> 00:41:58,550 So capital omega is the angle of the unit circle. 813 00:41:58,550 --> 00:42:02,590 Then if I change the period, the effect 814 00:42:02,590 --> 00:42:08,440 of making the period bigger is to put the harmonics closer. 815 00:42:08,440 --> 00:42:11,590 But in a magical way, because the envelope-- 816 00:42:11,590 --> 00:42:13,600 the thing showed by the thin black line-- 817 00:42:13,600 --> 00:42:17,410 doesn't change as I take the limit, 818 00:42:17,410 --> 00:42:20,050 that's what enables me to think about there being a limit. 819 00:42:23,380 --> 00:42:26,080 As you make the period bigger and bigger, 820 00:42:26,080 --> 00:42:29,440 you get more and more lines in an envelope 821 00:42:29,440 --> 00:42:31,360 that doesn't change. 822 00:42:31,360 --> 00:42:34,330 And then you can think about the envelope 823 00:42:34,330 --> 00:42:37,930 as being a function of the continuous variable omega, 824 00:42:37,930 --> 00:42:41,344 rather than the discrete variable k. 825 00:42:41,344 --> 00:42:42,760 And then you can think about, what 826 00:42:42,760 --> 00:42:45,130 would happen if you pass the limit? 827 00:42:45,130 --> 00:42:50,410 And the idea is that, if you do the synthesis equation, 828 00:42:50,410 --> 00:42:53,980 there's an ak that depends on 1/n, 829 00:42:53,980 --> 00:42:57,830 which you can write in terms of the fundamental frequency omega 830 00:42:57,830 --> 00:43:00,280 0. 831 00:43:00,280 --> 00:43:02,770 And then as you pass the limit, omega 0 832 00:43:02,770 --> 00:43:06,260 is the spacing between these harmonics. 833 00:43:06,260 --> 00:43:07,780 So if you multiply by the spacing, 834 00:43:07,780 --> 00:43:10,910 you get the area of that block. 835 00:43:10,910 --> 00:43:14,440 So the area associated with N equals 0 is this area. 836 00:43:14,440 --> 00:43:15,820 The area associated with N equals 837 00:43:15,820 --> 00:43:19,510 1 is that one, N equals 2, N equals 3, et cetera. 838 00:43:19,510 --> 00:43:24,370 And so by doing the sum, the sum increasingly 839 00:43:24,370 --> 00:43:27,190 converges to the integral. 840 00:43:27,190 --> 00:43:29,200 So you get precisely the same kinds 841 00:43:29,200 --> 00:43:31,630 of formulas we've been using before. 842 00:43:31,630 --> 00:43:33,700 The one thing that's a little bit weird, 843 00:43:33,700 --> 00:43:39,490 in the DT Fourier series, we had a sum in the synthesis equation 844 00:43:39,490 --> 00:43:41,800 as a sum in the analysis equation. 845 00:43:41,800 --> 00:43:44,710 Here, we get one of both. 846 00:43:44,710 --> 00:43:50,050 The DT Fourier transform-- that's this thing-- 847 00:43:50,050 --> 00:43:54,430 is a function of the continuous variable-- uh-- 848 00:43:54,430 --> 00:43:58,360 discrete-time Fourier transform has a continuous frequency 849 00:43:58,360 --> 00:44:00,940 variable capital omega. 850 00:44:00,940 --> 00:44:03,190 Because it has a continuous-- even though 851 00:44:03,190 --> 00:44:05,370 it's a discrete-time Fourier transform-- 852 00:44:05,370 --> 00:44:08,260 discrete-time Fourier transform has a continuous frequency 853 00:44:08,260 --> 00:44:09,800 variable cap omega. 854 00:44:09,800 --> 00:44:15,030 So when we do the synthesis, we have to integrate. 855 00:44:15,030 --> 00:44:17,032 So one direction is a sum, the other direction 856 00:44:17,032 --> 00:44:17,740 it's an integral. 857 00:44:17,740 --> 00:44:20,490 Other than that, it's just the same. 858 00:44:20,490 --> 00:44:22,560 So there's a striking parallel. 859 00:44:22,560 --> 00:44:24,870 All of these things are highly related. 860 00:44:24,870 --> 00:44:27,120 The CT Fourier transforms are highly related 861 00:44:27,120 --> 00:44:30,240 to the CT Fourier series, as is the CT 862 00:44:30,240 --> 00:44:31,427 transform to the CT series. 863 00:44:31,427 --> 00:44:32,760 And there's lots of connections. 864 00:44:32,760 --> 00:44:34,920 And we'll talk about that more next week-- 865 00:44:34,920 --> 00:44:38,340 how you can infer how one of these transform relationships 866 00:44:38,340 --> 00:44:42,450 would have worked from all of the others. 867 00:44:42,450 --> 00:44:44,100 For the time being, the important thing 868 00:44:44,100 --> 00:44:49,890 is just that, when you do the DT Fourier transform, 869 00:44:49,890 --> 00:44:53,400 you can think about that just like the CT Fourier transform. 870 00:44:53,400 --> 00:44:57,330 The CT Fourier transform was evaluate the Laplace transform 871 00:44:57,330 --> 00:44:58,810 on the j omega-axis. 872 00:44:58,810 --> 00:45:02,400 Now, you evaluate the z-transform on the unit circle. 873 00:45:02,400 --> 00:45:03,990 The unit circle is no surprise. 874 00:45:03,990 --> 00:45:06,690 That's what we've been doing. 875 00:45:06,690 --> 00:45:11,250 Because of the relationship between the DT Fourier 876 00:45:11,250 --> 00:45:18,900 transform and the z-transform, the DT Fourier transform 877 00:45:18,900 --> 00:45:23,460 inherits all the nice properties of the z-transform. 878 00:45:23,460 --> 00:45:27,030 We'll make a bigger deal of that in the upcoming two weeks. 879 00:45:27,030 --> 00:45:30,120 In fact, that's the next two weeks of this course, 880 00:45:30,120 --> 00:45:31,530 is to figure out the implications 881 00:45:31,530 --> 00:45:35,170 of all of those properties. 882 00:45:35,170 --> 00:45:37,140 But for today, what I want to just close with 883 00:45:37,140 --> 00:45:41,880 is one more example of how you can think about these frequency 884 00:45:41,880 --> 00:45:44,370 representations helping you to imagine 885 00:45:44,370 --> 00:45:46,110 the kinds of signal processing that you 886 00:45:46,110 --> 00:45:48,270 do or would like to do. 887 00:45:48,270 --> 00:45:52,470 And so the last example now is one from image processing, 888 00:45:52,470 --> 00:45:53,660 instead of audio processing. 889 00:45:53,660 --> 00:45:55,617 I started with audio processing. 890 00:45:55,617 --> 00:45:57,450 Now, I want to think about image processing. 891 00:45:57,450 --> 00:45:59,460 Image has the property that I'm going to have 892 00:45:59,460 --> 00:46:02,040 to do something with 2D. 893 00:46:02,040 --> 00:46:04,560 And in this class, we primarily think about 1D. 894 00:46:04,560 --> 00:46:08,160 But you saw in the zebra problem that sometimes extending to 2D 895 00:46:08,160 --> 00:46:09,600 is not hard. 896 00:46:09,600 --> 00:46:13,830 And it certainly is the case that the Fourier method 897 00:46:13,830 --> 00:46:17,700 extending to 2D is really easy, or at least 898 00:46:17,700 --> 00:46:19,680 I'm going to say that. 899 00:46:19,680 --> 00:46:24,990 So the way you can think about a Fourier series 900 00:46:24,990 --> 00:46:27,660 in two dimensions is illustrated by this picture. 901 00:46:27,660 --> 00:46:30,240 I took a picture that 512 by 512. 902 00:46:30,240 --> 00:46:32,130 That's the boat. 903 00:46:32,130 --> 00:46:37,100 And I made a new picture by taking this row, 904 00:46:37,100 --> 00:46:39,780 calculating the Fourier series for that row-- 905 00:46:39,780 --> 00:46:43,420 that had 512; so it's 512 by 512. 906 00:46:43,420 --> 00:46:46,860 So I took these 512 numbers, took the Fourier series, 907 00:46:46,860 --> 00:46:47,820 and wrote them here. 908 00:46:50,450 --> 00:46:55,700 Then I took these 512 numbers and put the Fourier series here 909 00:46:55,700 --> 00:46:57,980 and repeat-- 910 00:46:57,980 --> 00:46:59,120 so fill the whole thing up. 911 00:47:01,850 --> 00:47:06,200 So I took 512, 512-length sequences. 912 00:47:06,200 --> 00:47:13,862 Then I took that string of numbers, 913 00:47:13,862 --> 00:47:17,565 took the Fourier series, and put it there. 914 00:47:20,310 --> 00:47:24,060 And then that one, take the Fourier series, put it there. 915 00:47:24,060 --> 00:47:25,980 Take that one, take the Fourier series, 916 00:47:25,980 --> 00:47:30,000 put it there, and build up an image that way. 917 00:47:30,000 --> 00:47:32,520 So I, row by row, took all the Fourier series, 918 00:47:32,520 --> 00:47:33,844 pasted them together. 919 00:47:33,844 --> 00:47:35,760 Column by column, took all the Fourier series, 920 00:47:35,760 --> 00:47:36,840 pasted them together. 921 00:47:36,840 --> 00:47:38,298 When you're done with that, you get 922 00:47:38,298 --> 00:47:41,580 what we call a two dimensional Fourier series. 923 00:47:41,580 --> 00:47:43,470 And what you see on the right then-- 924 00:47:43,470 --> 00:47:45,720 so here's my original picture 512 by 512. 925 00:47:45,720 --> 00:47:47,761 Here's the picture of the magnitude of the angle. 926 00:47:52,670 --> 00:47:55,950 You can clearly see the boat. 927 00:47:55,950 --> 00:47:59,950 [LAUGHTER] 928 00:47:59,950 --> 00:48:03,490 And it's much clearer here. 929 00:48:03,490 --> 00:48:06,610 So the phase looks kind of random. 930 00:48:06,610 --> 00:48:08,800 So to gain some insight into what's in the magnitude 931 00:48:08,800 --> 00:48:11,740 and what's in the phase, what I can do 932 00:48:11,740 --> 00:48:15,220 is generate a new picture by setting the angle everywhere 933 00:48:15,220 --> 00:48:15,790 to 0. 934 00:48:18,760 --> 00:48:21,430 So I took the picture, the magnitude, 935 00:48:21,430 --> 00:48:22,450 and I did this to it. 936 00:48:22,450 --> 00:48:23,980 I got the magnitude and angle. 937 00:48:23,980 --> 00:48:26,470 I set the angles to 0. 938 00:48:26,470 --> 00:48:27,820 And that's the picture I got. 939 00:48:30,600 --> 00:48:34,800 So I was able to munge the angle in the auditory thing, 940 00:48:34,800 --> 00:48:36,150 and you could barely tell. 941 00:48:36,150 --> 00:48:39,770 Can you tell that I've munged the angle? 942 00:48:39,770 --> 00:48:42,130 There's some distortion caused by the angles. 943 00:48:42,130 --> 00:48:46,330 There are some things that you can still see. 944 00:48:46,330 --> 00:48:50,947 So if you go back to this one, there's these things here, 945 00:48:50,947 --> 00:48:52,780 and there's these things here, and there's-- 946 00:48:52,780 --> 00:48:54,520 And if you go to this one, there's 947 00:48:54,520 --> 00:48:57,460 some lines here, and some lines-- 948 00:48:57,460 --> 00:49:00,430 Maybe there's something there. 949 00:49:00,430 --> 00:49:03,880 But to a first order, it kind of messed things up. 950 00:49:03,880 --> 00:49:06,310 So then I did the opposite-- 951 00:49:06,310 --> 00:49:09,230 just throw away the magnitude and substitute 1, 952 00:49:09,230 --> 00:49:12,780 put 1 everywhere there was a magnitude, 953 00:49:12,780 --> 00:49:14,090 but put the angle back. 954 00:49:14,090 --> 00:49:16,750 Now, you can almost see the ship. 955 00:49:16,750 --> 00:49:18,697 So throw away the magnitude is better 956 00:49:18,697 --> 00:49:19,780 than throw away the phase. 957 00:49:19,780 --> 00:49:22,480 That's kind of cute. 958 00:49:22,480 --> 00:49:25,182 Can somebody think of why throw away the magnitude 959 00:49:25,182 --> 00:49:26,890 might be better than throw away the angle 960 00:49:26,890 --> 00:49:28,556 when you're trying to look at a picture? 961 00:49:31,980 --> 00:49:32,960 Yeah. 962 00:49:32,960 --> 00:49:35,410 AUDIENCE: Angle determines resolution. 963 00:49:35,410 --> 00:49:37,890 Magnitude determines [INAUDIBLE]. 964 00:49:37,890 --> 00:49:39,780 DENNIS FREEMAN: That's exactly right. 965 00:49:39,780 --> 00:49:42,770 So if you muck around with the phase, 966 00:49:42,770 --> 00:49:45,650 you're changing the position. 967 00:49:45,650 --> 00:49:47,784 Even in audio, when you muck around with the phase, 968 00:49:47,784 --> 00:49:49,700 you're changing when the component comes out-- 969 00:49:49,700 --> 00:49:51,066 earlier or later. 970 00:49:51,066 --> 00:49:53,690 In the picture, you're changing when the brightness comes out-- 971 00:49:53,690 --> 00:49:55,200 earlier or later. 972 00:49:55,200 --> 00:49:57,200 If you want to have a nice straight line, 973 00:49:57,200 --> 00:50:00,020 you better keep all the phases lined up. 974 00:50:00,020 --> 00:50:02,580 If you scramble them, they end up scrambled, 975 00:50:02,580 --> 00:50:04,890 and you don't see them anymore. 976 00:50:04,890 --> 00:50:10,410 And as you said, the magnitude is controlling the intensity. 977 00:50:10,410 --> 00:50:13,064 So my intensities are all screwed up, 978 00:50:13,064 --> 00:50:14,730 but you can kind of still see the lines. 979 00:50:14,730 --> 00:50:16,140 You can almost even read-- 980 00:50:16,140 --> 00:50:17,300 if you know Polish-- 981 00:50:17,300 --> 00:50:22,340 you can almost read what the title says. 982 00:50:22,340 --> 00:50:24,380 So one more manipulation-- 983 00:50:24,380 --> 00:50:31,340 I took a different picture and substituted the magnitude 984 00:50:31,340 --> 00:50:34,610 of that different picture in place of the magnitude 985 00:50:34,610 --> 00:50:36,210 of the boat picture. 986 00:50:36,210 --> 00:50:41,120 So angle with the boat, magnitude of the mystery 987 00:50:41,120 --> 00:50:45,270 picture, and it came out pretty good. 988 00:50:47,822 --> 00:50:49,530 But by the theory of lectures, of course, 989 00:50:49,530 --> 00:50:51,390 you know that the way I did this was 990 00:50:51,390 --> 00:50:53,745 to get a picture of a different boat, 991 00:50:53,745 --> 00:50:55,120 so that it would be very similar. 992 00:50:58,500 --> 00:51:01,350 And so that's what the magnitude was. 993 00:51:01,350 --> 00:51:03,600 [LAUGHTER] 994 00:51:03,600 --> 00:51:07,150 So it doesn't really matter much. 995 00:51:07,150 --> 00:51:10,410 So I started with this magnitude and angle, 996 00:51:10,410 --> 00:51:14,974 substitute the mandrill's magnitude, and you get that. 997 00:51:14,974 --> 00:51:16,140 So it comes out pretty good. 998 00:51:16,140 --> 00:51:18,120 So the idea then is just that we've 999 00:51:18,120 --> 00:51:20,940 looked at Fourier representations 1000 00:51:20,940 --> 00:51:22,500 as an alternative way of thinking 1001 00:51:22,500 --> 00:51:24,240 about the content of a signal. 1002 00:51:24,240 --> 00:51:26,880 And for many purposes, like audio and video, 1003 00:51:26,880 --> 00:51:32,220 that alternative representation is easy and insightful. 1004 00:51:32,220 --> 00:51:33,090 No class tomorrow. 1005 00:51:33,090 --> 00:51:35,130 It's Veterans Day. 1006 00:51:35,130 --> 00:51:37,760 Party next Wednesday.