aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/fftease/src/thresher~.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-01-23 08:53:05 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-01-23 08:53:05 +0000
commite1bdd67199e389a5ba7eb03ecff171058c37a467 (patch)
tree950f77045fdab4bcbddec7209cb1719d70ac7783 /externals/grill/fftease/src/thresher~.cpp
parentf4b63ea3357f379a6e53d3f1e7e6ac43a1b91e49 (diff)
""
svn path=/trunk/; revision=357
Diffstat (limited to 'externals/grill/fftease/src/thresher~.cpp')
-rw-r--r--externals/grill/fftease/src/thresher~.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/externals/grill/fftease/src/thresher~.cpp b/externals/grill/fftease/src/thresher~.cpp
index 2f186c92..98c02eb1 100644
--- a/externals/grill/fftease/src/thresher~.cpp
+++ b/externals/grill/fftease/src/thresher~.cpp
@@ -29,8 +29,6 @@ protected:
F *_compositeFrame;
I *_framesLeft;
- F *_c_lastphase_in,*_c_lastphase_out;
- F _c_fundamental,_c_factor_in,_c_factor_out;
BL _firstFrame;
F _moveThreshold;
@@ -40,7 +38,7 @@ private:
static V setup(t_classid c);
};
-FLEXT_LIB_DSP("fftease, thresher~",thresher)
+FLEXT_LIB_DSP("fftease, thresher~ nacho~",thresher)
V thresher::setup(t_classid c)
@@ -56,14 +54,6 @@ void thresher::Set()
_compositeFrame = new F[_N+2];
_framesLeft = new I[_N2+1];
- _c_lastphase_in = new F[_N2+1];
- ZeroMem(_c_lastphase_in,(_N2+1)*sizeof(*_c_lastphase_in));
- _c_lastphase_out = new F[_N2+1];
- ZeroMem(_c_lastphase_out,(_N2+1)*sizeof(*_c_lastphase_out));
-
- _c_fundamental = _R/_N;
- _c_factor_in = _R/(_D * PV_2PI);
- _c_factor_out = 1./_c_factor_in;
_firstFrame = true;
_moveThreshold = .00001 ;
@@ -76,7 +66,6 @@ void thresher::Clear()
fftease::Clear();
_compositeFrame = NULL;
_framesLeft = NULL;
- _c_lastphase_in = _c_lastphase_out = NULL;
}
void thresher::Delete()
@@ -84,13 +73,11 @@ void thresher::Delete()
fftease::Delete();
if(_compositeFrame) delete[] _compositeFrame;
if(_framesLeft) delete[] _framesLeft;
- if(_c_lastphase_in) delete[] _c_lastphase_in;
- if(_c_lastphase_out) delete[] _c_lastphase_out;
}
thresher::thresher():
- fftease(4,F_BALANCED|F_BITSHUFFLE|F_NOSPEC|F_SPECRES)
+ fftease(4,F_BALANCED|F_BITSHUFFLE|F_PHCONV)
{
AddInSignal("Messages and input signal");
AddOutSignal("Transformed signal");
@@ -99,8 +86,6 @@ thresher::thresher():
V thresher::Transform(I _N,S *const *in)
{
- convert( _buffer1, _channel1, _N/2, _c_lastphase_in, _c_fundamental, _c_factor_in );
-
I *fr = _framesLeft;
if( _firstFrame ) {
for (I i = 0; i <= _N; i += 2,++fr ){
@@ -117,10 +102,11 @@ V thresher::Transform(I _N,S *const *in)
_compositeFrame[i+1] = _channel1[i+1];
*fr = _maxHoldFrames;
}
- else
+ else {
+ _channel1[i] = _compositeFrame[i];
+ _channel1[i+1] = _compositeFrame[i+1];
--*fr;
+ }
}
}
-
- unconvert( _compositeFrame, _buffer1, _N/2, _c_lastphase_out, _c_fundamental, _c_factor_out );
}