CMSIS-DSP: MFCC F32

MFCC F32 implementation
MFCC F32 tests
MFCC F32 in Python wrapper
Python wrapper structure updated to support submodule like
cmsisdsp.mfcc and cmsisdsp.fixedpoint
PythonWrapper tests updated to use the new fixedpoint
cmsisdsp.mfcc is used to generate the mel filter, dct and window coefficients.
diff --git a/CMSIS/DSP/PythonWrapper/testmfcc.py b/CMSIS/DSP/PythonWrapper/testmfcc.py
new file mode 100755
index 0000000..dd6b4d9
--- /dev/null
+++ b/CMSIS/DSP/PythonWrapper/testmfcc.py
@@ -0,0 +1,91 @@
+import cmsisdsp as dsp
+import numpy as np
+import cmsisdsp.fixedpoint as f
+import cmsisdsp.mfcc as mfcc
+import scipy.signal as sig
+
+debug=np.array([ 0.65507051 ,-0.94647589 ,0.00627239 ,0.14151286 ,-0.10863318 ,-0.36370327
+ ,0.05777126 ,-0.11915792 ,0.50183546 ,-0.31461335 ,0.66440771 ,0.05389963
+ ,0.39690544 ,0.25424852 ,-0.17045277 ,0.09649268 ,0.87357385 ,-0.44666372
+ ,-0.02637822 ,-0.10055151 ,-0.14610252 ,-0.05981251 ,-0.02999124 ,0.60923213
+ ,0.10530095 ,0.35684248 ,0.21845946 ,0.47845017 ,-0.60206979 ,0.25186908
+ ,-0.27410056 ,-0.07080467 ,-0.05109539 ,-0.2666572 ,0.25483105 ,-0.86459185
+ ,0.07733397 ,-0.58535444 ,0.06230904 ,-0.04161475 ,-0.17467296 ,0.77721125
+ ,-0.01728161 ,-0.32141218 ,0.36674466 ,-0.17932843 ,0.78486115 ,0.12469579
+ ,-0.94796877 ,0.05536031 ,0.32627676 ,0.46628512 ,-0.02585836 ,-0.51439834
+ ,0.21387904 ,0.16319442 ,-0.01020818 ,-0.77161183 ,0.07754634 ,-0.24970455
+ ,0.2368003 ,0.35167963 ,0.14620137 ,-0.02415204 ,0.91086167 ,-0.02434647
+ ,-0.3968239 ,-0.04703925 ,-0.43905103 ,-0.34834965 ,0.33728158 ,0.15138992
+ ,-0.43218885 ,0.26619718 ,0.07177906 ,0.33393581 ,-0.50306915 ,-0.63101084
+ ,-0.08128395 ,-0.06569788 ,0.84232797 ,-0.32436751 ,0.02528537 ,-0.3498329
+ ,0.41859931 ,0.07794887 ,0.4571989 ,0.24290963 ,0.08437417 ,-0.01371585
+ ,-0.00103008 ,0.83978697 ,-0.29001237 ,0.14438743 ,0.11943318 ,-0.25576402
+ ,0.25151083 ,0.07886626 ,0.11565781 ,-0.01582203 ,0.1310246 ,-0.5553611
+ ,-0.37950665 ,0.44179691 ,0.08460877 ,0.30646419 ,0.48927934 ,-0.21240309
+ ,0.36844264 ,0.49686615 ,-0.81617664 ,0.52221472 ,-0.05188992 ,-0.03929655
+ ,-0.47674501 ,-0.54506781 ,0.30711148 ,0.10049337 ,-0.47549213 ,0.59106713
+ ,-0.62276051 ,-0.35182917 ,0.14612027 ,0.56142168 ,-0.01053732 ,0.35782179
+ ,-0.27220781 ,-0.03672346 ,-0.11282222 ,0.3364912 ,-0.22352515 ,-0.04245287
+ ,0.56968605 ,-0.14023724 ,-0.82982905 ,0.00860008 ,0.37920345 ,-0.53749318
+ ,-0.12761215 ,0.08567603 ,0.47020765 ,-0.28794812 ,-0.33888971 ,0.01850441
+ ,0.66848233 ,-0.26532759 ,-0.20777571 ,-0.68342729 ,-0.41498696 ,0.00593224
+ ,0.02229368 ,0.75596329 ,0.29447568 ,-0.1106449 ,0.24181939 ,0.05807497
+ ,-0.14343857 ,0.304988 ,0.00689148 ,-0.06264758 ,0.25864714 ,-0.22252155
+ ,0.28621689 ,0.17031599 ,-0.34694027 ,-0.01625718 ,0.39834181 ,0.01259659
+ ,-0.28022716 ,-0.02506168 ,-0.10276881 ,0.31733924 ,0.02787068 ,-0.09824124
+ ,0.45147797 ,0.14451518 ,0.17996395 ,-0.70594978 ,-0.92943177 ,0.13649282
+ ,-0.5938426 ,0.50289928 ,0.19635269 ,0.16811504 ,0.05803999 ,0.0037204
+ ,0.13847419 ,0.30568038 ,0.3700732 ,0.21257548 ,-0.31151753 ,-0.28836886
+ ,0.68743932 ,-0.11084429 ,-0.4673766 ,0.16637754 ,-0.38992572 ,0.16505578
+ ,-0.07499844 ,0.04226538 ,-0.11042177 ,0.0704542 ,-0.632819 ,-0.54898472
+ ,0.26498649 ,-0.59380386 ,0.93387213 ,0.06526726 ,-0.23223558 ,0.07941394
+ ,0.14325166 ,0.26914661 ,0.00925575 ,-0.34282161 ,-0.51418231 ,-0.12011075
+ ,-0.26676314 ,-0.09999028 ,0.03027513 ,0.22846503 ,-0.08930338 ,-0.1867156
+ ,0.66297846 ,0.32220769 ,-0.06015469 ,0.04034043 ,0.09595597 ,-1.
+ ,-0.42933352 ,0.25069376 ,-0.26030918 ,-0.28511861 ,-0.19931228 ,0.24408572
+ ,-0.3231952 ,0.45688981 ,-0.07354078 ,0.25669449 ,-0.44202722 ,0.11928406
+ ,-0.32826109 ,0.52660984 ,0.03067858 ,0.11095242 ,0.19933679 ,0.03042371
+ ,-0.34768682 ,0.09108447 ,0.61234556 ,0.1854931 ,0.19680502 ,0.27617564
+ ,0.33381827 ,-0.47358967 ,0.28714328 ,-0.27495982])
+
+ref = [ 1.6844872e+01, -3.8865981e+00, -3.4971607e-01, -4.1598725e-01,
+ -1.9625235e-01, -1.5887988e-01, -7.7221274e-02,  2.0610046e-01,
+  1.3069814e-01,  1.1363924e-02,  4.9844027e-02, -5.6932509e-02,
+ -1.6958869e-01]
+
+
+mfccf32=dsp.arm_mfcc_instance_f32()
+
+sample_rate = 16000
+FFTSize = 256
+numOfDctOutputs = 13
+    
+freq_min = 64
+freq_high = sample_rate / 2
+numOfMelFilters = 20
+
+window = sig.hamming(FFTSize, sym=False)
+      
+filtLen,filtPos,totalLen,packedFilters,_ = mfcc.melFilterMatrix(freq_min, freq_high, numOfMelFilters,sample_rate,FFTSize)
+
+       
+dctMatrixFilters = mfcc.dctMatrix(numOfDctOutputs, numOfMelFilters)
+
+
+
+
+status=dsp.arm_mfcc_init_f32(mfccf32,256,20,13,dctMatrixFilters,
+    filtPos,filtLen,packedFilters,window)
+print(status)
+
+tmp=np.zeros(FFTSize + 2)
+
+res=dsp.arm_mfcc_f32(mfccf32,debug,tmp)
+
+print(res)
+
+print(ref)
+
+print(mfccf32.fftLen())
+print(mfccf32.nbMelFilters())
+print(mfccf32.nbDctOutputs())