-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the meaning of LOG2TOLOG_Q15 constant? #107
Comments
why is it equal to LOG2TOLOG_Q31? |
@olegkhr It is to convert a log2 value to a normal log (base e) |
@christophe0606 thanks for the explanation. For the very low-power signal - mel spectrum is computed as all less than 1 values. Then vlog will output negative values. That results in a large difference in the first coefficient in DCT between float and quant versions. Is it expected behavior? |
@olegkhr This offset is required because of the shifts occurring in fixed point. Can you share an example signal and MFCC parameters so that I can't look at it. You can have a look here : #54 (comment) I had written some Python to compare CMSIS-DSP MFCC, TensorFlow MFCC and Librosa MFCC. I you share a f32 version, I can make the q15 to compare and see what's happening. |
MFCC params: sample_rate = 16000 freq_min = 20 Example signal: |
https://github.com/ARM-software/CMSIS-DSP/blob/main/Source/TransformFunctions/arm_mfcc_q15.c#L179 @christophe0606 Does pTmp and logExponent have the same binary format? |
@olegkhr Sorry for late answer. I was off for some time. I'll look at all of this as soon as I can. |
@christophe0606 Could you please review this patch?
|
@olegkhr I think you have found a problem. The signal is rescaled to have more accuracy for the FFT and magnitude computation but the rescaling is not compensated later. The patch above is identifying the problem but not applying the rescaling compensation where it should. I'll look at it. Q31 also has the problem. Thanks for reporting it and thanks for being patient because I have been very slow at looking at this github issue. |
@olegkhr The latest commit 60a8c88 is correcting a rescaling issue in all MFCCs versions. Tell me if it solves your problem. I observe that the MFCC Q15 is closer to the other versions with this fix. Also, the MFCC F32 is closer to the TensorFlow one (I was observing a small divergence on a test pattern and it is now corrected with this commit). |
No description provided.
The text was updated successfully, but these errors were encountered: