Check the sampling resolution of the frequencies and return the interval of the sequence.
int fft_sampling_resolution( int iSize, double * vFreq, double * dTimeInterval )
returns 0 for evenly spaced frequencies and error codes
INVALID_SIZE: the size of the sequency is less than 2
INVALID_INTERVAL: invalid interval -- the interval is less than 1e-20
UNEVENLY_SPACE: unevenly spaced values.
EX1
//Assume the current column one is the time sequence. This piece of code get the time inte- //rval and tell wheather the elements of time sequence are uniformly spaced or not. #include <..\originlab\fft.h> void TEST_fft_sampling_resolution() { double dTimeInterval; Worksheet wks = Project.ActiveLayer(); if(wks) { Dataset dsTime(wks, 0); vector vTime = dsTime; int ret; ret = fft_sampling_resolution(dsTime.GetSize(), vTime, &dTimeInterval); if (ret != 0) out_str("Elements of time sequence are not uniformly spaced"); // then dTimeInterval is the value of time interval of time sequence } }
fft.h