cmProc5.h : Added cmVectArray's uVa and fVa.

This commit is contained in:
kevin 2015-08-27 17:49:24 -04:00
parent a6ed3110e4
commit b1a108abd3
2 changed files with 24 additions and 6 deletions

View File

@ -918,8 +918,11 @@ cmNlmsEc_t* cmNlmsEcAlloc( cmCtx* ctx, cmNlmsEc_t* ap, float mu, unsigned hN, un
{
cmNlmsEc_t* p = cmObjAlloc(cmNlmsEc_t,ctx,ap);
// allocate the vect array
// allocate the vect array's
p->uVa = cmVectArrayAlloc(ctx, kFloatVaFl );
p->fVa = cmVectArrayAlloc(ctx, kFloatVaFl );
p->eVa = cmVectArrayAlloc(ctx, kFloatVaFl );
if( mu != 0 )
if( cmNlmsEcInit(p,mu,hN,delayN) != cmOkRC )
@ -1024,13 +1027,27 @@ cmRC_t cmNlmsEcExec( cmNlmsEc_t* p, const cmSample_t* xV, const cmSample_t*
}
cmVectArrayAppendS(p->uVa,xV,xyN);
cmVectArrayAppendS(p->fVa,fV,xyN);
cmVectArrayAppendS(p->eVa,yV,xyN);
return cmOkRC;
}
cmRC_t cmNlmsEcWrite( cmNlmsEc_t* p, const cmChar_t* dirStr )
{
if( p->uVa != NULL )
cmVectArrayWriteDirFn(p->uVa, dirStr, "nlms_unfiltered.va");
if( p->fVa != NULL )
cmVectArrayWriteDirFn(p->fVa, dirStr, "nlms_filtered.va");
if( p->eVa != NULL )
cmVectArrayWriteDirFn(p->eVa,dirStr, "nlms_err.va");
cmVectArrayWriteDirFn(p->eVa, dirStr, "nlms_out.va");
return cmOkRC;
}

View File

@ -235,10 +235,11 @@ extern "C" {
unsigned hN; // filter length
unsigned delayN; // fixed delay to apply to align xV with fV.
double* wV; // wV[hN] filter weights
double* hV; // hV[hN] filter delay line
unsigned w0i;
double* hV; // hV[hN] filter delay line
unsigned w0i; // The index into hV[] of the start of the delay line.
cmVectArray_t* uVa;
cmVectArray_t* fVa;
cmVectArray_t* eVa;
} cmNlmsEc_t;