#ifndef FRVFFT #define FRVFFT #ifndef _POSIX_SOURCE #define _POSIX_SOURCE #endif /*---------------------------------------------------------------------------*/ /* Author : F. Marion, B.Mours and D.Buskulic LAPP (Annecy) Nov 16, 2001 */ /*---------------------------------------------------------------------------*/ #include "FrameL.h" #include "FrvBuf.h" #ifdef __cplusplus extern "C" { #endif struct FrvRFFT { /*--------------------- input data -------------*/ double decay; /* decay time for averageing (could by changed) */ long nDecay; /* #of fft for the mean spectrum(could be reset)*/ int fftSize; /* fftsize fft vector size */ int decimate; /* decimation apply (no decimate if set to 0) */ /*------------------- internal data ------------*/ FRBOOL optionA; /* if = FR_YES compute the average amplitude */ FRBOOL optionH; /* if = FR_YES apply an hanning window */ FRBOOL optionO; /* if = FR_YES overlapp data by half a vector */ FRBOOL optionN; /* if = FR_YES normalized the result by sqrt(Hz)*/ FRBOOL optionP; /* if = FR_YES suppress the pedestal(mean value)*/ FRBOOL optionS; /* if = FR_YES compute the amplitude spectrum */ long nData; /* number of data points used by the fft */ long nDataP2; /* nearest log base2 of nBin */ double dt; /* time sampling frequency */ double dnu; /* frequency bin size */ struct FrVect *window; /* vector to hold the window */ struct FrVect *output; /* vector to hold the last data chunk */ struct FrvBuf *buffer; /* internal buffer for vector resizing */ char *name; /* name of the input vector */ /* ------------output------------------------- */ double mean; /* time serie mean value */ struct FrVect *amplitude; /* vector to hold the last amplitude spectrum */ struct FrVect *amplitudeA; /* vector to hold the averaged amplitude */ long nFFT; /* number of fft computed */ char err[256]; /* hold error message if any */ void* plan; /* FFTW plan(type is rfftw_plan) */ }; typedef struct FrvRFFT FrvRFFT; void FrvRFFTFree(FrvRFFT* fft); int FrvRFFTInit(FrvRFFT *fft, FrVect *vect); FrvRFFT* FrvRFFTNew(char* option, int fftSize, int decimate); FrvRFFT* FrvRFFTFor(FrvRFFT *fft, FrVect *vect); void FrvRFFTSetDecay(FrvRFFT* fft, double decay); void FrvFFTD704(double *a, long msign); #ifdef __cplusplus } #endif #endif