summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Nordby <jononor@gmail.com>2025-08-12 23:17:08 +0200
committerJon Nordby <jononor@gmail.com>2025-08-12 23:17:08 +0200
commitab05f129ce2fd5eb3a8a7c06687a7144d3ec18f1 (patch)
tree0aa8228c2c5fddfa6673799713ef04019dbf1ed9
parent45f5b98c480bba9736c2adbd65e46cabfb435959 (diff)
pdm: Ensure output buffer is large enough
-rw-r--r--bindings/test_galearn_pdm.py3
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)