1 00:00:00,890 --> 00:00:05,854 So in this video, I want to go through an extended example that compares analog and 2 00:00:05,854 --> 00:00:09,624 digital communication. So, what I'm going to assume is that I 3 00:00:09,624 --> 00:00:13,990 have an analog signal that I want to send from one place to another. 4 00:00:13,991 --> 00:00:20,339 I have two choices, I can use amplitude modulation, completely analog system. 5 00:00:20,340 --> 00:00:28,240 Or I can run the analog signal, sample it with an A to D converter, converts it to 6 00:00:28,240 --> 00:00:31,736 bits. Use digital communication schemes and then 7 00:00:31,736 --> 00:00:35,329 put it through a D to A to get back your original signal. 8 00:00:35,329 --> 00:00:39,295 Which is better? Particularly, when you are trying to use 9 00:00:39,295 --> 00:00:42,532 the same channel for both. So, I'm trying to make a very fair 10 00:00:42,532 --> 00:00:46,497 comparison. So, we're going to send, compare an analog 11 00:00:46,497 --> 00:00:50,403 and digital scheme, who are on the same channel. 12 00:00:50,404 --> 00:00:56,326 Our criterion for quality, our criterion for which one wins, is going to be the one 13 00:00:56,326 --> 00:01:01,497 that produces the largest signal-to-noise ratio in the final result. 14 00:01:01,498 --> 00:01:07,727 That's going to be our test to see which one is better. 15 00:01:07,728 --> 00:01:14,684 Now as we've seen in previous videos, analog communication because of the 16 00:01:14,684 --> 00:01:19,467 channel noise is going to result in a noisy signal. 17 00:01:19,468 --> 00:01:22,719 And we already know what that signal-to-noise ratio is. 18 00:01:22,719 --> 00:01:26,680 And I'm just going to, recall that result and use it. 19 00:01:26,680 --> 00:01:30,680 We're going to have to do a bit of calculation though for the digital 20 00:01:30,680 --> 00:01:33,790 channel. And I want to point out some things before 21 00:01:33,790 --> 00:01:37,227 we go into the details. Recall that because of the amplitude 22 00:01:37,227 --> 00:01:41,457 quantization in the A to D converter. That introduces an unrecoverable error. 23 00:01:41,457 --> 00:01:48,174 Once you quantize to bits, you can not get back the original analog signal perfectly. 24 00:01:48,174 --> 00:01:54,808 So that results in a, a unrecoverable error that we won't be able to do anything 25 00:01:54,808 --> 00:01:59,712 about. Also the channel introduces error because 26 00:01:59,712 --> 00:02:06,175 the probability of error in receiving a bit correctly is not zero. 27 00:02:06,175 --> 00:02:13,590 So that also introduces noise into the result, which makes the SNR go down. 28 00:02:13,591 --> 00:02:18,255 So guess what? No matter if it's analog or digital the 29 00:02:18,255 --> 00:02:24,802 result is going to be noisy. So we have to learn how to live with that 30 00:02:24,802 --> 00:02:30,681 and that's just a fact of life. More than that, which one results in the 31 00:02:30,681 --> 00:02:35,154 smallest amount of noise? Which one is better? 32 00:02:35,155 --> 00:02:40,437 And, so here's the conditions for my little test here. 33 00:02:40,438 --> 00:02:48,185 I'm assuming I have a baseband signal. That has a bandwidth of 8 kHz I'm sorry 4 34 00:02:48,185 --> 00:02:52,490 kHz. I'm just using this as an example a 4 kHz 35 00:02:52,490 --> 00:02:56,107 signal. And for the digital side it's going to be 36 00:02:56,107 --> 00:03:00,471 sampled with a B-bit converter. I'm going to let the number of bits be 37 00:03:00,471 --> 00:03:03,295 your variable here to see what the effect of that is. 38 00:03:03,296 --> 00:03:08,804 This happen can be little bit surprised in how long how that effects the results. 39 00:03:08,804 --> 00:03:13,037 Well, so lets go through the analog system. 40 00:03:13,038 --> 00:03:20,018 I have to use in modulated scheme and so we know that if you have a bandwidth of w 41 00:03:20,018 --> 00:03:26,756 the transmission band width. That you use in doing analog is twice that 42 00:03:26,756 --> 00:03:31,442 bandwidth so we have an 8 kHz transmission bandwidth. 43 00:03:31,442 --> 00:03:37,805 And we also know from previous results that the signal-to-noise ratio that 44 00:03:37,805 --> 00:03:41,670 received a message signal has that formula. 45 00:03:41,671 --> 00:03:46,832 I do want to point out that I have not written the alpha from the channel in 46 00:03:46,832 --> 00:03:52,037 here, the channel insinuation. I'm just merging that with A. 47 00:03:52,038 --> 00:03:56,571 As you know, the correct expression isn't alpha squared A squared. 48 00:03:56,571 --> 00:04:00,516 And so, I'm just going to merge the two into one symbol so. 49 00:04:00,517 --> 00:04:04,928 So we simplify the expressions a little bit. 50 00:04:04,929 --> 00:04:10,845 Okay, now for digital communication we have to sample, and we're going to have to 51 00:04:10,845 --> 00:04:16,248 sample at a sampling frequency of 8 kHz, twice the highest frequency. 52 00:04:16,248 --> 00:04:20,075 Okay, and we also know that the transmission bandwidth. 53 00:04:20,076 --> 00:04:28,287 Is 3 times r for modulated bpsk which is a very good signal set. 54 00:04:28,288 --> 00:04:35,260 So the data rate is going to be the sampling rate, 8 kilohertz times the 55 00:04:35,260 --> 00:04:42,434 number of bits in that a to d converter. Because we have to send the same signal 56 00:04:42,434 --> 00:04:46,330 every capital T seconds, T being the sampling interval. 57 00:04:46,330 --> 00:04:52,833 You use more bits, you're going to have to have a higher transmission bandwidth 58 00:04:52,833 --> 00:04:58,902 because the data rate goes up. So we're going to use this result a little 59 00:04:58,902 --> 00:05:03,732 bit later. So again to repeat what I said on the 60 00:05:03,732 --> 00:05:08,978 first line, the digital side of things, the final signal you get out of the 61 00:05:08,978 --> 00:05:14,438 communication system is the original signal plus the quantization error. 62 00:05:14,438 --> 00:05:19,623 Which is due to the A to D converter's amplitude quantization plus the 63 00:05:19,623 --> 00:05:23,517 communication error, the effect of Pe not being zero. 64 00:05:23,518 --> 00:05:28,888 So we're going to f-figure out each of these and just add them up and then 65 00:05:28,888 --> 00:05:33,411 compute a signal to noise ratio. So the quantization error we've gone 66 00:05:33,411 --> 00:05:35,707 through. So some more little details are we're 67 00:05:35,707 --> 00:05:41,565 going to assume that the signal. As an amplitude that's less than, 1. 68 00:05:41,566 --> 00:05:49,642 Just, so I can scale things appropriately. And if you express the final result out of 69 00:05:49,642 --> 00:05:54,107 the A to D converter. And then the D to A in terms of bits. 70 00:05:54,108 --> 00:06:00,155 You get this, for the formula. So to understand this let's suppose we 71 00:06:00,155 --> 00:06:03,630 draw our, our diagram that we've been doing. 72 00:06:03,630 --> 00:06:10,565 So signal goes between minus 1 and 1. And we're use, we're dividing this up into 73 00:06:10,565 --> 00:06:16,882 quantization intervals somehow. So if you set all the bits in this 74 00:06:16,882 --> 00:06:22,705 expression to 0, what you get for a result is minus 1. 75 00:06:22,705 --> 00:06:28,928 So 0, 0, 0, 0, 0, our remaining bits we use, is going to correspond to an 76 00:06:28,928 --> 00:06:34,080 amplitude of minus 1. And when you set it equal to all 1s, 77 00:06:34,080 --> 00:06:41,640 you'll get something very close to 1, if you evaluate this expression, so that's 78 00:06:41,640 --> 00:06:46,820 the, this forum formula does not really come out of the air. 79 00:06:46,820 --> 00:06:53,705 It's just trying to relate bits to an amplitude that's in this range, okay. 80 00:06:53,706 --> 00:07:00,274 Well, when it's received we're going to have a quantiza-, we're going to have an 81 00:07:00,274 --> 00:07:05,405 error because the received bits aren't necessarily the same. 82 00:07:05,405 --> 00:07:11,221 And that's called a Channel Error. But because the fact, back in the analog 83 00:07:11,221 --> 00:07:17,759 and digital converter, we did not get back exactly the answer that we started with. 84 00:07:17,760 --> 00:07:20,320 We have already figured out in a previous video. 85 00:07:20,320 --> 00:07:25,809 That that's the power in the error. 2 to the minus 2b, B being the number of 86 00:07:25,809 --> 00:07:31,050 bits in the converter, divided by 3. And this result we derive previously. 87 00:07:31,050 --> 00:07:33,982 But now we're going to look at the channel errors. 88 00:07:33,982 --> 00:07:40,677 Now, the channel errors, The resulting error because of errors in the 89 00:07:40,677 --> 00:07:48,203 communication just revolve around the fact that the transmitted bit and the receive 90 00:07:48,203 --> 00:07:53,650 bit are not the same. So we want the power in that error and I'm 91 00:07:53,650 --> 00:08:01,037 going to write that in kind of a new way. These angle brackets mean average. 92 00:08:01,037 --> 00:08:05,267 So that's a typical notation for main average. 93 00:08:05,268 --> 00:08:10,770 So we're going to square the error in average, to get an idea what the average 94 00:08:10,770 --> 00:08:16,376 power in the error is. If you go through the calculations, what 95 00:08:16,376 --> 00:08:23,736 you discover is just the average Of the square of the difference between the 2 96 00:08:23,736 --> 00:08:26,924 bits. So we have to figure out now what that 97 00:08:26,924 --> 00:08:30,037 average is and it's a pretty easy calculation. 98 00:08:30,037 --> 00:08:34,797 So, it's pretty clear, when the bits agree that, that difference is 0 and there's 99 00:08:34,797 --> 00:08:41,198 nothing that contributes to the. Average, you know term that we'll get is 100 00:08:41,198 --> 00:08:45,976 when the bits disagree. So we could have sent a zero, and received 101 00:08:45,976 --> 00:08:50,073 a one. And we could have sent a one and received 102 00:08:50,073 --> 00:08:54,092 a zero. Well these errors occur with a probability 103 00:08:54,092 --> 00:09:01,830 of pe. But the probability we send to zero or 104 00:09:01,830 --> 00:09:08,058 send to one is a half. So that makes the total probability of 105 00:09:08,058 --> 00:09:13,592 that term being a half Pe. Total probability for this term being a 106 00:09:13,592 --> 00:09:19,890 half and they all add up to just be Pe so it turns out this averaging term here is 107 00:09:19,890 --> 00:09:24,683 really quite easy to see. I do wnat to piont out something else 108 00:09:24,683 --> 00:09:28,270 before we go on. Some bits matter more than others. 109 00:09:28,270 --> 00:09:33,661 Notice this exponent out here. This has to do with the fact that the 110 00:09:33,661 --> 00:09:39,268 higher bit, the one that has a bigger value of k here, you make an error in that 111 00:09:39,268 --> 00:09:43,436 bit, it really effects the result for the error. 112 00:09:43,436 --> 00:09:48,826 If the smaller bit were k0, doesn't has, have as much effect. 113 00:09:48,826 --> 00:09:54,856 So some errors and some bits matter more than others and we want to see the overall 114 00:09:54,856 --> 00:10:00,712 effect of channel errors. Okay so, so I'm using my result that Pe 115 00:10:00,712 --> 00:10:07,656 was the average value here, it's a constant, and to sum this term up it turns 116 00:10:07,656 --> 00:10:14,593 out that's a finite geometric series, which we've already talked about. 117 00:10:14,594 --> 00:10:19,905 And once you do all those calculations, this is what you wind up with. 118 00:10:19,905 --> 00:10:25,267 Now, 2 to the 2b, I'm going to assume, is a whole lot bigger than 1. 119 00:10:25,268 --> 00:10:31,299 Which is normally the case. And that's where the approximation, 120 00:10:31,299 --> 00:10:35,382 approximate sign comes in. And once you drop that one. 121 00:10:35,382 --> 00:10:42,414 And to simplify, you get 4 3rds Pe. So you get a rather simple result for the 122 00:10:42,414 --> 00:10:47,078 channel error. So that's the, power and the channel error 123 00:10:47,078 --> 00:10:50,748 we have the power and the quantization error. 124 00:10:50,748 --> 00:10:55,455 And so the final result for the SNR, our digital communications scheme. 125 00:10:55,456 --> 00:11:04,166 Is, there's the signal power, of course, and I just add up the two powers from 126 00:11:04,166 --> 00:11:10,321 quantization and channel errors. Okay. 127 00:11:10,322 --> 00:11:15,870 So, there's a little detail here, and that is we have to be fair about the 128 00:11:15,870 --> 00:11:20,896 transmitter power I want to make the transmitter power the same. 129 00:11:20,897 --> 00:11:30,007 So, I'm going to recall something here. So, recall for digital that the energy per 130 00:11:30,007 --> 00:11:35,517 bit which si the critical part of probability of error expression is A 131 00:11:35,517 --> 00:11:40,875 squared T. Well T is the dur-, is the bit interval 132 00:11:40,875 --> 00:11:43,323 duration. And so, what's T? 133 00:11:43,323 --> 00:11:51,064 And T, as I wrote in the previous slide, is 1 over R. 134 00:11:51,064 --> 00:11:58,041 So, R, the data rate, is the sampling frequency times the number of bits in the 135 00:11:58,041 --> 00:12:02,872 A to D converter. So relating it back to bandwidth and bits 136 00:12:02,872 --> 00:12:09,237 this is expression we get and so you figure it all our amplitude squared which 137 00:12:09,237 --> 00:12:15,602 is from the transmitter in the effect of the channel Its related to the energy per 138 00:12:15,602 --> 00:12:21,640 bit through this expression. So I'm going to take my analog expression, 139 00:12:21,640 --> 00:12:25,570 and convert it into something that's related to what I call Es. 140 00:12:25,570 --> 00:12:28,660 Which is the energy per bit times the number of bits. 141 00:12:28,660 --> 00:12:33,383 So Es is the energy per sample that's used in the communications scheme. 142 00:12:33,383 --> 00:12:37,639 I want to keep that the same between the analog and digital. 143 00:12:37,639 --> 00:12:44,530 Systems so I can compare them fairly. So our signal to noise ratio here, is 144 00:12:44,530 --> 00:12:48,550 given by this. Notice the power in s disappeared because 145 00:12:48,550 --> 00:12:51,145 its going to be the same in both expressions. 146 00:12:51,146 --> 00:12:55,353 I'm assuming basically it's one, just to keep it simple. 147 00:12:55,353 --> 00:12:58,508 And here's Pe. And here's Pe. 148 00:12:58,508 --> 00:13:06,176 So it's for a QPSK thing. The result was 2Eb over N not. 149 00:13:06,176 --> 00:13:16,328 And i've simply substituted in Es for that so I can explicitly take into account how 150 00:13:16,328 --> 00:13:21,040 many bits are being So what I'm going to do. 151 00:13:21,040 --> 00:13:26,840 I'm going to plot this as a, the analog system as a function in Es or N not. 152 00:13:26,840 --> 00:13:34,022 I'm going to plot the result of this communication schemes a function of Es 153 00:13:34,022 --> 00:13:38,101 over N not. And Es over N not, remember is the 154 00:13:38,101 --> 00:13:44,408 basically summarizes how much and attenuation was used in the, the 155 00:13:44,408 --> 00:13:49,832 transmitter and the channel compared to the channel noise. 156 00:13:49,832 --> 00:13:55,981 So this is the axis we want to compare on. And I've plotted the analog and digital 157 00:13:55,981 --> 00:14:02,815 cases here the digital for two different bits in the A to D converter. 158 00:14:02,815 --> 00:14:07,589 And as we showed, the analog is the simplest because the overall 159 00:14:07,589 --> 00:14:13,799 signal-noise-ratio for the at the output is the same as Es over N not, so you get a 160 00:14:13,799 --> 00:14:16,342 straight line. And that's the equality line. 161 00:14:16,343 --> 00:14:22,360 So. For 4 bits is the dash curve. 162 00:14:22,360 --> 00:14:27,266 For 8 bits you get the solid red curve. It's kind of interesting. 163 00:14:27,266 --> 00:14:32,548 Let's see if we can understand this. First of all, as the Channel 164 00:14:32,548 --> 00:14:40,013 Signal-to-noise ratio goes up. Pe basically is going to 0. 165 00:14:40,013 --> 00:14:44,012 So what happens is you're left with the, with the quantization errors. 166 00:14:44,012 --> 00:14:48,979 So these are the limits of the quantization error, and as we know, the 167 00:14:48,979 --> 00:14:54,808 more bits you use, the smaller that error gets, which, since this is the signal to 168 00:14:54,808 --> 00:15:00,097 noise ratio That means the SNR goes up. So that part I understand. 169 00:15:00,098 --> 00:15:03,854 You go down to the other extreme, Pe is basically a half. 170 00:15:03,854 --> 00:15:10,159 No matter how many bits you use, because the channel is really, really, really 171 00:15:10,159 --> 00:15:14,221 noisy. So that's why these two curves converege. 172 00:15:14,222 --> 00:15:22,825 In between it's interesting, that the 4 bit result gives you a higher SNR than the 173 00:15:22,825 --> 00:15:27,744 8 bit result. And the reason for that is, because Pe for 174 00:15:27,744 --> 00:15:33,994 the four bit case is actually smaller than it is for the eight bit case. 175 00:15:33,995 --> 00:15:41,281 Because you're dividing up time less from dividing it by 4 rather than 8. 176 00:15:41,282 --> 00:15:50,923 That has an effect of producing a slightly bigger SNR in the result using 4 bits. 177 00:15:50,923 --> 00:15:55,030 But only for a while. Once the SNR gets big enough the 8 bit 178 00:15:55,030 --> 00:16:00,533 becomes far superior. However, can't lose sight of the fact, 179 00:16:00,533 --> 00:16:05,428 that the digital curves, lie above the analog curves. 180 00:16:05,428 --> 00:16:14,954 So, in this comparison, the analog system is inferior, it's worse than digital 181 00:16:14,954 --> 00:16:18,725 systems. This is despite the fact we introduce 182 00:16:18,725 --> 00:16:22,950 error in the A to D converters, that we can never get around. 183 00:16:22,950 --> 00:16:29,975 It's clear that at least in this comparison that analog is not as good as 184 00:16:29,975 --> 00:16:35,330 digital. So, digital wins. 185 00:16:35,330 --> 00:16:40,563 And that's the kind of analysis that you want to do as an engineer to figure out 186 00:16:40,563 --> 00:16:46,278 which scheme is going to work. You use some criterion, like the signal to 187 00:16:46,278 --> 00:16:50,217 noise ratio for the, final receive message. 188 00:16:50,218 --> 00:16:56,730 And then you pick your design criterion here is analog or digital according to 189 00:16:56,730 --> 00:17:00,147 that choice. There is a little caveat here, I do want 190 00:17:00,147 --> 00:17:05,142 to point out, that one thing that isn't fair with this comparison is that channel 191 00:17:05,142 --> 00:17:09,582 bandwidth needed for analog is much smaller that viewed for the digital 192 00:17:09,582 --> 00:17:15,012 schemes we just talked about. Digital transmission bandwidth, like I 193 00:17:15,012 --> 00:17:18,978 said, is twice the highest frequency of the message so it's just 8 kHz. 194 00:17:18,978 --> 00:17:25,911 However, for 4 bits you need 96 kHz and for 8 bits you need twice that much so in 195 00:17:25,911 --> 00:17:30,124 some sense this isn't a very fair comparison. 196 00:17:30,124 --> 00:17:35,227 So what that means. Is that, what happens if you make them the 197 00:17:35,227 --> 00:17:37,390 same? What happens if you constrain the 198 00:17:37,390 --> 00:17:40,376 transmission bandwidth to be the same for both cases. 199 00:17:40,376 --> 00:17:48,744 Well, it turns out that if you constrain, digital schemes to work within a 8 kHz 200 00:17:48,744 --> 00:17:51,359 regime. You can show that. 201 00:17:51,360 --> 00:17:55,230 Amplitude modulation, the analog scheme now wins. 202 00:17:55,230 --> 00:18:00,082 It always results in a higher SNR, it's kind of interesting. 203 00:18:00,082 --> 00:18:05,432 However, if you use more bandwidth than that, something like this, it turns out 204 00:18:05,432 --> 00:18:11,400 you basically cannot effectively use that extra bandwidth for analog communication. 205 00:18:11,400 --> 00:18:16,263 It doesn't have that flexibility. And then it turns out digital ones. 206 00:18:16,263 --> 00:18:23,221 So, in the grand scheme of things, overall this is one of the reasons why, in the 207 00:18:23,221 --> 00:18:30,082 modern uses, everything is being converted to bits and sent in a digital way. 208 00:18:30,082 --> 00:18:37,524 Now, I'm going to talk about a situation In a upcoming videos, we'll find out, that 209 00:18:37,525 --> 00:18:44,865 you can actually send bits through a noisy channel with Pe winding up being zero. 210 00:18:44,865 --> 00:18:47,545 And we're going to figure out how that works. 211 00:18:47,545 --> 00:18:49,773 And it involves some very clever engineering. 212 00:18:49,773 --> 00:18:55,103 And we'll see that in, in the coming, upcoming videos.