summaryrefslogtreecommitdiff
path: root/bindings/test_galearn_pdm.py
diff options
context:
space:
mode:
authorJon Nordby <jononor@gmail.com>2025-08-08 22:13:15 +0200
committerJon Nordby <jononor@gmail.com>2025-08-08 22:22:39 +0200
commit23ef09d5dd337049458b48eaf9ed7ece3f887592 (patch)
tree3df98fb87f969ceab2786c2bb31bbe3982db6abf /bindings/test_galearn_pdm.py
parent03feeb8419b46c858f56ac70142780f039881b45 (diff)
pdm: Try switch to 2 stage CIC
Still seeing odd spikes on output
Diffstat (limited to 'bindings/test_galearn_pdm.py')
-rw-r--r--bindings/test_galearn_pdm.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bindings/test_galearn_pdm.py b/bindings/test_galearn_pdm.py
index 5256a46..3a19762 100644
--- a/bindings/test_galearn_pdm.py
+++ b/bindings/test_galearn_pdm.py
@@ -76,8 +76,8 @@ def test_sine_simple(frequency):
out = numpy.zeros(shape=len(pdm_input)//DECIMATION, dtype=numpy.int16)
# Process using filter
- n_samples = galearn_pdm.process(pdm_input, out)
- out = out / 1024 # XXX: where does this magical come from?
+ n_samples = galearn_pdm.process(pdm_input, out, 255, 1)
+ out = out / (2**15)
# Compensate for delay through filter
delay = find_forward_shift(pcm_input, out)
@@ -126,19 +126,19 @@ def test_dc():
function = sys._getframe().f_code.co_name # looks up function name
test_name = f'{function}'
sr = SAMPLERATE_DEFAULT
- test_duration = 0.10
+ test_duration = 0.0013
# Generate test data
frequency = 1000
pcm_input = generate_test_tone(duration_sec=test_duration,
freqs=[frequency], noise_level=0.0, sample_rate=sr, amplitude=0.01,
- ) + 0.20 # DC
+ ) + 0.10 # DC
pdm_input = convert(pcm_input)
out = numpy.zeros(shape=len(pdm_input)//DECIMATION, dtype=numpy.int16)
# Process using filter
- n_samples = galearn_pdm.process(pdm_input, out)
- out = out / 1024 # XXX: where does this magical come from?
+ n_samples = galearn_pdm.process(pdm_input, out, 200, 1)
+ out = out / (2**15) # XXX: where does this magical come from?
# Compensate for delay through filter
delay = find_forward_shift(pcm_input, out)