All problems
AWGN Capacity from SNR in dB
Problem
Compute the capacity in bits per channel use of an AWGN channel given the signal-to-noise ratio in decibels:
C = 0.5 * log2(1 + 10^(snr_db / 10))
Hint
First convert decibels to a linear power ratio: 10^(dB / 10).
Test cases
case 1
in: [0]
expected: 0.5
case 2
in: [10]
expected: 1.7297158093186487
case 3
in: [20]
expected: 3.3291057413758973
case 4
in: [-10]
expected: 0.06875176187496751
Starter codePython
import math
def awgn_capacity(snr_db):
# Your code here
pass4 test cases · run your code against them in the editor