From 9ba2c7f269ed55b99b0a5d1596d1b5c9671422e1 Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Sat, 22 Aug 2026 22:51:48 +0100 Subject: [PATCH] Use documented MFCC output formats in Python example --- PythonWrapper/examples/testmfcc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PythonWrapper/examples/testmfcc.py b/PythonWrapper/examples/testmfcc.py index 4a0e6c253..ed12caa61 100755 --- a/PythonWrapper/examples/testmfcc.py +++ b/PythonWrapper/examples/testmfcc.py @@ -98,7 +98,8 @@ def test_mfcc_q31(self): errorStatus,resQ31=dsp.arm_mfcc_q31(mfccq31,debugQ31,tmp,tmp2=tmp2) else: errorStatus,resQ31=dsp.arm_mfcc_q31(mfccq31,debugQ31,tmp) - res=self.FFTSize*Q31toF32(resQ31) + # arm_mfcc_q31 returns q8.23 values. + res=resQ31 / float(1 << 23) assert_allclose(res,ref,4e-5,4e-5) @@ -140,7 +141,8 @@ def test_mfcc_q15(self): errorStatus,resQ15=dsp.arm_mfcc_q15(mfccq15,debugQ15,tmp,tmp2=tmp2) else: errorStatus,resQ15=dsp.arm_mfcc_q15(mfccq15,debugQ15,tmp) - res=self.FFTSize*Q15toF32(resQ15) + # arm_mfcc_q15 returns q8.7 values. + res=resQ15 / float(1 << 7) assert_allclose(res,ref,3e-3,1e-2) @@ -152,4 +154,4 @@ def test_mfcc_q15(self): self.assertEqual(mfccq15.nbDctOutputs(),self.numOfDctOutputs) if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()