Skip to content

Use documented MFCC output formats in Python example - #341

Open
sylvesterkaczmarek wants to merge 1 commit into
ARM-software:mainfrom
sylvesterkaczmarek:fix/mfcc-output-format-conversion-279
Open

Use documented MFCC output formats in Python example#341
sylvesterkaczmarek wants to merge 1 commit into
ARM-software:mainfrom
sylvesterkaczmarek:fix/mfcc-output-format-conversion-279

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Addresses #279

Summary

  • convert Q31 MFCC results from the documented q8.23 format with a fixed 2^23 divisor
  • convert Q15 MFCC results from the documented q8.7 format with a fixed 2^7 divisor
  • remove the conversion's accidental dependence on the example's 256-point FFT length

Context

arm_mfcc_q31 and arm_mfcc_q15 return q8.23 and q8.7 values respectively. The example previously converted them as ordinary Q31 and Q15 values and multiplied by FFTSize. That gives the expected scale for the current 256-point test only because both output formats have eight integer bits. A different FFT length would scale the displayed MFCC values incorrectly.

This follows the maintainer's format clarification in #279 and makes the example match the function documentation.

Validation

  • python -m py_compile PythonWrapper/examples/testmfcc.py
  • focused NumPy regression with representative signed Q31 and Q15 outputs
  • confirmed the new conversions match the existing 256-point expectations and remain constant when a different hypothetical FFT length is used
  • git diff --check

The full example test was not run because the compiled cmsisdsp extension modules are unavailable in the local environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant