Example for RDM::TIME_SERIES template classes. This example needs a compiled schema, time_series_fft.sdl.
This example shows usage of the RDM::TIME_SERIES template classes with several classes including a split. The RDM::TIME_SERIES::transaction class can start a transaction by calling RDM::TIME_SERIES::transaction::begin(). It know which tables to lock and will also capture the state of the classes in the chain. When done with inserting data, RDM::TIME_SERIES::transaction::end() can be called. If for any reason an error condition is encountered, RDM::TIME_SERIES::transaction::rollback() can be called. It will roll the transaction back and also restore the stae of the classes.
The data passed to RDM::TIME_SERIES::transaction will be passed to RDM::TIME_SERIES::split which in turn will pass the same data to both classes in the split. Each class in the chain does what it is repsonsible for and passes it on untill it has been inserted into the database.
The example further show usage of two of the FFT classes we have provided. RDM::TIME_SERIES::fft_abs_positive does a Fast Fourier Transform (FFT) with a result set of the DC value and the absolute value of all the positive frequencies. RDM::TIME_SERIES::fft_abs does the same except that it also includes the negative frequencies.
The RDM::TIME_SERIES::scale class scales the result according to the ration specified and RDM::TIME_SERIES::arithmetic_mean computes the average values.