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/README.md b/CMSIS/DSP/PythonWrapper/README.md
index d032a68..62b2264 100644
--- a/CMSIS/DSP/PythonWrapper/README.md
+++ b/CMSIS/DSP/PythonWrapper/README.md
@@ -219,6 +219,17 @@
 
 Note that the example file
 
+## Submodules
+
+The Python wrapper is containing two submodules : fixedpoint and mfcc
+
+fixedpoint is proving some tools to help generating the fixedpoint values expected
+by CMSIS-DSP.
+
+mfcc is generating some tools to generate the MEL filters, DCT and window coefficients
+expected by the CMSIS-DSP MFCC implemetation.
+
+MEL filters are represented as 3 arrays to encode a sparse array.
 
 # LIMITATIONS
 
diff --git a/CMSIS/DSP/PythonWrapper/cmsisdsp/__init__.py b/CMSIS/DSP/PythonWrapper/cmsisdsp/__init__.py
new file mode 100755
index 0000000..03112a5
--- /dev/null
+++ b/CMSIS/DSP/PythonWrapper/cmsisdsp/__init__.py
@@ -0,0 +1,2 @@
+from internal import *
+
diff --git a/CMSIS/DSP/PythonWrapper/fixedpoint.py b/CMSIS/DSP/PythonWrapper/cmsisdsp/fixedpoint.py
similarity index 100%
rename from CMSIS/DSP/PythonWrapper/fixedpoint.py
rename to CMSIS/DSP/PythonWrapper/cmsisdsp/fixedpoint.py
diff --git a/CMSIS/DSP/PythonWrapper/cmsisdsp/mfcc.py b/CMSIS/DSP/PythonWrapper/cmsisdsp/mfcc.py
new file mode 100755
index 0000000..6e6d2e5
--- /dev/null
+++ b/CMSIS/DSP/PythonWrapper/cmsisdsp/mfcc.py
@@ -0,0 +1,65 @@
+import numpy as np
+
+def frequencyToMelSpace(freq):
+    return 1127.0 * np.log(1.0 + freq / 700.0)
+
+def melSpaceToFrequency(mels):
+    return 700.0 * (np.exp(mels / 1127.0) - 1.0)
+
+def melFilterMatrix(fmin, fmax, numOfMelFilters,fs,FFTSize):
+
+    filters = np.zeros((numOfMelFilters,int(FFTSize/2+1)))
+    zeros = np.zeros(int(FFTSize // 2 ))
+
+
+    fmin_mel = frequencyToMelSpace(fmin)
+    fmax_mel = frequencyToMelSpace(fmax)
+    mels = np.linspace(fmin_mel, fmax_mel, num=numOfMelFilters+2)
+
+
+    linearfreqs = np.linspace( 0, fs/2.0, int(FFTSize // 2 + 1) )
+    spectrogrammels = frequencyToMelSpace(linearfreqs)[1:]
+
+
+    filtPos=[]
+    filtLen=[]
+    totalLen = 0
+    packedFilters = []
+    for n in range(numOfMelFilters):
+
+      
+      upper = (spectrogrammels - mels[n])/(mels[n+1]-mels[n]) 
+      lower = (mels[n+2] - spectrogrammels)/(mels[n+2]-mels[n+1])
+
+
+      filters[n, :] = np.hstack([0,np.maximum(zeros,np.minimum(upper,lower))])
+      nb = 0 
+      startFound = False
+      for sample in filters[n, :]:
+        if not startFound and sample != 0.0:
+            startFound = True 
+            startPos = nb
+
+        if startFound and sample == 0.0:
+           endPos = nb - 1 
+           break
+        nb = nb + 1 
+      filtLen.append(endPos - startPos+1)
+      totalLen += endPos - startPos + 1
+      filtPos.append(startPos)
+      packedFilters += list(filters[n, startPos:endPos+1])
+
+    return filtLen,filtPos,totalLen,packedFilters,filters
+
+
+def dctMatrix(numOfDctOutputs, numOfMelFilters):
+   
+    result = np.zeros((numOfDctOutputs,numOfMelFilters))
+    s=(np.linspace(1,numOfMelFilters,numOfMelFilters) - 0.5)/numOfMelFilters
+
+    for i in range(0, numOfDctOutputs):
+        result[i,:]=np.cos(i * np.pi*s) * np.sqrt(2.0/numOfMelFilters)
+        
+    return result.reshape(numOfDctOutputs*numOfMelFilters)
+
+
diff --git a/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.c b/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.c
index 5a3b6d3..bf08a6b 100644
--- a/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.c
+++ b/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.c
@@ -41,8 +41,8 @@
 
 #ifdef CMSISDSP
 #include "arm_math.h"
-#define MODNAME "cmsisdsp"
-#define MODINITNAME cmsisdsp
+#define MODNAME "internal"
+#define MODINITNAME internal
 #endif 
 
 #include <numpy/arrayobject.h>
diff --git a/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.h b/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.h
index 802c745..ed0f50d 100644
--- a/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.h
+++ b/CMSIS/DSP/PythonWrapper/cmsisdsp_pkg/src/cmsismodule.h
@@ -5676,6 +5676,90 @@
 
 MLTYPE(arm_fir_sparse_instance_q7,arm_fir_sparse_instance_q7_new,arm_fir_sparse_instance_q7_dealloc,arm_fir_sparse_instance_q7_init,arm_fir_sparse_instance_q7_methods);
 
+typedef struct {
+    PyObject_HEAD
+    arm_mfcc_instance_f32 *instance;
+} ml_arm_mfcc_instance_f32Object;
+
+
+static void
+arm_mfcc_instance_f32_dealloc(ml_arm_mfcc_instance_f32Object* self)
+{
+    //printf("Dealloc called\n");
+    if (self->instance)
+    {
+
+
+       PyMem_Free(self->instance);
+    }
+
+    Py_TYPE(self)->tp_free((PyObject*)self);
+}
+
+
+static PyObject *
+arm_mfcc_instance_f32_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    ml_arm_mfcc_instance_f32Object *self;
+    //printf("New called\n");
+
+    self = (ml_arm_mfcc_instance_f32Object *)type->tp_alloc(type, 0);
+    //printf("alloc called\n");
+
+    if (self != NULL) {
+
+        self->instance = PyMem_Malloc(sizeof(arm_mfcc_instance_f32));
+
+        self->instance->dctCoefs = NULL;
+        self->instance->filterCoefs = NULL;
+        self->instance->windowCoefs = NULL;
+        self->instance->filterPos = NULL;
+        self->instance->filterLengths = NULL;
+
+    }
+
+
+    return (PyObject *)self;
+}
+
+static int
+arm_mfcc_instance_f32_init(ml_arm_mfcc_instance_f32Object *self, PyObject *args, PyObject *kwds)
+{
+
+    PyObject *pTwiddle=NULL;
+    PyObject *pBitRevTable=NULL;
+char *kwlist[] = {
+"fftLen","nbMelFilters","nbDctOutputs",NULL
+};
+
+if (PyArg_ParseTupleAndKeywords(args, kwds, "|iii", kwlist,&self->instance->fftLen
+,&self->instance->nbMelFilters,&self->instance->nbDctOutputs
+))
+    {
+
+
+    }
+    return 0;
+}
+
+GETFIELD(arm_mfcc_instance_f32,fftLen,"i");
+GETFIELD(arm_mfcc_instance_f32,nbMelFilters,"i");
+GETFIELD(arm_mfcc_instance_f32,nbDctOutputs,"i");
+
+
+static PyMethodDef arm_mfcc_instance_f32_methods[] = {
+
+    {"fftLen", (PyCFunction) Method_arm_mfcc_instance_f32_fftLen,METH_NOARGS,"fftLen"},
+    {"nbMelFilters", (PyCFunction) Method_arm_mfcc_instance_f32_nbMelFilters,METH_NOARGS,"nbMelFilters"},
+    {"nbDctOutputs", (PyCFunction) Method_arm_mfcc_instance_f32_nbDctOutputs,METH_NOARGS,"nbDctOutputs"},
+
+    {NULL}  /* Sentinel */
+};
+
+
+MLTYPE(arm_mfcc_instance_f32,arm_mfcc_instance_f32_new,arm_mfcc_instance_f32_dealloc,arm_mfcc_instance_f32_init,arm_mfcc_instance_f32_methods);
+
+
 
 void typeRegistration(PyObject *module) {
 
@@ -5740,7 +5824,7 @@
   ADDTYPE(arm_fir_sparse_instance_q31);
   ADDTYPE(arm_fir_sparse_instance_q15);
   ADDTYPE(arm_fir_sparse_instance_q7);
-
+  ADDTYPE(arm_mfcc_instance_f32);
 }
 
 
@@ -14803,6 +14887,33 @@
   return(NULL);
 }
 
+static PyObject *
+cmsis_arm_divide_q15(PyObject *obj, PyObject *args)
+{
+
+  q15_t num,den; // input
+  q15_t pOut,shift; // output
+
+  if (PyArg_ParseTuple(args,"hh",&num,&den))
+  {
+
+
+
+    arm_status returnValue = arm_divide_q15(num,den,&pOut,&shift);
+    PyObject* theReturnOBJ=Py_BuildValue("i",returnValue);
+    PyObject* pOutOBJ=Py_BuildValue("h",pOut);
+    PyObject* pShiftOBJ=Py_BuildValue("i",shift);
+
+    PyObject *pythonResult = Py_BuildValue("OOO",theReturnOBJ,pOutOBJ,pShiftOBJ);
+
+    Py_DECREF(theReturnOBJ);
+    Py_DECREF(pOutOBJ);
+    Py_DECREF(pShiftOBJ);
+    return(pythonResult);
+
+  }
+  return(NULL);
+}
 
 static PyObject *
 cmsis_arm_sqrt_q15(PyObject *obj, PyObject *args)
@@ -16884,6 +16995,102 @@
   return(NULL);
 }
 
+/*
+
+MFCC
+
+*/
+
+static PyObject *
+cmsis_arm_mfcc_init_f32(PyObject *obj, PyObject *args)
+{
+
+  PyObject *S=NULL; // input
+  uint32_t fftLen,nbMelFilters,nbDctOutputs; // input
+
+  PyObject *pdctCoefs=NULL; // input
+  float32_t *pdctCoefs_converted=NULL; // input
+
+  PyObject *pfilterCoefs=NULL; // input
+  float32_t *pfilterCoefs_converted=NULL; // input
+
+  PyObject *pwindowCoefs=NULL; // input
+  float32_t *pwindowCoefs_converted=NULL; // input
+
+  PyObject *pfilterPos=NULL; // input
+  uint32_t *pfilterPos_converted=NULL; // input
+
+  PyObject *pfilterLengths=NULL; // input
+  uint32_t *pfilterLengths_converted=NULL; // input
+
+  if (PyArg_ParseTuple(args,"OiiiOOOOO",&S,&fftLen,&nbMelFilters,&nbDctOutputs,
+    &pdctCoefs,&pfilterPos,&pfilterLengths,&pfilterCoefs,&pwindowCoefs))
+  {
+
+    ml_arm_mfcc_instance_f32Object *selfS = (ml_arm_mfcc_instance_f32Object *)S;
+
+    GETARGUMENT(pdctCoefs,NPY_DOUBLE,double,float32_t);
+    GETARGUMENT(pfilterPos,NPY_UINT32,uint32_t,uint32_t);
+    GETARGUMENT(pfilterLengths,NPY_UINT32,uint32_t,uint32_t);
+    GETARGUMENT(pfilterCoefs,NPY_DOUBLE,double,float32_t);
+    GETARGUMENT(pwindowCoefs,NPY_DOUBLE,double,float32_t);
+
+
+    arm_status returnValue = arm_mfcc_init_f32(selfS->instance,
+        fftLen,nbMelFilters,nbDctOutputs,
+        pdctCoefs_converted,
+        pfilterPos_converted,pfilterLengths_converted,pfilterCoefs_converted,
+        pwindowCoefs_converted);
+    PyObject* theReturnOBJ=Py_BuildValue("i",returnValue);
+
+    PyObject *pythonResult = Py_BuildValue("O",theReturnOBJ);
+
+    Py_DECREF(theReturnOBJ);
+    return(pythonResult);
+
+  }
+  return(NULL);
+}
+
+static PyObject *
+cmsis_arm_mfcc_f32(PyObject *obj, PyObject *args)
+{
+
+  PyObject *S=NULL; // input
+  PyObject *p1=NULL; // input
+  float32_t *p1_converted=NULL; // input
+
+  PyObject *tmp=NULL; // input
+  float32_t *tmp_converted=NULL; // input
+
+  float32_t *pDst;
+  if (PyArg_ParseTuple(args,"OOO",&S,&p1,&tmp))
+  {
+
+    ml_arm_mfcc_instance_f32Object *selfS = (ml_arm_mfcc_instance_f32Object *)S;
+    GETARGUMENT(p1,NPY_DOUBLE,double,float32_t);
+    GETARGUMENT(tmp,NPY_DOUBLE,double,float32_t);
+
+    pDst=PyMem_Malloc(sizeof(float32_t)*selfS->instance->nbDctOutputs);
+
+    arm_mfcc_f32(selfS->instance,p1_converted,pDst,tmp_converted);
+
+    FLOATARRAY1(pDstOBJ,selfS->instance->nbDctOutputs,pDst);
+
+    PyObject *pythonResult = Py_BuildValue("O",pDstOBJ);
+    Py_DECREF(pDstOBJ);
+
+    FREEARGUMENT(p1_converted);
+    FREEARGUMENT(tmp_converted);
+
+    
+
+
+    return(pythonResult);
+
+  }
+  return(NULL);
+}
 
 static PyMethodDef CMSISMLMethods[] = {
 
@@ -17139,6 +17346,7 @@
 {"arm_sqrt_f32",  cmsis_arm_sqrt_f32, METH_VARARGS,""},
 {"arm_sqrt_q31",  cmsis_arm_sqrt_q31, METH_VARARGS,""},
 {"arm_sqrt_q15",  cmsis_arm_sqrt_q15, METH_VARARGS,""},
+{"arm_divide_q15",  cmsis_arm_divide_q15, METH_VARARGS,""},
 {"arm_circularWrite_f32",  cmsis_arm_circularWrite_f32, METH_VARARGS,""},
 {"arm_circularWrite_q15",  cmsis_arm_circularWrite_q15, METH_VARARGS,""},
 {"arm_circularWrite_q7",  cmsis_arm_circularWrite_q7, METH_VARARGS,""},
@@ -17247,6 +17455,8 @@
 {"arm_jensenshannon_distance_f32",cmsis_arm_jensenshannon_distance_f32, METH_VARARGS,""},
 {"arm_minkowski_distance_f32",cmsis_arm_minkowski_distance_f32, METH_VARARGS,""},
 #endif
+    {"arm_mfcc_init_f32",  cmsis_arm_mfcc_init_f32, METH_VARARGS,""},
+    {"arm_mfcc_f32",  cmsis_arm_mfcc_f32, METH_VARARGS,""},
 
     {"error_out", (PyCFunction)error_out, METH_NOARGS, NULL},
     {NULL, NULL, 0, NULL}        /* Sentinel */
diff --git a/CMSIS/DSP/PythonWrapper/config.py b/CMSIS/DSP/PythonWrapper/config.py
index 0e75a71..a8f76bc 100644
--- a/CMSIS/DSP/PythonWrapper/config.py
+++ b/CMSIS/DSP/PythonWrapper/config.py
@@ -5,7 +5,7 @@
 config = CMSISDSP
 
 if config == CMSISDSP:
-    extensionName = 'cmsisdsp' 
+    extensionName = 'internal' 
     setupName = 'CMSISDSP'
     setupDescription = 'CMSIS-DSP Python API'
     cflags="-DCMSISDSP"
diff --git a/CMSIS/DSP/PythonWrapper/setup.py b/CMSIS/DSP/PythonWrapper/setup.py
index a0b3d99..acdb07f 100644
--- a/CMSIS/DSP/PythonWrapper/setup.py
+++ b/CMSIS/DSP/PythonWrapper/setup.py
@@ -97,6 +97,7 @@
 
 setup (name = config.setupName,
        version = '1.0.0',
+       packages=['cmsisdsp'],
        description = config.setupDescription,
        ext_modules = [module1],
        author = 'Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.',
diff --git a/CMSIS/DSP/PythonWrapper/testdsp2.py b/CMSIS/DSP/PythonWrapper/testdsp2.py
index 428d351..99886f8 100755
--- a/CMSIS/DSP/PythonWrapper/testdsp2.py
+++ b/CMSIS/DSP/PythonWrapper/testdsp2.py
@@ -2,7 +2,7 @@
 import numpy as np
 from scipy import signal
 from scipy.fftpack import dct 
-import fixedpoint as f
+import cmsisdsp.fixedpoint as f
 from pyquaternion import Quaternion
 
 import colorama
diff --git a/CMSIS/DSP/PythonWrapper/testdsp3.py b/CMSIS/DSP/PythonWrapper/testdsp3.py
index cc5a8f4..a0313fa 100755
--- a/CMSIS/DSP/PythonWrapper/testdsp3.py
+++ b/CMSIS/DSP/PythonWrapper/testdsp3.py
@@ -1,6 +1,6 @@
 import cmsisdsp as dsp
 import numpy as np
-import fixedpoint as f
+import cmsisdsp.fixedpoint as f
 
 # Test vlog q31 and q15
 x = np.array([0.9,0.5,2**-16])
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())