-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add benchmarking for Viterbi decoder for terminated codes
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
benchmarks/error_control_convolutional/bench_convolutional.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |