Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions PythonWrapper/examples/testmfcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand All @@ -152,4 +154,4 @@ def test_mfcc_q15(self):
self.assertEqual(mfccq15.nbDctOutputs(),self.numOfDctOutputs)

if __name__ == '__main__':
unittest.main()
unittest.main()