------------------------------------------------- attenuation: dB = 10 * log_10 (Pr / Ps) dB: attenuation in decibels Pr: Power Recieved Ps: Power Sent log_10: log base 10. ---------------------------------------------- we transmitted 1000W of signal, and recieved 870W, what's the attenuation? ln: natural log 10 * log_10 (1000W / 870) = 10 * ln(1000/870)/ln(10) = 0.60481 dB ---------------------------------------------- Nyquist Capacity C = 2*B*log_2 (M) C: capacity in bits-per-second B: bandwidth in Hz log_2: log of base 2 M: # voltage levels -------------------------------------------------- We have bandwidth between 4kHz and 8kHz, how many voltage levels do we need to achieve 16Kbps? 8-4 = 4kHz bandwidth 16Kbps = 2 * 4kHz * log_2(M); find M ? 8 = 4 * logM 2 = log_2(M) M = 4, answer: 4 voltage levels. ---------------------------------------------------- We will use 8 voltage levels, and we wish to get capabity of 32Kkbps, what is the bandwidth requirement? 32Kbps = 2 * B * log(8)/log(2) 32Kbps = 2 * 3 * B; find B? B = 32 / 6 = ~5.3kHz = 5.4kHz -------------------------------------------- Shannon Capacity C = B * log_2 ( 1 + SNR) SNR = Signal / Noise occasionally, folks express signal/noise ratio in decibels: SNR_dB = 10 * log_10 ( Signal / Noise ) Entropy: H = - SUM p_i * log(p_i) ----------------------------------------------- Bandwidth is 32kHz, SNR: 7 what's the maximum capacity we can achieve? C = 32kHz * log(1+7)/log(2) <-- calculate log base 2 C = 32kHz * 3 = 96Kbps ------------------------------------------------ We wish to achieve 96Kbps capacity, on our 32kHz channel, what's the SNR ratio we need to have? 96 = 32 * log(1 - SNR)/log(2); find SNR? SNR: 7 ------------------------------------------------- ticky part: SNR may be expressed in decibels: SNR_dB = 10 * log_10 ( Signal / Noise ) SNR_dB = 10 * log(7)/log(10) = 8.4510 ------------------------------------------------- Bandwidth is 32kHz, SNR_dB: 8.45 what's the maximum capacity we can achieve? First need to find SNR: 8.45 = 10 * log_10( SNR ); find SNR? 10^(8.45/10) = ~7. Then we can calculate C: C = 32kHz * log(1+7)/log(2) <-- calculate log base 2 C = 32kHz * 3 = 96Kbps ---------------------------------------------- C = 2 B log_2(M) = B * log_2(SNR+1) We have 32kHz channel, and we will use 8 voltage levels. What capacity can we achieve? C = 2 * 32 * log(8)/log(2) = 2*32*3 = 192Kbps To achieve that capacity, what SNR is required? 192 = 32 * log_2(SNR+1) 6 = log_2(SNR + 1) SNR + 1 = 64 SNR = 63 ----------------------------------------------- we're transmitting data at 1000bps, we observe that 5% of the bits are flipped (errors). What is the maximum theoretical error-free capacity of this channel? shannon paper: http://theparticle.com/cs/bc/dsci/entropy.pdf A sending data to B at 1000bps, error rate is 5%, about 50 bits are flipped every second. possible answer: 950bps error free (the non-flipped bits?). entropy of "errors": (error) (no error part) -( 0.05*log(0.05)/log(2) + 0.95*log(0.95)/log(2) ) = 0.28640 1000 * 0.28640 = 286bps of errors we're transmitting 1000bps, out of which 286bps are consumed by errors, so maximum error free capacity that we might achieve is: 1000 - 286 = 714bps (other neat papers: http://theparticle.com/cs/bc/dsci/kelly_56.pdf ) error correction: https://en.wikipedia.org/wiki/Hamming_code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 p1, p2, d1, p3, d2, d3 d4 p4 d5 d6 d7 d8 d9 d10 d11 to transmit 11 bits, with 1-bit flip error correction, we can add 4bits of redunduncy (parity bits). 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 11 1011 12 1100 13 1101 14 1110 15 1111 p1: parity of bits: 1, 3, 5, 7, 9, 11, 13, 15 p2: parity of bits: 2, 3, 6, 7, 10, 11, 14, 15 p3: parity of bits: 4, 5, 6, 7 12, 13, 14, 15 p4: parity of bits: 8, 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 p1 p2 d1 p3 d2 d3 d4 p4 d5 d6 d7 d8 d9 d10 d11 transmit: 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 p1 p2 p3 p4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 p1 p2 d1 p3 d2 d3 d4 p4 d5 d6 d7 d8 d9 d10 d11 recieve: 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 p4 p3 p2 p1 ^ 0 1 1 1 = 7