 So, we looked at Nyquist capacity, an equation that tells us the relationship between the bandwidth of our communications channel, the number of levels that we use in the signal to transmit the data, M, and the data rate that we can achieve, how many bits per second we can deliver. Increasing the bandwidth increases our data rate, increasing the number of levels increases the data rate. That's what the equation tells us. We can calculate some values, we did that yesterday. One thing the equation doesn't tell us is that increasing the number of levels causes more errors. That's not captured in this equation because that's due to noise causes more errors. It's harder for the receiver to receive the data in that case. Because this equation, the Nyquist capacity equation assumes there is no noise. So it's true if there is no noise, just increase M, but in reality there is noise in communication systems. So we need to look at it from other viewpoints as well. The example we went through, we went through for the case, a semi-realistic case of a telephone line you have coming into your home. The bandwidth available for voice calls is 3,100 hertz and the old dial-up modems would use that bandwidth to send data instead of voice. So we calculated the Nyquist capacity for the telephone line and if we had two levels we got 6,200 bits per second then a few other examples we got down to get about 56 kilobits per second. We needed 512 levels in the transmitted signal. 56 kilobits per second was a typical data rate available for your dial-up modems. Getting higher data rate, going from 56 kilobits per second up to 100 up to 1,000 kilobits per second would require M going very, very high, which causes more errors and the trade-off was that at that small amount of bandwidth it doesn't make sense to try and send much higher data rate. So what happened with internet? When you after dial-up internet what become the way for you to access the internet? So after dial-up access people started to move to ADSL as well as cable modems. ADSL, and this is not the topic, but ADSL uses the same telephone line that is not limited to just the 3,100 hertz, ADSL took advantage of the fact that the telephone line actually allowed up to about 1 megahertz. So what ADSL did, one approach for increasing the data rates up to 1 up to 20 megabits per second, it uses a larger bandwidth. So the advantages in technology made that possible. But what if there's noise? So that's the example we went through. The question is, well how much capacity can we achieve if there's noise in the system? And Shannon came up with another relationship between bandwidth and capacity that depends upon noise, which is more realistic because in every communication system there is noise. The equation given here, the bandwidth times log in base 2 of 1 plus SNR. What's SNR? B is bandwidth, C is the capacity that we calculate, SNR is the signal-to-noise ratio. So we'll talk about that first, give a couple of examples of SNR and then we'll see it's quite easy to calculate capacity and to rearrange this formula to solve some problems. Similar to noise ratio, SNR is quite simply the received signal power divided by the received noise power. So our signals, we measure the strength of those signals. The data signal that was transmitted, we receive something, so we measure the strengths. And similarly we can measure the strength of the noise that we receive from others. And SNR is just the ratio between those two. So let's look at some examples of how we measure signals and how we may express the strength of signals and then calculate SNR for some examples. In the past examples we've spoke about, we've given plots of, we said S of t, S of t was the transmitted signal. We had an equation for the signal as a function of time. What were the units I used to indicate the signal strength? Remember the time-domain plots on the x-axis we have time and on the y-axis we have what? Signal strength measured in what units? Volts is some of the, I think is what I used in the earlier slides. So measured in volts. That's the signal strength, so it goes from say minus one volt up to plus one volt. But we can also convert volts to watts, a watt. And power is also measured in, or the signal strength also measured in watts. Why? If you remember your relationship that power in watts is voltage times amps. So if you know the volts, the number of volts, you know that the number of amps in the system then you can determine the power in watts. So there's a proportional relationship between volts and watts. So often we mix sometimes volts, sometimes watts. But it measures the strength, the height of the signal. In fact in most of the examples from now on we'll talk about watts. So we talk about the strength of a signal in the peak amplitude, same measured in watts. So let's say we transmit a signal, TX to transmit. And let's say we measure the strength of that signal and it's 10 watts. That is the peak strength of that signal is 10 watts. We transmit the signal. Remember the signal attenuates over distance. So we transmit the signal and the power, the strength gets weaker over distance. So we can talk about receiving the, at the receiver, we can talk about the, this signal is received, we can say it's the attenuated signal, alright, the attenuated. That is the signal given the attenuation across the link. The power of that received attenuated signal is going to be less than the transmitted one. So how much less, we don't really know yet. We'll see in a later topic we can calculate that under some conditions. But at this stage I'm just going to make up a number and say our attenuation is a factor of 2. Which means if we transmit at 10 watts we have, the attenuated signal is half of the transmitted one. So we receive at 5 watts. Just as an example. It depends on many factors. Distance, frequency, antennas in wireless systems and other main things. So in this example I'm just saying we transmit at 10 watts and assuming no noise we would receive a signal which is 5 watts in strength. But there is noise. So we can also measure noise, treat noise as a signal. The noise signal, we could measure how strong the noise is as well. And express that in watts. What is noise? From the perspective of the receiver, so someone transmits me a signal. From my perspective that transmitted signal that I receive, the attenuated one is the data. The noise is all the other transmissions I receive. So for example in this class when I'm talking I'm transmitting a signal from your perspective, hearing my voice is the data, that's the attenuated signal that you receive. From all the other people talking, from the air conditioners, from the door shut, shutting and so on, that's noise. That all combines to be noise from your perspective. So everything else that you hear is noise relative to the data you receive. So noise can be in a communication system, we've talked about different factors. There's thermal noise, there's noise from some impulse or spike, there's noise from other signals, other transmissions. Let's say we can measure the total strength, the strength of the total noise and we measure it to be, let's start simple, one watt. So the receiver receives the data at a strength of five watts and receives the noise at a strength of one watt, the signal to noise ratio is just the ratio of those two values. When we, the word signal in the signal to noise ratio refers to the attenuated or received data signal. Signal to noise ratio, SNR for short, in this case is five watts divided by one watt, the attenuated signal received divided by the noise received. And the watts cancel out so it becomes dimensionless, it's just a ratio of five, there are no units there. Simply means that the received data signal is five times larger than the noise and the signal to noise ratio has an impact upon how fast we can receive or how fast we can transmit our data across the link. Increasing the noise relative to the signal will reduce the amount of data that we can receive. We tried this example I think last week when I speak at some level, someone at the back could hear me, if I speak at the same level, the same signal level, but other people start talking, the noise increases then it becomes harder for the person at the back to hear me. So less information gets communicated as the noise starts to increase. And that's what the Shannon capacity equation captures. So the first point signal to noise ratio, the ratio between the received data signal here I've listed it as the attenuated signal, the transmit signal taking into account any attenuation across the link divided by the amount of noise we receive. So it's measured at the receiver. Don't get confused if I tell you the transmitted signal is 10 watts, you don't necessarily use that here, you need to look at the received signal. So in the Shannon capacity equation, if we know the bandwidth of the link, if we know the signal to noise ratio for that link at the receiver, we can determine the capacity as B times log base 2 of 1 plus SNR. Let's do a quick example, very easy one. Different example where we have, and I think it's in your lecture notes, there's a slide we have, or it's very similar. We have a transmitted signal, we transmit a signal and let me try and plot in the frequency domain, the spectrum. The frequency ranges in megahertz from 3 up until 4 megahertz. That's the plot in the frequency domain of the signal transmitted. And to keep it simple to get started, let's say we know across that link that we have an SNR of 251. It's not the same as your lecture notes, but you'll see the relationship shortly. Find the capacity. Spend a couple of minutes to find how fast can I send bits through this channel using this signal. Use the Shannon capacity equation. You'll need to know the bandwidth, you'll need to know SNR. Well, basically, I've given you SNR. The bandwidth you'll obtain from the frequency domain plot. What is the bandwidth of our signal transmitted? One watt, not one watt, one unit. Megahertz. So this is not related to Shannon, but the spectrum ranges from 3 megahertz up to 4 megahertz, so the bandwidth is 1 megahertz. So now you can just plug those values into the Shannon capacity equation. Where do we go? B, the bandwidth, 1 megahertz. 1 million hertz. So B is 1 million, 10 to the power of 6. SNR is 251. Plug them in and get the answer for the capacity. And the answer is, anyone? B is 1 mega, 10 to the power of 6. 1 million times log base 2, 1 plus 251. 1 million times log base 2 of 252. Which is about, it's about 8, correct? Log of 252, this is, which is about 256. And you know your computer scientists, you know that 256, the power of 8 is 256. So log in base 2 of 256 is 8. So log in base 2 of 252 is slightly less than 8. 7.9 something. You'll use your calculator to find it. But I will approximate. Log of base 2 of 252 is approximately 8. So we get 8 times 1 million, which is 8 million or 8 megabits per second. Easy to apply the Shannon capacity equation. The only challenge really is knowing when to use it. Because now we have two equations, Nyquist and Shannon. They both tell us the capacity. But which one do we use? Well, the hint is, look at the information that you know. In this question, we knew the signal to noise ratio. And we knew the bandwidth. Well, Shannon capacity equation relates the signal to noise ratio bandwidth capacity. So use the Shannon capacity equation. The Nyquist capacity equation relates bandwidth number of levels M and capacity. So if you know the number of levels, but not the signal to noise ratio, then Nyquist is the way you go. Let's try Nyquist now. Let's say we want to achieve 8 megabits per second. That's what I want. The bandwidth is 1 megahertz. How many levels do I need in my transmitted signal? So we're given a data rate. Given C is 8 megabits per second. Given B is 1 megahertz. How many levels do I need in my transmitted signal? What should M be? So now let's apply Nyquist capacity equation to work out another factor in this. This was using Shannon's equation. What about the Nyquist equation? Capacity is 2 times the bandwidth log base 2 of M, the number of levels. We know the capacity we want to achieve, 8 million, 8 by 10 to the power of 6. We know the bandwidth that we have available, 2 times 1 megahertz, 1 by 10 to the power of 6, times log base 2 of M. Find M. 8 million equals 2 million times log base 2 of M. So 8 million divided by 2 million is 4. So 4 equals log base 2 of M. Find M. Just bring the 2 million to the other side and it becomes 4 equals log base 2 of M, which means M equals 16. 2 to the power of 4 equals 16. So log in base 2 of 16 equals 4. This tells us if we have 1 megahertz of bandwidth and we want to achieve 8 megabits per second, we need at least 16 levels in our transmitted signal. If we had less, we'd never be able to achieve 8 megabits per second. If I had 8 levels with 1 megahertz, I would only be able to achieve what? 2 by 3, 6 megabits per second. So we need at least 16 levels in our signal to achieve the data rate we want. I say at least because these are theoretical models of the relationship between bandwidth and capacity. They are limits. So the Nyquist equation says if the conditions are perfect, there's no noise whatsoever, then if you had 16 levels and a bandwidth of 1 megahertz, you would achieve 8 megabits per second. But in practice, there are other factors. There is noise. So it just tells us what's the lower limit of the number of levels. In practice, we need to use more than 16 to achieve the appropriate data rate. So we use these two equations to work out some limits. In practice, we may not be able to achieve those limits, but we can get close. So it gives us an approximation of how fast we can send data. It doesn't give us the exact value. If you have a link which has 1 megahertz bandwidth and you transmit a signal which has 16 levels, you're not guaranteed in practice to get 8 megabits per second. In theory, yes, if there's no noise. But in practice, there are other things that this equation doesn't capture. So it's used for a quick calculation of how fast we can send under some conditions. Back to our slide. So what do we see from Shannon capacity? Increasing the bandwidth, B, increases the data rate. Same trend that we saw with Nyquist. But the Shannon capacity equation takes into account also signal and noise. So remember, SNR is in fact signal power divided by noise power. So increasing the signal power makes SNR go up. If SNR goes up, the capacity goes up. So increasing the signal power while everything else is the same increases the data rate. But if you increase the noise, keeping the signal power constant, keeping the bandwidth constant, but just increase the noise, SNR will go down and the capacity data rate will go down. So there are three factors in play there. Bandwidth, the signal power and noise. There are some other things, a game which are not captured in this equation, but true in practice. Increasing the bandwidth allows for more noise. So we said increasing the bandwidth increases the data rate, but in practice, the larger the bandwidth, the more noise. The more noise brings this factor down and brings our capacity down. So in practice there's a trade-off there. Also increasing the signal power increases noise to others into modulation noise here. An example of that is when I'm talking, I have the microphone on, you can hear me, but we say increasing the signal power, if I turn up the volume, that will make the data capacity the data rate better. Increasing the signal power increases the data rate. But what's the problem if I turn up the volume here? If we just keep turning up the volume so the signal power gets higher and higher, what's the problem? A practical problem. Assuming we have a perfect amplifier, there's no echo or distortion. The problem is that maybe the people downstairs or the room down the corridor start to hear me, which is really causing interference to their transmissions. So the people in the next lecture room start to hear my transmission, which they don't want to hear. So my transmission from their perspective is noise. So as we increase the signal power, we start to cause noise to other people. So that's the problem there. Any questions on Nyquist capacity or Shannon capacity? You'll see in the lecture notes, actually, next slide, the example we went through. We just went through this example, except in the question on the slide, the SNR is expressed as 24 dB. But in the question I went through, I said it was 251. We haven't explained decibels yet. We'll do that now.