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:24,416 --> 00:00:26,836 [MUSIC PLAYING] 9 00:00:50,724 --> 00:00:52,140 ALAN OPPENHEIM: In This lecture, I 10 00:00:52,140 --> 00:00:55,080 would like to demonstrate the effects of sampling 11 00:00:55,080 --> 00:00:58,740 and aliasing, and also, some of the properties of discrete time 12 00:00:58,740 --> 00:01:00,630 linear systems. 13 00:01:00,630 --> 00:01:02,850 What we'll be using to demonstrate 14 00:01:02,850 --> 00:01:07,110 this is a programmable digital filter, which is contained 15 00:01:07,110 --> 00:01:10,470 in this box, programmable in the sense 16 00:01:10,470 --> 00:01:13,650 that many of the parameters of the filter-- for example, 17 00:01:13,650 --> 00:01:17,190 the filter coefficients, the coefficient and arithmetic word 18 00:01:17,190 --> 00:01:20,440 length, the sampling rate etc, are easily changed. 19 00:01:20,440 --> 00:01:22,080 In other words, programmable. 20 00:01:22,080 --> 00:01:24,390 So this is the basic digital filter. 21 00:01:24,390 --> 00:01:26,850 And then, of course, we have some associated equipment 22 00:01:26,850 --> 00:01:29,730 to help us with the demonstration. 23 00:01:29,730 --> 00:01:34,950 Well, we'll be returning to this filter in a few minutes, when, 24 00:01:34,950 --> 00:01:38,640 together with my colleagues, Mike Portnoff and Dave Harris, 25 00:01:38,640 --> 00:01:41,040 I'll be demonstrating several of the ideas 26 00:01:41,040 --> 00:01:43,030 that we're about to talk about. 27 00:01:43,030 --> 00:01:49,170 But first of all, let me explain what the basic setup is. 28 00:01:49,170 --> 00:01:53,910 The programmable digital filter consists, essentially 29 00:01:53,910 --> 00:02:01,860 of a system which is a sampler, a continuous time, or C 30 00:02:01,860 --> 00:02:09,630 to D converter, which converts an impulse train to a sequence, 31 00:02:09,630 --> 00:02:13,200 a digital filter to obtain a filtered output 32 00:02:13,200 --> 00:02:17,790 sequence, a "discrete time to time" converter 33 00:02:17,790 --> 00:02:21,090 to convert the sequence back to an impulse train, 34 00:02:21,090 --> 00:02:24,780 and finally a D-sampling or smoothing low-pass filter. 35 00:02:24,780 --> 00:02:28,770 So at this point, we have a continuous time input. 36 00:02:28,770 --> 00:02:32,610 At this point, we have a continuous time impulse train, 37 00:02:32,610 --> 00:02:36,090 at this point, a sequence, then a sequence here, 38 00:02:36,090 --> 00:02:39,540 an impulse train, and back to a smooth, continuous time 39 00:02:39,540 --> 00:02:41,490 function. 40 00:02:41,490 --> 00:02:43,710 For the first part of the demonstration, 41 00:02:43,710 --> 00:02:46,950 what I would like to focus on is just simply 42 00:02:46,950 --> 00:02:50,490 the effects of sampling and aliasing. 43 00:02:50,490 --> 00:02:52,740 And so for the first part, I'll just 44 00:02:52,740 --> 00:02:55,050 simply choose this digital filter 45 00:02:55,050 --> 00:02:57,220 to be an identity system. 46 00:02:57,220 --> 00:02:59,730 In other words, the impulse response of this system 47 00:02:59,730 --> 00:03:01,440 is just simply an impulse. 48 00:03:01,440 --> 00:03:03,900 In that case, this overall system 49 00:03:03,900 --> 00:03:07,080 collapses to a somewhat simpler system, 50 00:03:07,080 --> 00:03:11,010 as I have on this next viewgraph where 51 00:03:11,010 --> 00:03:16,590 we convert from a continuous time input to a sequence 52 00:03:16,590 --> 00:03:21,540 and then back to the continuous time input. 53 00:03:21,540 --> 00:03:25,320 And, in fact, we could really collapse the A to D or C 54 00:03:25,320 --> 00:03:28,170 to D converter and D to A converter 55 00:03:28,170 --> 00:03:31,980 together since we're simply converting from an impulse 56 00:03:31,980 --> 00:03:36,420 train to a sequence and then back to the same impulse train. 57 00:03:36,420 --> 00:03:38,550 To see what the effect of this system 58 00:03:38,550 --> 00:03:42,600 is in both the time domain and frequency domain, 59 00:03:42,600 --> 00:03:49,920 we can look at the associated time waveforms and spectra. 60 00:03:49,920 --> 00:03:56,340 On the left-hand side, we have the associated time wave forms 61 00:03:56,340 --> 00:03:57,270 and sequences. 62 00:03:57,270 --> 00:04:01,170 On the right-hand side, the associated Fourier transforms. 63 00:04:01,170 --> 00:04:05,340 So we can think of an input continuous time function, which 64 00:04:05,340 --> 00:04:09,750 is of some general form, with a band-limited spectrum-- 65 00:04:09,750 --> 00:04:14,430 band-limited from minus omega c to plus omega c. 66 00:04:14,430 --> 00:04:17,550 When we sample this to obtain the impulse 67 00:04:17,550 --> 00:04:21,000 train with a sampling period of capital T 68 00:04:21,000 --> 00:04:27,000 the associated spectrum is then a periodic replication 69 00:04:27,000 --> 00:04:29,440 of this band-limited spectrum. 70 00:04:29,440 --> 00:04:33,480 So we have the Fourier transform of x of a of t. 71 00:04:33,480 --> 00:04:36,090 Then the same thing reproduce that multiples 72 00:04:36,090 --> 00:04:38,910 of 2 pi over capital T 73 00:04:38,910 --> 00:04:44,580 When we then convert this to a sequence, that 74 00:04:44,580 --> 00:04:47,150 implies a frequency normalization, 75 00:04:47,150 --> 00:04:51,120 a normalization of the frequency axis, so that this periodicity 76 00:04:51,120 --> 00:04:54,570 gets converted to a periodicity with a period of 2 77 00:04:54,570 --> 00:04:58,920 pi in the digital frequency variable small omega. 78 00:04:58,920 --> 00:05:02,010 Otherwise, the general shape of the Fourier transform 79 00:05:02,010 --> 00:05:03,480 stays the same. 80 00:05:03,480 --> 00:05:05,970 We then go back through the system, converting. 81 00:05:05,970 --> 00:05:09,960 Back to an impulse train and then finally, 82 00:05:09,960 --> 00:05:12,690 by low-pass filtering, we extract 83 00:05:12,690 --> 00:05:17,970 just the one replication of the original Fourier transform. 84 00:05:17,970 --> 00:05:22,140 And what we would recover is x of a of j omega. 85 00:05:22,140 --> 00:05:24,930 We would recover this exactly provided 86 00:05:24,930 --> 00:05:29,970 that the bandwidth is small enough compared 87 00:05:29,970 --> 00:05:33,030 with the sampling frequency. 88 00:05:33,030 --> 00:05:36,660 If, on the other hand, omega sub c is too large in relation 89 00:05:36,660 --> 00:05:40,470 to the sampling frequency, then what we end up with 90 00:05:40,470 --> 00:05:44,460 is an interaction between these two pieces of the Fourier 91 00:05:44,460 --> 00:05:45,660 transform. 92 00:05:45,660 --> 00:05:50,100 And that interaction is what's referred to as aliasing. 93 00:05:50,100 --> 00:05:52,980 The effect aliasing is most easily 94 00:05:52,980 --> 00:05:56,910 understood in terms of a simple example, namely 95 00:05:56,910 --> 00:05:58,870 a sinusoidal input. 96 00:05:58,870 --> 00:06:01,560 So let's consider, specifically, what 97 00:06:01,560 --> 00:06:07,260 happens with the spectra in the case of a sinusoidal input. 98 00:06:07,260 --> 00:06:11,680 Here, we have an input cosine omega 0t, 99 00:06:11,680 --> 00:06:16,470 an assumed sampling rate of 2 pi over capital T. This 100 00:06:16,470 --> 00:06:22,620 then is the Fourier transform of this sinusoid or cosine. 101 00:06:22,620 --> 00:06:26,670 After sampling, that is just simply periodically repeated 102 00:06:26,670 --> 00:06:30,010 with a period equal to the sampling frequency. 103 00:06:30,010 --> 00:06:38,470 And we see that if omega 0, the input frequency is low enough, 104 00:06:38,470 --> 00:06:46,230 then the original spectrum, or Fourier transform, 105 00:06:46,230 --> 00:06:50,640 falls within the passband of the low-pass filter. 106 00:06:50,640 --> 00:06:54,120 This dashed line corresponds to the frequency response, 107 00:06:54,120 --> 00:06:56,880 an ideal frequency response, associated 108 00:06:56,880 --> 00:06:59,320 with the D-sampling low-pass filter. 109 00:06:59,320 --> 00:07:04,650 And, of course, if the spectral fall, as I've shown in here, 110 00:07:04,650 --> 00:07:06,440 then there is no aliasing. 111 00:07:06,440 --> 00:07:08,340 In other words, what we recover at the output 112 00:07:08,340 --> 00:07:10,860 of the low-pass filter is just simply 113 00:07:10,860 --> 00:07:14,460 the original Fourier transform, or equivalently, 114 00:07:14,460 --> 00:07:16,470 the original signal. 115 00:07:16,470 --> 00:07:20,140 Now, let's consider, on the other hand, 116 00:07:20,140 --> 00:07:25,830 the effect of increasing omega 0, the input frequency, 117 00:07:25,830 --> 00:07:30,180 and we can think in particular of what 118 00:07:30,180 --> 00:07:34,800 the effect is on each one of these impulses in the Fourier 119 00:07:34,800 --> 00:07:36,150 transform. 120 00:07:36,150 --> 00:07:40,350 As omega 0 increases, this impulse moves to the right, 121 00:07:40,350 --> 00:07:43,000 this impulse moves to the left. 122 00:07:43,000 --> 00:07:46,230 And likewise, in the periodic replications, 123 00:07:46,230 --> 00:07:48,750 this impulse moves down in frequency. 124 00:07:48,750 --> 00:07:51,960 This impulse moves up in frequency, etc. 125 00:07:51,960 --> 00:07:58,740 Now, if omega sub s minus omega 0 is greater than omega 0, 126 00:07:58,740 --> 00:08:01,530 then these two impulses haven't crossed. 127 00:08:01,530 --> 00:08:08,190 However, if omega sub s minus omega 0 is less than omega 0, 128 00:08:08,190 --> 00:08:10,500 then the situation that we have is 129 00:08:10,500 --> 00:08:15,480 what I've illustrated here, where now, the impulses that 130 00:08:15,480 --> 00:08:18,120 lie in the passband of the filter 131 00:08:18,120 --> 00:08:22,620 are at the frequency omega sub s minus omega 0 132 00:08:22,620 --> 00:08:25,380 rather than at the frequency omega 0. 133 00:08:25,380 --> 00:08:29,310 So as we think of increasing the input frequency, what 134 00:08:29,310 --> 00:08:32,280 happens for a while, is that the output frequency 135 00:08:32,280 --> 00:08:34,409 will correspondingly increase. 136 00:08:34,409 --> 00:08:38,490 But after we've increased omega 0 past this point, 137 00:08:38,490 --> 00:08:41,760 then the output of the low-pass filter 138 00:08:41,760 --> 00:08:44,640 will decrease in frequency because it's 139 00:08:44,640 --> 00:08:49,560 taken on the alias of a new frequency or a new sinusoid. 140 00:08:49,560 --> 00:08:51,570 And so the output, in, that case is 141 00:08:51,570 --> 00:08:54,510 cosine omega sub s minus omega 0. 142 00:08:54,510 --> 00:08:57,960 And there's a little t over here. 143 00:08:57,960 --> 00:09:00,600 There is-- I want to demonstrate this effect. 144 00:09:00,600 --> 00:09:02,760 There is another effect that we'll 145 00:09:02,760 --> 00:09:06,150 observe in the process of demonstrating 146 00:09:06,150 --> 00:09:10,500 this, because of the fact that in any real-world situation, 147 00:09:10,500 --> 00:09:12,540 in fact, this low-pass filter is not 148 00:09:12,540 --> 00:09:16,660 going to be an ideal low-pass filter, as I've shown here 149 00:09:16,660 --> 00:09:20,340 but in fact, is going to have some transition 150 00:09:20,340 --> 00:09:22,220 with associated with it. 151 00:09:22,220 --> 00:09:26,940 And so as omega 0 and omega sub s minus omega 0 152 00:09:26,940 --> 00:09:30,990 get very close in frequency, in essence, both of them 153 00:09:30,990 --> 00:09:35,550 are having some influence on the output because of the fact 154 00:09:35,550 --> 00:09:38,850 that there isn't infinite attenuation of one 155 00:09:38,850 --> 00:09:42,390 of the impulses an exact replication of the other. 156 00:09:42,390 --> 00:09:44,220 So what we'll see in that case, as we 157 00:09:44,220 --> 00:09:47,730 get an input frequency which is close to half the sampling 158 00:09:47,730 --> 00:09:52,020 frequency, will see, in addition to the effective aliasing 159 00:09:52,020 --> 00:09:53,760 that we want to demonstrate, we'll 160 00:09:53,760 --> 00:09:55,920 see an effect which, essentially, 161 00:09:55,920 --> 00:09:57,630 is a beating phenomenon. 162 00:09:57,630 --> 00:10:00,810 So let's move over to the digital filter 163 00:10:00,810 --> 00:10:05,640 and demonstrate these effects, where I remind you now 164 00:10:05,640 --> 00:10:11,160 that this filter, the digital filter aspect of it, 165 00:10:11,160 --> 00:10:14,610 is just simply an identity system so that it corresponds 166 00:10:14,610 --> 00:10:18,450 to sampling, and then simply sampling and low-pass 167 00:10:18,450 --> 00:10:20,580 filtering. 168 00:10:20,580 --> 00:10:26,580 What we have as an input, if we look at the oscilloscope, 169 00:10:26,580 --> 00:10:31,470 is on the upper trace, the input sinusoid, on the lower trace, 170 00:10:31,470 --> 00:10:33,180 the output sinusoid. 171 00:10:33,180 --> 00:10:36,420 And as we see it right now, the input sinusoid 172 00:10:36,420 --> 00:10:39,520 has chosen to be low enough frequency so that, in fact, 173 00:10:39,520 --> 00:10:41,310 there is no aliasing. 174 00:10:41,310 --> 00:10:46,330 Well, let's now increase the input frequency. 175 00:10:46,330 --> 00:10:50,010 And what we'll observe is that the output frequency 176 00:10:50,010 --> 00:10:52,380 increases likewise. 177 00:10:52,380 --> 00:10:56,370 The output frequency is still equal to the input frequency. 178 00:10:56,370 --> 00:10:58,890 We're now getting into the vicinity 179 00:10:58,890 --> 00:11:00,900 of half the sampling frequency so 180 00:11:00,900 --> 00:11:03,660 that what we're beginning to see now in the output 181 00:11:03,660 --> 00:11:06,090 is not just a sinusoidal output. 182 00:11:06,090 --> 00:11:09,910 But in fact, what we see are the two components. 183 00:11:09,910 --> 00:11:13,530 In other words, we see the beating effect due to the fact 184 00:11:13,530 --> 00:11:18,490 that the low-pass filter is not an ideal low-pass filter. 185 00:11:18,490 --> 00:11:24,270 Now what we want to observe as we sweep past half the sampling 186 00:11:24,270 --> 00:11:28,090 frequency is the aliasing effect-- in other words, 187 00:11:28,090 --> 00:11:30,240 the fact that the output sinusoid 188 00:11:30,240 --> 00:11:32,070 will decrease in frequency. 189 00:11:32,070 --> 00:11:35,850 Let's first sweep back down to DC. 190 00:11:35,850 --> 00:11:39,810 So the output sinusoid follows the input sinusoid. 191 00:11:39,810 --> 00:11:43,900 And then we'll sweep automatically from 0 192 00:11:43,900 --> 00:11:46,660 up to the sampling frequency. 193 00:11:46,660 --> 00:11:48,740 And let's see that. 194 00:11:48,740 --> 00:11:51,390 So on the bottom trace is the output sinusoid. 195 00:11:51,390 --> 00:11:53,450 The top trace is the input sinusoid. 196 00:11:53,450 --> 00:11:56,190 Were now in the vicinity of half the sampling frequency. 197 00:11:56,190 --> 00:11:58,800 We're now past half the sampling frequency. 198 00:11:58,800 --> 00:12:01,830 And you see that the output is decreasing in frequency 199 00:12:01,830 --> 00:12:04,390 while the input was increasing. 200 00:12:04,390 --> 00:12:07,330 Let's finally look at that again. 201 00:12:07,330 --> 00:12:11,430 But this time, let's also listen to the output sinusoid. 202 00:12:11,430 --> 00:12:14,010 And what you'll hear, in addition to observing this 203 00:12:14,010 --> 00:12:15,870 on the bottom trace of the scope, 204 00:12:15,870 --> 00:12:19,500 is the fact that the output frequency first 205 00:12:19,500 --> 00:12:23,670 increases, and then decreases, even though the input frequency 206 00:12:23,670 --> 00:12:25,472 is continuing to increase. 207 00:12:25,472 --> 00:12:26,430 So let's do that again. 208 00:12:26,430 --> 00:12:28,650 But now, in this case, let's listen to the output. 209 00:12:28,650 --> 00:12:31,638 [SOUND WAVES RISE AND LOWER] 210 00:12:41,610 --> 00:12:45,690 OK, now what we would now like to consider 211 00:12:45,690 --> 00:12:49,200 is the effect of actually carrying out 212 00:12:49,200 --> 00:12:51,360 some digital filtering in-between 213 00:12:51,360 --> 00:12:54,430 the sampling and D-sampling. 214 00:12:54,430 --> 00:13:00,510 And so let me return to the basic system 215 00:13:00,510 --> 00:13:11,750 again where we had previously removed this digital filter. 216 00:13:11,750 --> 00:13:13,400 And now, what we want to consider 217 00:13:13,400 --> 00:13:18,080 is the effect of the overall system, when we, in fact, 218 00:13:18,080 --> 00:13:20,660 insert an interesting, or a more interesting, 219 00:13:20,660 --> 00:13:22,610 digital filter in the middle. 220 00:13:22,610 --> 00:13:26,390 The digital filter that we're going to insert 221 00:13:26,390 --> 00:13:30,680 is a low-pass filter. 222 00:13:30,680 --> 00:13:33,740 And the impulse response of the low-pass filter, 223 00:13:33,740 --> 00:13:36,290 or the unit sample response of the low-pass filter, 224 00:13:36,290 --> 00:13:38,660 is, as I've shown up here. 225 00:13:38,660 --> 00:13:42,380 And it's a symmetric unit sample response. 226 00:13:42,380 --> 00:13:46,730 And consequently, it corresponds to a linear phase filter. 227 00:13:46,730 --> 00:13:48,740 The associated frequency response 228 00:13:48,740 --> 00:13:53,420 I show down here, where this is now the filter passband. 229 00:13:53,420 --> 00:13:55,010 This is the filter stop band. 230 00:13:55,010 --> 00:13:57,170 And, of course, there is some ripple. 231 00:13:57,170 --> 00:14:00,320 There is an infinite attenuation in the stopband. 232 00:14:00,320 --> 00:14:03,290 And I remind you of the fact that, of course, 233 00:14:03,290 --> 00:14:07,370 the digital filter frequency response must, by necessity, be 234 00:14:07,370 --> 00:14:11,720 periodic with a period of 2 pi. 235 00:14:11,720 --> 00:14:15,800 The cutoff frequency associated with the particular filter 236 00:14:15,800 --> 00:14:19,610 that we want to demonstrate is pi over 5, 237 00:14:19,610 --> 00:14:22,650 or one tenth of 2 pi. 238 00:14:22,650 --> 00:14:25,100 And the factor one tenth is a factor 239 00:14:25,100 --> 00:14:29,010 that I'll want to refer to again shortly. 240 00:14:29,010 --> 00:14:32,550 Now, the overall system, of course, 241 00:14:32,550 --> 00:14:34,590 is a continuous time system. 242 00:14:34,590 --> 00:14:36,920 In other words, we have a continuous time input. 243 00:14:36,920 --> 00:14:39,540 We have a continuous time output. 244 00:14:39,540 --> 00:14:42,320 And the question then is, what is 245 00:14:42,320 --> 00:14:46,490 the equivalent continuous time system in relation 246 00:14:46,490 --> 00:14:49,820 to the digital filter frequency response 247 00:14:49,820 --> 00:14:51,240 that we have illustrated here? 248 00:14:51,240 --> 00:14:54,470 In other words, what is the equivalent frequency response 249 00:14:54,470 --> 00:14:59,450 of the corresponding continuous time system? 250 00:14:59,450 --> 00:15:03,320 We can answer that by simply referring 251 00:15:03,320 --> 00:15:07,040 to the basic definition of frequency response 252 00:15:07,040 --> 00:15:09,710 for the continuous time case and frequency response 253 00:15:09,710 --> 00:15:13,070 for the discrete time case. 254 00:15:13,070 --> 00:15:18,290 In the continuous time case, for a linear time invariant filter, 255 00:15:18,290 --> 00:15:21,170 the frequency response is defined 256 00:15:21,170 --> 00:15:26,210 as the gain change applied to a complex exponential. 257 00:15:26,210 --> 00:15:30,300 So if we consider a complex exponential as the input, 258 00:15:30,300 --> 00:15:33,980 then the output of the system is a complex exponential 259 00:15:33,980 --> 00:15:39,000 at the same complex frequency, but with an amplitude, 260 00:15:39,000 --> 00:15:42,440 which is equal to the frequency response of the system 261 00:15:42,440 --> 00:15:44,960 at that frequency. 262 00:15:44,960 --> 00:15:48,350 Likewise, for a discrete time system, 263 00:15:48,350 --> 00:15:51,170 we can consider a complex exponential input 264 00:15:51,170 --> 00:15:53,600 at a frequency small omega. 265 00:15:53,600 --> 00:15:57,080 And the output is a complex exponential 266 00:15:57,080 --> 00:16:01,220 at the same complex frequency, with an amplitude change, 267 00:16:01,220 --> 00:16:05,480 which is the frequency response of the digital filter, 268 00:16:05,480 --> 00:16:10,620 or discrete time filter, again evaluated at that frequency. 269 00:16:10,620 --> 00:16:13,340 Well, simply from these definitions, 270 00:16:13,340 --> 00:16:15,500 we can trace our way through the system 271 00:16:15,500 --> 00:16:20,810 and see fairly easily what the equivalent analog, 272 00:16:20,810 --> 00:16:25,910 or continuous time filter frequency, response is. 273 00:16:25,910 --> 00:16:29,240 Let's consider the overall system. 274 00:16:29,240 --> 00:16:33,590 And let's choose an input, which is a complex exponential. 275 00:16:33,590 --> 00:16:36,800 And we'll choose the complex exponential carefully 276 00:16:36,800 --> 00:16:39,620 to avoid aliasing. 277 00:16:39,620 --> 00:16:42,770 We then sample this complex exponential 278 00:16:42,770 --> 00:16:44,870 and convert that to a sequence. 279 00:16:44,870 --> 00:16:46,810 And the sequence values are there 280 00:16:46,810 --> 00:16:50,630 for e to the j omega and capital T. Well, 281 00:16:50,630 --> 00:16:52,730 this is just the discrete time complex 282 00:16:52,730 --> 00:16:58,190 exponential with a frequency of capital omega times capital T. 283 00:16:58,190 --> 00:17:01,400 So the output of the digital filter 284 00:17:01,400 --> 00:17:04,880 is a complex exponential with the same complex frequency, 285 00:17:04,880 --> 00:17:08,910 capital omega times capital T, with an amplitude, 286 00:17:08,910 --> 00:17:13,400 which is the frequency response of this filter evaluated 287 00:17:13,400 --> 00:17:15,780 at the frequency of the input-- 288 00:17:15,780 --> 00:17:20,450 In other words, evaluated at capital omega times capital T. 289 00:17:20,450 --> 00:17:23,300 Then we convert that back to an impulse train, 290 00:17:23,300 --> 00:17:25,550 and finally, low-pass filter. 291 00:17:25,550 --> 00:17:27,990 And the output of the low-pass filter 292 00:17:27,990 --> 00:17:35,000 then has the same amplitude, but now multiplying 293 00:17:35,000 --> 00:17:37,820 a continuous time complex exponential 294 00:17:37,820 --> 00:17:39,890 at the original input frequency. 295 00:17:39,890 --> 00:17:43,160 So simply from the definition comparing this 296 00:17:43,160 --> 00:17:46,940 to the input from the definition of the continuous time 297 00:17:46,940 --> 00:17:50,570 frequency response, the continuous time frequency 298 00:17:50,570 --> 00:17:53,180 response is equal to this term. 299 00:17:53,180 --> 00:17:56,060 In other words, it's the frequency response 300 00:17:56,060 --> 00:18:01,040 of the digital filter, but with a rescaling of the frequency 301 00:18:01,040 --> 00:18:02,010 axis-- 302 00:18:02,010 --> 00:18:04,490 in other words, with the digital frequency 303 00:18:04,490 --> 00:18:10,920 variable small omega replaced by capital omega times capital T. 304 00:18:10,920 --> 00:18:14,880 The consequence of that for the particular digital filter that 305 00:18:14,880 --> 00:18:18,720 we're talking about-- or, in fact, for any digital filter-- 306 00:18:18,720 --> 00:18:22,320 is that the continuous time filter 307 00:18:22,320 --> 00:18:26,640 frequency response has the same shape as the digital filter 308 00:18:26,640 --> 00:18:31,980 frequency response, but has a rescaled frequency axis-- 309 00:18:31,980 --> 00:18:35,550 rescaled according to this scaling. 310 00:18:35,550 --> 00:18:38,190 And in essence, what the rescaling corresponds 311 00:18:38,190 --> 00:18:42,060 to-- and I think you can verify this on your own-- 312 00:18:42,060 --> 00:18:50,220 is to reconvert or rescale the frequency 2 pi in small omega 313 00:18:50,220 --> 00:18:54,510 to the sampling frequency in large omega. 314 00:18:54,510 --> 00:18:57,630 And the upshot of all of this, is 315 00:18:57,630 --> 00:19:00,540 that this cutoff frequency, which in a digital filter 316 00:19:00,540 --> 00:19:07,320 is a pi over 5, is now rescaled to pi over 5 capital T. 317 00:19:07,320 --> 00:19:10,710 And what we would observe is that as capital T, 318 00:19:10,710 --> 00:19:13,410 the sampling period changes, then 319 00:19:13,410 --> 00:19:16,110 the bandwidth, or the cutoff frequency, 320 00:19:16,110 --> 00:19:19,830 of the continuous time filter changes also. 321 00:19:19,830 --> 00:19:24,780 So let me remind you of the fact that the digital filter had 322 00:19:24,780 --> 00:19:30,060 a cutoff frequency which was 1/10 of 2 pi. 323 00:19:30,060 --> 00:19:34,860 2 pi gets rescaled to the sampling frequency 324 00:19:34,860 --> 00:19:37,680 in the continuous time domain. 325 00:19:37,680 --> 00:19:40,530 And the filter cutoff frequency will then 326 00:19:40,530 --> 00:19:46,960 get rescaled to one tenth of the filter sampling frequency. 327 00:19:46,960 --> 00:19:49,120 Let's illustrate some of these effects 328 00:19:49,120 --> 00:19:51,730 with the digital filter. 329 00:19:51,730 --> 00:19:56,590 What we have, as I said was, is a low pass filter impulse 330 00:19:56,590 --> 00:19:58,840 response and frequency response. 331 00:19:58,840 --> 00:20:01,690 First let's look at the impulse response 332 00:20:01,690 --> 00:20:05,180 of the filter of the overall system-- in other words, 333 00:20:05,180 --> 00:20:10,480 after the D-sampling low-pass filter. 334 00:20:10,480 --> 00:20:16,510 What we see here is the impulse response of the overall system. 335 00:20:16,510 --> 00:20:20,440 And we observe, for one thing, that it's a symmetrical impulse 336 00:20:20,440 --> 00:20:23,620 response-- in other words, corresponds to a linear phase 337 00:20:23,620 --> 00:20:24,710 filter. 338 00:20:24,710 --> 00:20:26,860 We can also look at the impulse response 339 00:20:26,860 --> 00:20:29,340 before the D-sampling low-pass filter. 340 00:20:29,340 --> 00:20:31,270 Lets take out that the D-sampling low-pass 341 00:20:31,270 --> 00:20:33,520 filter slowly. 342 00:20:33,520 --> 00:20:37,540 And what we observe is basically the output 343 00:20:37,540 --> 00:20:40,840 of the digital-to-analog converter, which, 344 00:20:40,840 --> 00:20:44,470 of course, is a staircase or boxcar function, not an impulse 345 00:20:44,470 --> 00:20:45,280 train. 346 00:20:45,280 --> 00:20:48,130 In the real world, the output of a [? D-day ?] converter 347 00:20:48,130 --> 00:20:51,070 generally is a boxcar type of function. 348 00:20:51,070 --> 00:20:54,010 We can put the D sampling filter back in now. 349 00:20:54,010 --> 00:20:57,760 And notice that the effect of the D-sampling filter is 350 00:20:57,760 --> 00:21:03,670 basically to smooth out the rough edges in the boxcar 351 00:21:03,670 --> 00:21:06,526 output from the [? D-day ?] converter. 352 00:21:06,526 --> 00:21:09,010 All right, now what we'd like to demonstrate 353 00:21:09,010 --> 00:21:14,140 is the actual frequency response of the overall continuous time 354 00:21:14,140 --> 00:21:15,130 filter. 355 00:21:15,130 --> 00:21:19,570 And we can do that by sweeping the system 356 00:21:19,570 --> 00:21:21,430 with a sinusoidal input. 357 00:21:21,430 --> 00:21:23,150 And what we expect to see, of course, 358 00:21:23,150 --> 00:21:26,080 is as the sinusoidal input frequency gets 359 00:21:26,080 --> 00:21:29,440 past the effective cutoff frequency, 360 00:21:29,440 --> 00:21:34,150 then the output sinusoid is greatly attenuated. 361 00:21:34,150 --> 00:21:36,970 Let's now sweep the filter frequency response. 362 00:21:42,140 --> 00:21:46,160 And there is the filter cutoff frequency. 363 00:21:51,250 --> 00:21:55,270 We can demonstrate the filter characteristics 364 00:21:55,270 --> 00:21:57,320 in several other ways. 365 00:21:57,320 --> 00:22:02,890 One way is to choose, as a display, instead of the output 366 00:22:02,890 --> 00:22:06,760 as a function of time, we can display the output sinusoid 367 00:22:06,760 --> 00:22:08,690 as a function of frequency. 368 00:22:08,690 --> 00:22:12,040 And so we'll observe that on the left-hand scope, 369 00:22:12,040 --> 00:22:13,540 while on the right-hand scope, we'll 370 00:22:13,540 --> 00:22:16,540 have the same trace that we just saw, namely 371 00:22:16,540 --> 00:22:19,750 two traces the upper trace as the input sinusoid, 372 00:22:19,750 --> 00:22:22,420 the lower trace as the output sinusoid. 373 00:22:22,420 --> 00:22:26,050 And in addition to observing the frequency response, 374 00:22:26,050 --> 00:22:29,200 let's also listen to the output sinusoid 375 00:22:29,200 --> 00:22:32,710 and observe the attenuation in the output 376 00:22:32,710 --> 00:22:35,050 as we go from the filter passband to the filter 377 00:22:35,050 --> 00:22:36,100 stopband. 378 00:22:36,100 --> 00:22:39,160 Again, a 20-kilohertz sampling rate and a sweep 379 00:22:39,160 --> 00:22:40,900 range from 0 to 10 kilohertz. 380 00:22:40,900 --> 00:22:43,184 [SOUND WAVES RISE] 381 00:22:48,957 --> 00:22:50,790 Now, of course we're in the filter stopband. 382 00:22:53,780 --> 00:22:59,930 Now, if we increase the sweep range from 10 kilohertz to 20 383 00:22:59,930 --> 00:23:03,420 kilohertz so that the sweep range is equal to the sampling 384 00:23:03,420 --> 00:23:06,210 frequency, in essence, that corresponds 385 00:23:06,210 --> 00:23:10,710 to sweeping out the digital filter from 0 to 2 pi. 386 00:23:10,710 --> 00:23:12,930 And in that case, we'll begin to see 387 00:23:12,930 --> 00:23:15,840 some of the periodicity in the digital filter frequency 388 00:23:15,840 --> 00:23:16,930 response. 389 00:23:16,930 --> 00:23:20,490 So let's do that now with a 20-kilohertz sampling 390 00:23:20,490 --> 00:23:23,445 rate and a sweep range of 0 to 20 kilohertz. 391 00:23:23,445 --> 00:23:25,676 [SOUND WAVES RISE AND FALL] 392 00:23:28,460 --> 00:23:36,770 Now we come near 2 pi, we get back into the passband, 393 00:23:36,770 --> 00:23:41,060 and finally, back to a 0- to 10-kilohertz sweep 394 00:23:41,060 --> 00:23:45,500 so they were again, sweeping only from 0 to pi with regard 395 00:23:45,500 --> 00:23:47,863 to the digital filter. 396 00:23:47,863 --> 00:23:50,809 [SOUND WAVES RISE] 397 00:23:58,670 --> 00:24:01,560 OK, now, what we would like to demonstrate 398 00:24:01,560 --> 00:24:04,840 is the effect of changing the sampling frequency. 399 00:24:04,840 --> 00:24:08,790 And we know that the sampling-- that the effective filter 400 00:24:08,790 --> 00:24:13,440 cutoff frequency is tied to the sampling frequency, 401 00:24:13,440 --> 00:24:16,050 and for this particular filter, corresponds 402 00:24:16,050 --> 00:24:18,990 to a tenth of the sampling frequency. 403 00:24:18,990 --> 00:24:21,570 Consequently, if we double the sampling frequency, 404 00:24:21,570 --> 00:24:25,770 we should double the effective filter passband width 405 00:24:25,770 --> 00:24:29,010 or double the filter cutoff frequency. 406 00:24:29,010 --> 00:24:31,380 And so let's do that now. 407 00:24:31,380 --> 00:24:34,140 Again, a 0 to 10 kilohertz sweep range, 408 00:24:34,140 --> 00:24:38,307 but a 40-kilohertz sampling frequency. 409 00:24:38,307 --> 00:24:40,602 [SOUND WAVES RISE] 410 00:24:40,602 --> 00:24:45,040 And we should observe that the filter cutoff frequency has now 411 00:24:45,040 --> 00:24:47,200 doubled out to 4 kilohertz. 412 00:24:49,850 --> 00:24:54,260 Now let's begin to decrease the filter sampling frequency. 413 00:24:54,260 --> 00:24:56,890 So from 40, let's change the sampling frequency 414 00:24:56,890 --> 00:24:58,620 to 20 kilohertz. 415 00:24:58,620 --> 00:25:03,354 And we should see the cutoff frequency cut in half. 416 00:25:03,354 --> 00:25:05,844 [SOUND WAVES RISE] 417 00:25:12,330 --> 00:25:13,970 Now we can go even further. 418 00:25:13,970 --> 00:25:16,910 We can cut the sampling frequency down to 10 kilohertz. 419 00:25:16,910 --> 00:25:20,160 And remember that the sweep range is 0 to 10 kilohertz. 420 00:25:20,160 --> 00:25:24,506 So now we'll be sweeping from 0 to 2 pi. 421 00:25:24,506 --> 00:25:26,876 [SOUND WAVES RISE] 422 00:25:30,200 --> 00:25:33,490 So as we get close to 2 pi, we'll see the passband again. 423 00:25:33,490 --> 00:25:35,560 [SOUND WAVES FALL] 424 00:25:35,560 --> 00:25:40,200 And now, let's cut down the sampling frequency even further 425 00:25:40,200 --> 00:25:43,965 to 5 kilohertz. 426 00:25:43,965 --> 00:25:46,310 [SOUND WAVES RISE] 427 00:25:47,250 --> 00:25:48,928 Here we are at 2 pi. 428 00:25:48,928 --> 00:25:51,320 [SOUND WAVES RISE] 429 00:25:51,320 --> 00:25:53,000 And then at 4 pi. 430 00:25:53,000 --> 00:25:54,590 [SOUND WAVES FALL] 431 00:25:54,590 --> 00:25:58,640 Now finally, let's demonstrate this effect 432 00:25:58,640 --> 00:26:02,570 of changing the effective filter cutoff 433 00:26:02,570 --> 00:26:06,200 frequency by changing the sampling rate by carrying out 434 00:26:06,200 --> 00:26:09,380 some low-pass filtering on some live audio. 435 00:26:09,380 --> 00:26:13,520 And we'll demonstrate this by listening to the audio, 436 00:26:13,520 --> 00:26:20,750 and also, observing the audio on on a single trace, namely, 437 00:26:20,750 --> 00:26:22,430 the time waveform. 438 00:26:22,430 --> 00:26:26,680 And we'll begin it with a sampling frequency of 40 439 00:26:26,680 --> 00:26:31,550 kilohertz, change that then to 20 kilohertz, 10 kilohertz, 5, 440 00:26:31,550 --> 00:26:34,580 and then 2 and 1/2, corresponding to a filter 441 00:26:34,580 --> 00:26:38,570 cutoff frequency then of 4 kilohertz, then 2 kilohertz, 442 00:26:38,570 --> 00:26:43,520 then 1 kilohertz, then 500, , 250 etc. 443 00:26:43,520 --> 00:26:46,250 So let's begin 40 kilohertz. 444 00:26:46,250 --> 00:26:49,916 And then we'll work our way down. 445 00:26:49,916 --> 00:26:52,286 [MUSIC PLAYING] 446 00:26:54,660 --> 00:26:58,470 Now, let's reduce that to a 20-kilohertz frequency 447 00:26:58,470 --> 00:27:00,220 or a 2-kilohertz filter. 448 00:27:00,220 --> 00:27:02,720 [MUSIC PLAYING] 449 00:27:05,550 --> 00:27:07,760 And 10 kilohertz sampling frequency. 450 00:27:07,760 --> 00:27:13,130 [MUSIC PLAYING] 451 00:27:13,130 --> 00:27:15,850 And finally, a 5-kilohertz sampling frequency 452 00:27:15,850 --> 00:27:20,480 corresponding to make 500-cycle equivalent analog filter. 453 00:27:20,480 --> 00:27:22,815 [MUSIC PLAYING] 454 00:27:25,620 --> 00:27:27,370 All right, now let's finally conclude 455 00:27:27,370 --> 00:27:31,020 by returning to a little higher quality ragtime 456 00:27:31,020 --> 00:27:34,580 by changing the sampling rates back to 40 kilohertz. 457 00:27:34,580 --> 00:27:37,330 [MUSIC PLAYING]