diff options
author | Jon Nordby <jononor@gmail.com> | 2025-08-12 23:17:08 +0200 |
---|---|---|
committer | Jon Nordby <jononor@gmail.com> | 2025-08-12 23:17:08 +0200 |
commit | ab05f129ce2fd5eb3a8a7c06687a7144d3ec18f1 (patch) | |
tree | 0aa8228c2c5fddfa6673799713ef04019dbf1ed9 /bindings/test_galearn_pdm.py | |
parent | 45f5b98c480bba9736c2adbd65e46cabfb435959 (diff) |
pdm: Ensure output buffer is large enough
Diffstat (limited to 'bindings/test_galearn_pdm.py')
-rw-r--r-- | bindings/test_galearn_pdm.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bindings/test_galearn_pdm.py b/bindings/test_galearn_pdm.py index 99c5d68..d7bd4dc 100644 --- a/bindings/test_galearn_pdm.py +++ b/bindings/test_galearn_pdm.py @@ -6,6 +6,7 @@ Test the PDM filter import time import os import sys +import math import numpy import pandas @@ -73,7 +74,7 @@ def test_sine_simple(frequency): freqs=[frequency], noise_level=0.0, sample_rate=sr, amplitude=0.9, ) pdm_input = convert(pcm_input) - out = numpy.zeros(shape=len(pdm_input)//DECIMATION, dtype=numpy.int16) + out = numpy.zeros(shape=math.ceil(len(pdm_input)/DECIMATION), dtype=numpy.int16) # Process using filter #scale = (2**12) |