From ab05f129ce2fd5eb3a8a7c06687a7144d3ec18f1 Mon Sep 17 00:00:00 2001 From: Jon Nordby Date: Tue, 12 Aug 2025 23:17:08 +0200 Subject: pdm: Ensure output buffer is large enough --- bindings/test_galearn_pdm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bindings') 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) -- cgit v1.2.3