|
@@ -6501,7 +6501,8 @@ cmRC_t cmSpecDist2Init( cmSpecDist2_t* p, unsigned procSmpCnt, double srate, uns
|
6501
|
6501
|
p->wndSmpCnt = wndSmpCnt;
|
6502
|
6502
|
p->hopSmpCnt = (unsigned)floor(wndSmpCnt/hopFcmt);
|
6503
|
6503
|
p->procSmpCnt = procSmpCnt;
|
6504
|
|
-
|
|
6504
|
+ p->igain = 1.0;
|
|
6505
|
+
|
6505
|
6506
|
p->ceiling = 30;
|
6506
|
6507
|
p->expo = 2.0;
|
6507
|
6508
|
|
|
@@ -6511,8 +6512,9 @@ cmRC_t cmSpecDist2Init( cmSpecDist2_t* p, unsigned procSmpCnt, double srate, uns
|
6511
|
6512
|
|
6512
|
6513
|
p->mix = 0.0;
|
6513
|
6514
|
|
6514
|
|
- p->pva = cmPvAnlAlloc( p->obj.ctx, NULL, procSmpCnt, srate, wndSmpCnt, p->hopSmpCnt, flags );
|
6515
|
|
- p->pvs = cmPvSynAlloc( p->obj.ctx, NULL, procSmpCnt, srate, wndSmpCnt, p->hopSmpCnt, olaWndTypeId );
|
|
6515
|
+ p->igainV = cmMemResizeZ( cmSample_t, p->igainV, procSmpCnt );
|
|
6516
|
+ p->pva = cmPvAnlAlloc( p->obj.ctx, NULL, procSmpCnt, srate, wndSmpCnt, p->hopSmpCnt, flags );
|
|
6517
|
+ p->pvs = cmPvSynAlloc( p->obj.ctx, NULL, procSmpCnt, srate, wndSmpCnt, p->hopSmpCnt, olaWndTypeId );
|
6516
|
6518
|
|
6517
|
6519
|
|
6518
|
6520
|
return rc;
|
|
@@ -6522,7 +6524,7 @@ cmRC_t cmSpecDist2Final(cmSpecDist2_t* p )
|
6522
|
6524
|
{
|
6523
|
6525
|
cmRC_t rc = cmOkRC;
|
6524
|
6526
|
|
6525
|
|
-
|
|
6527
|
+ cmMemFree(p->igainV);
|
6526
|
6528
|
cmPvAnlFree(&p->pva);
|
6527
|
6529
|
cmPvSynFree(&p->pvs);
|
6528
|
6530
|
return rc;
|
|
@@ -6585,8 +6587,12 @@ cmRC_t cmSpecDist2Exec( cmSpecDist2_t* p, const cmSample_t* sp, unsigned sn )
|
6585
|
6587
|
|
6586
|
6588
|
unsigned binN = p->pva->binCnt;
|
6587
|
6589
|
|
|
6590
|
+ cmVOS_MultVVS( p->igainV, sn, sp, p->igain );
|
|
6591
|
+
|
|
6592
|
+ //printf("%f\n",p->igainV[0]);
|
|
6593
|
+
|
6588
|
6594
|
// cmPvAnlExec() returns true when it calc's a new spectral output frame
|
6589
|
|
- if( cmPvAnlExec( p->pva, sp, sn ) )
|
|
6595
|
+ if( cmPvAnlExec( p->pva, p->igainV, sn ) )
|
6590
|
6596
|
{
|
6591
|
6597
|
cmReal_t X0m[binN];
|
6592
|
6598
|
cmReal_t X1m[binN];
|
|
@@ -6652,7 +6658,7 @@ const cmSample_t* cmSpecDist2Out( cmSpecDist2_t* p )
|
6652
|
6658
|
|
6653
|
6659
|
void cmSpecDist2Report( cmSpecDist2_t* p )
|
6654
|
6660
|
{
|
6655
|
|
- printf("ceil:%f expo:%f mix:%f thresh:%f upr:%f lwr:%f\n", p->ceiling,p->expo,p->mix,p->thresh,p->lwrSlope,p->uprSlope);
|
|
6661
|
+ printf("igain:%f ceil:%f expo:%f mix:%f thresh:%f upr:%f lwr:%f\n", p->igain, p->ceiling,p->expo,p->mix,p->thresh,p->lwrSlope,p->uprSlope);
|
6656
|
6662
|
}
|
6657
|
6663
|
|
6658
|
6664
|
|