|
@@ -918,8 +918,11 @@ cmNlmsEc_t* cmNlmsEcAlloc( cmCtx* ctx, cmNlmsEc_t* ap, float mu, unsigned hN, un
|
918
|
918
|
{
|
919
|
919
|
cmNlmsEc_t* p = cmObjAlloc(cmNlmsEc_t,ctx,ap);
|
920
|
920
|
|
921
|
|
- // allocate the vect array
|
|
921
|
+ // allocate the vect array's
|
|
922
|
+ p->uVa = cmVectArrayAlloc(ctx, kFloatVaFl );
|
|
923
|
+ p->fVa = cmVectArrayAlloc(ctx, kFloatVaFl );
|
922
|
924
|
p->eVa = cmVectArrayAlloc(ctx, kFloatVaFl );
|
|
925
|
+
|
923
|
926
|
|
924
|
927
|
if( mu != 0 )
|
925
|
928
|
if( cmNlmsEcInit(p,mu,hN,delayN) != cmOkRC )
|
|
@@ -1024,13 +1027,27 @@ cmRC_t cmNlmsEcExec( cmNlmsEc_t* p, const cmSample_t* xV, const cmSample_t*
|
1024
|
1027
|
|
1025
|
1028
|
}
|
1026
|
1029
|
|
|
1030
|
+ cmVectArrayAppendS(p->uVa,xV,xyN);
|
|
1031
|
+ cmVectArrayAppendS(p->fVa,fV,xyN);
|
|
1032
|
+ cmVectArrayAppendS(p->eVa,yV,xyN);
|
|
1033
|
+
|
|
1034
|
+
|
1027
|
1035
|
return cmOkRC;
|
1028
|
1036
|
}
|
1029
|
1037
|
|
1030
|
1038
|
|
1031
|
1039
|
cmRC_t cmNlmsEcWrite( cmNlmsEc_t* p, const cmChar_t* dirStr )
|
1032
|
1040
|
{
|
|
1041
|
+
|
|
1042
|
+ if( p->uVa != NULL )
|
|
1043
|
+ cmVectArrayWriteDirFn(p->uVa, dirStr, "nlms_unfiltered.va");
|
|
1044
|
+
|
|
1045
|
+ if( p->fVa != NULL )
|
|
1046
|
+ cmVectArrayWriteDirFn(p->fVa, dirStr, "nlms_filtered.va");
|
|
1047
|
+
|
1033
|
1048
|
if( p->eVa != NULL )
|
1034
|
|
- cmVectArrayWriteDirFn(p->eVa,dirStr, "nlms_err.va");
|
|
1049
|
+ cmVectArrayWriteDirFn(p->eVa, dirStr, "nlms_out.va");
|
|
1050
|
+
|
|
1051
|
+
|
1035
|
1052
|
return cmOkRC;
|
1036
|
1053
|
}
|