Origin Ver.8.1 and Service Release 1(Select Help-->About Origin):
Operating System: WinXP
I am trying to perfom a fft_lowpass filtering of using Origin C using the following lines of code
Dataset TOF(wksData,wksData.Columns("TOF").GetIndex());
Dataset PHonIon(wksData,wksData.Columns("PHonIon").GetIndex());
Dataset PHoffIon(wksData,wksData.Columns("PHoffIon").GetIndex());
Dataset PHonIoff(wksData,wksData.Columns("PHonIoff").GetIndex());
Dataset Signal(wksData,wksData.Columns("Signal").GetIndex());
Dataset FFTtof(wksData,wksData.Columns("FFTtof").GetIndex());
Dataset FFTsig(wksData,wksData.Columns("FFTsig").GetIndex());
int npts = PHonIon.GetSize();
Signal.SetSize(npts);
int nptsFFT = 1;
while (nptsFFT<npts) nptsFFT*=2; // FFT requires the number of points being equal a power of 2
vector FFTx, FFTy;
FFTtof.SetSize(nptsFFT);
FFTsig.SetSize(nptsFFT);
for (int n=0; n<npts; n++)
{
Signal[n] = -PHonIon[n]+PHoffIon[n]+PHonIoff[n]; // these are the data to be filtered
FFTtof[n] = TOF[n];
FFTsig[n] = Signal[n];
}
double dt = TOF[1]-TOF[0];
for (n=npts;n<nptsFFT;n++)
{
FFTtof[n] = FFTtof[n-1]+dt;
FFTsig[n] = 0.0;
}
Curve FFTcurve(FFTtof,FFTsig);
int ierr = fft_lowpass(FFTcurve,2e7);
if (ierr>0)
{
string messagestr;
messagestr.Format("ERROR: FFT returned error code %d",ierr);
MessageBox(NULL,messagestr);
}
FFTtof.SetSize(npts);
FFTsig.SetSize(npts);
It appears that the data in the worksheet columns "FFTtof" and "FFTsig" are not changed by fft_lowpass. What am I doing wrong?