changeset 139:4bd6856a7128 ivand_dev

ompGabor mex version debuged and tested
author Ivan <ivan.damnjanovic@eecs.qmul.ac.uk>
date Thu, 21 Jul 2011 16:37:14 +0100
parents 56d719a5fd31
children 31d2864dfdd4
files examples/AudioInpainting/Audio_Declipping_Example.m util/ksvd utils/ompbox utils/omp2Gabor.m util/ksvd utils/ompbox utils/ompcoreGabor.c
diffstat 3 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/examples/AudioInpainting/Audio_Declipping_Example.m	Thu Jul 21 14:27:47 2011 +0100
+++ b/examples/AudioInpainting/Audio_Declipping_Example.m	Thu Jul 21 16:37:14 2011 +0100
@@ -102,7 +102,7 @@
 xEst2 = xEst2(1:L)/normX;
 xClipped = xClipped(1:L)/normX;
 xClean = xClean(1:L)/normX;
-wavwrite(xEst1,fs,[expParam.destDir 'xEst1.wav']);
-wavwrite(xEst2,fs,[expParam.destDir 'xEst2.wav']);
-wavwrite(xClipped,fs,[expParam.destDir 'xClipped.wav']);
-wavwrite(xClean,fs,[expParam.destDir 'xClean.wav']);
+% wavwrite(xEst1,fs,[expParam.destDir 'xEst1.wav']);
+% wavwrite(xEst2,fs,[expParam.destDir 'xEst2.wav']);
+% wavwrite(xClipped,fs,[expParam.destDir 'xClipped.wav']);
+% wavwrite(xClean,fs,[expParam.destDir 'xClean.wav']);
--- a/util/ksvd utils/ompbox utils/omp2Gabor.m	Thu Jul 21 14:27:47 2011 +0100
+++ b/util/ksvd utils/ompbox utils/omp2Gabor.m	Thu Jul 21 16:37:14 2011 +0100
@@ -185,6 +185,7 @@
   error('Invalid number of parameters');
 end
 
+G=[];
 
 % verify dictionary normalization
 
--- a/util/ksvd utils/ompbox utils/ompcoreGabor.c	Thu Jul 21 14:27:47 2011 +0100
+++ b/util/ksvd utils/ompbox utils/ompcoreGabor.c	Thu Jul 21 16:37:14 2011 +0100
@@ -56,7 +56,7 @@
   DtX_specified = (DtX!=0);   /* indicates whether D'*x was provided */
   XtX_specified = (XtX!=0);   /* indicates whether sum(x.*x) was provided */
   
-  standardomp = (G==0);       /* batch-omp or standard omp are selected depending on availability of G */
+  standardomp = 1;//(G==0);       /* batch-omp or standard omp are selected depending on availability of G */
   batchomp = !standardomp;
   
   
@@ -104,10 +104,12 @@
   vec_smult(1,D2, D1, n*m/2);
        
   for (i=0; i<m/2; i++) {
+	D1D2[i]=0;
+	n12[i]=0;
     for (j=0; j<n; j++) {
           D1D2[i] += D1[i*n+j];
     }
-    n12[i]=1/(1-D1D2[i]);
+    n12[i]=1/(1-D1D2[i]*D1D2[i]);
   }
   
   memcpy(D1, D      , n*m/2*sizeof(double));
@@ -232,8 +234,9 @@
         beta[k]  = (proj2[k] - D1D2[k]*proj1[k])*n12[k];
       }
       for (k=0; k<m/2; k++){
+		  error[k]=0;
           for (j=0; j<n; j++){
-                  error[k]+= (abs(r[j])-D1[k*n+j]*alpha[k]-D2[(k+m/2)*n+j]*beta[k])*(abs(r[j])-D1[k*n+j]*alpha[k]-D2[(k+m/2)*n+j]*beta[k]);
+                  error[k]+= (abs(r[j])-D1[k*n+j]*alpha[k]-D2[k*n+j]*beta[k])*(abs(r[j])-D1[k*n+j]*alpha[k]-D2[k*n+j]*beta[k]);
           }
       }
       pos = maxabs(error, m/2);