Bug fixed in the GSS system
authorFrancoisGrondin <francois.grondin2@usherbrooke.ca>
Wed, 29 Nov 2017 19:17:51 +0000 (14:17 -0500)
committerFrancoisGrondin <francois.grondin2@usherbrooke.ca>
Wed, 29 Nov 2017 19:17:51 +0000 (14:17 -0500)
src/system/steer2demixing.c

index 21184040f2b43c880870ef393a121611d3c0a303..b8e1a4d5f695c2f2022629c4d6e0f5f41bfbf7a4 100644 (file)
@@ -1,6 +1,8 @@
     
     #include "steer2demixing.h"
 
+    int count = 0;
+
     steer2demixing_ds_obj * steer2demixing_ds_construct_zero(const unsigned int nSeps, const unsigned int nChannels, const unsigned int halfFrameSize, const float epsilon) {
 
         steer2demixing_ds_obj * obj;
 
         }
 
+        //freqs_printf(freqs);
+
         if (nActiveSources > 0) {
 
             for (iBin = 0; iBin < obj->halfFrameSize; iBin++) {
                     }
 
                 }
-                
+
                 // 
                 // Compute Y[k] = Wn[k]X[k]
                 //
                                   obj->Y[nActiveSources-1]);
 
                 //
-                // Compute Ryy[k] = Y^H[k] Y[k]
+                // Compute Ryy[k] = Y[k] Y[k]^H
                 //
 
                 cmatrix_mul(obj->Ryy[nActiveSources-1],
                             iSampleBC = iBin * obj->nChannels + iChannel;
                             iSampleSC = iSep * obj->nChannels + iChannel;                           
                             iSampleCA = iChannel * nActiveSources + iActiveSource;
+                            iSampleAC = iActiveSource * obj->nChannels + iChannel;
 
                             if (masks->array[iSampleSC] == 1) {
 
                                 obj->A[nActiveSources-1]->real[iSampleCA] = Areal;
                                 obj->A[nActiveSources-1]->imag[iSampleCA] = Aimag;
 
-                                obj->AH[nActiveSources-1]->real[iSampleCA] = Areal;
-                                obj->AH[nActiveSources-1]->imag[iSampleCA] = -1.0f * Aimag;
+                                obj->AH[nActiveSources-1]->real[iSampleAC] = Areal;
+                                obj->AH[nActiveSources-1]->imag[iSampleAC] = -1.0f * Aimag;
 
                             }
 
                 cmatrix_copy_cmatrix(obj->dJ2[nActiveSources-1],
                                      obj->dJ2_2WAmIAH[nActiveSources-1]);
 
+
+                //if (iBin == 10) {
+                //    cmatrix_printf(obj->AH[nActiveSources-1]);
+                //}
+
                 //
                 // Compute ||Rxx||^2 = ||X[k]X^H[k]||^2 = (||X[k]||^2)^2
                 //
 
         }
 
+                //        count++;
+
+                //if (count == 1) {
+                //    exit(EXIT_SUCCESS);
+                //}
+
     }
     
     steer2demixing_mvdr_obj * steer2demixing_mvdr_construct_zero(const unsigned int nSeps, const unsigned int nChannels, const unsigned int halfFrameSize, const float alpha, const float sigma, const unsigned int deltaK) {