Browse Source

cmProc4.h/c: Fixed bug in cmGoertzel where ch->s1 and ch->s2 were swapped.

master
kevin 10 years ago
parent
commit
d011e83cd9
2 changed files with 4 additions and 3 deletions
  1. 4
    2
      cmProc4.c
  2. 0
    1
      cmProc4.h

+ 4
- 2
cmProc4.c View File

4559
   {
4559
   {
4560
     cmGoertzelCh* ch = p->ch + i;
4560
     cmGoertzelCh* ch = p->ch + i;
4561
     
4561
     
4562
-    ch->s1 = x[0];
4563
-    ch->s2 = x[1] + 2 * x[0] * ch->coeff;
4562
+    ch->s2 = x[0];
4563
+    ch->s1 = x[1] + 2 * x[0] * ch->coeff;
4564
     for(j=2; j<procSmpCnt; ++j)
4564
     for(j=2; j<procSmpCnt; ++j)
4565
     {
4565
     {
4566
       ch->s0 = x[j] + ch->coeff * ch->s1 - ch->s2;
4566
       ch->s0 = x[j] + ch->coeff * ch->s1 - ch->s2;
4573
 
4573
 
4574
   return cmOkRC;
4574
   return cmOkRC;
4575
 }
4575
 }
4576
+
4577
+

+ 0
- 1
cmProc4.h View File

723
   cmRC_t cmGoertzelExec( cmGoertzel* p, const cmSample_t* in, unsigned procSmpCnt,  double* outV, unsigned chCnt );
723
   cmRC_t cmGoertzelExec( cmGoertzel* p, const cmSample_t* in, unsigned procSmpCnt,  double* outV, unsigned chCnt );
724
 
724
 
725
 
725
 
726
-
727
 #ifdef __cplusplus
726
 #ifdef __cplusplus
728
 }
727
 }
729
 #endif
728
 #endif

Loading…
Cancel
Save