Skip to content

Commit

Permalink
feat: add benchmarking for Viterbi decoder for terminated codes
Browse files Browse the repository at this point in the history
  • Loading branch information
rwnobrega committed Dec 12, 2024
1 parent 3e3954c commit c3d642e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions benchmarks/error_control_convolutional/bench_convolutional.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import numpy as np

import komm


def bench_decode_convolutional_mu_2(benchmark):
convolutional_code = komm.ConvolutionalCode(
feedforward_polynomials=[[0o7, 0o5]],
)
code = komm.TerminatedConvolutionalCode(
convolutional_code,
num_blocks=200,
mode="zero-termination",
)
decoder = komm.ViterbiDecoder(code)
num_frames = 10
r = np.random.randint(0, 2, size=(num_frames, code.length))
benchmark(decoder, r)


def bench_decode_convolutional_mu_6(benchmark):
convolutional_code = komm.ConvolutionalCode(
feedforward_polynomials=[[0o117, 0o155]]
)
code = komm.TerminatedConvolutionalCode(
convolutional_code,
num_blocks=200,
mode="zero-termination",
)
decoder = komm.ViterbiDecoder(code)
num_frames = 10
r = np.random.randint(0, 2, size=(num_frames, code.length))
benchmark(decoder, r)

0 comments on commit c3d642e

Please sign in to comment.