All problems
BPSK BER
Problem
Return the bit error rate of BPSK over an AWGN channel given the linear signal-to-noise ratio:
BER = 0.5 * erfc(sqrt(snr))
Hint
The error probability is Q(sqrt(2 * Eb/N0)) with snr = Eb/N0.
Test cases
case 1
in: [0]
expected: 0.5
case 2
in: [1]
expected: 0.07864960352514258
case 3
in: [4]
expected: 0.0023388674905236322
case 4
in: [10]
expected: 0.000003872108215522037
case 5
in: [0.25]
expected: 0.23975006109347674
Starter codePython
import math
def bpsk_ber(snr_linear):
# Your code here
pass5 test cases · run your code against them in the editor