Browse Source

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

master
kevin 9 years ago
parent
commit
b1a108abd3
2 changed files with 24 additions and 6 deletions
  1. 19
    2
      cmProc5.c
  2. 5
    4
      cmProc5.h

+ 19
- 2
cmProc5.c View File

918
 {
918
 {
919
   cmNlmsEc_t* p = cmObjAlloc(cmNlmsEc_t,ctx,ap);
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
   p->eVa = cmVectArrayAlloc(ctx, kFloatVaFl );
924
   p->eVa = cmVectArrayAlloc(ctx, kFloatVaFl );
925
+   
923
   
926
   
924
   if( mu != 0 )  
927
   if( mu != 0 )  
925
     if( cmNlmsEcInit(p,mu,hN,delayN) != cmOkRC )
928
     if( cmNlmsEcInit(p,mu,hN,delayN) != cmOkRC )
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
   return cmOkRC;
1035
   return cmOkRC;
1028
 }
1036
 }
1029
 
1037
 
1030
 
1038
 
1031
 cmRC_t      cmNlmsEcWrite( cmNlmsEc_t* p, const cmChar_t* dirStr )
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
   if( p->eVa != NULL )
1048
   if( p->eVa != NULL )
1034
-    cmVectArrayWriteDirFn(p->eVa,dirStr, "nlms_err.va");
1049
+    cmVectArrayWriteDirFn(p->eVa, dirStr, "nlms_out.va");
1050
+
1051
+  
1035
   return cmOkRC;
1052
   return cmOkRC;
1036
 }
1053
 }

+ 5
- 4
cmProc5.h View File

235
     unsigned       hN;          // filter length
235
     unsigned       hN;          // filter length
236
     unsigned       delayN;      // fixed delay to apply to align xV with fV.
236
     unsigned       delayN;      // fixed delay to apply to align xV with fV.
237
     double*        wV;          // wV[hN] filter weights
237
     double*        wV;          // wV[hN] filter weights
238
-    double*        hV;          // hV[hN] filter delay line
239
-    
240
-    unsigned       w0i;
241
-    
238
+    double*        hV;          // hV[hN] filter delay line    
239
+    unsigned       w0i;         // The index into hV[] of the start of the delay line.
240
+
241
+    cmVectArray_t* uVa;
242
+    cmVectArray_t* fVa;
242
     cmVectArray_t* eVa;
243
     cmVectArray_t* eVa;
243
   } cmNlmsEc_t;
244
   } cmNlmsEc_t;
244
 
245
 

Loading…
Cancel
Save