Downsamples a time series in place by an integer power of two.
The routine LALResampleREAL4TimeSeries() provided functionality to downsample a time series in place by an integer factor which is a power of two. Upsampling, non-integer resampling and resampling by a factor which is not a power of two are currently unsupported. Attempts to use this methods will cause the function to abort with an error message.
On entry the input time series ts
should contain the data to be resampled, with the data, length and sample interbal of the time series populated. The parameter structure params
should have the value of deltaT
set to the desired value sample interval of the output data. The type of filter used to perform the low pass filter should be set in the parameter structure field filterType
. The parameter structure field filterParams
may be ignored at present. It is designed to allow user defined low pass filters and is not currently implemented. The resampling function will behave correctly even if this contains garbage on entry.
On exit, the time series ts
will contain the resampled time series. The length of the time series will be reduced by the resampling ratio and the sample interval will be set correctly.
There is no time shift in the output time series when either the defaultButterworth or LDASfirLP low pass filter types are used. The timestamp of each point in the output time series is the same as the timestamp of the corresponding point in input time series.
There will be corrupted data at the start and end of the time series when either the defaultButterworth or LDASfirLP low pass filter types are used. This is caused by corruption due to the low pass filter. Users should take care to truncate these points from the time series before using the output in subsequent filtering applications.
The input time series is first low passed to remove any power above the new Nyquist frequency. There are two available low pass filters:
defaultButterworth: The input time series has a time domain low pass filter applied by the LALDButterworthREAL4TimeSeries() function from the tdfilters package. The filter order is \(20\) and the attenuation is \(0.1\) at the new Nyquist frequency. Since the butterworth filter is applied forwards and backwards there is no time delay or phase shift of the output data. The disadvantage of the butterworth filter is that since it is an IIR filter, it is not possible to determine the exact length of corrupted data at the start and end of the output time series. Care should be taked to avoid using these regions of data in subsequent filtering.
LDASfirLP: The input time series has a time domain low pass filter applied by the LALDIIRFilterREAL4Vector() function from the tdfilters package. This applies an FIR filter with coefficents generated by the LDAS firlp()
dataconditioning API action. FIR coefficents are available for downsampling by a factor of 2, 4 or 8. An attempt to downsample by any other ratio will cause an error. The FIR coeffients are equivalent to the default resample()
action in the dataconditioning API.
The FIR filter causes the a time delay of 10 points in the output time series and corruption of the first \(n\) points. \(n\) is given by the order of the filter by \(n = 2 \times 10 \times q\), where \(q\) is the resampling ratio. To account for this, we do the following:
Inf
. This means that there is no time delay in the output time series, but the first and last \(n/2q\) points are set to zero. Care should be taked to avoid using these regions of data in subsequent filtering. If the debug level is set to LALWARNING, a message is printed reporting how many points at the start and end of time series are corrupted.
The filter coefficents used were produced by LDAS-CIT running version 0.7.0 of LDAS. See the LDAS dataconditioning API documentation for more information.
Prototypes | |
int | XLALResampleREAL4TimeSeries (REAL4TimeSeries *series, REAL8 dt) |
int | XLALResampleREAL8TimeSeries (REAL8TimeSeries *series, REAL8 dt) |
void | LALResampleREAL4TimeSeries (LALStatus *status, REAL4TimeSeries *ts, ResampleTSParams *params) |
int XLALResampleREAL4TimeSeries | ( | REAL4TimeSeries * | series, |
REAL8 | dt | ||
) |
Definition at line 125 of file ResampleTimeSeries.c.
int XLALResampleREAL8TimeSeries | ( | REAL8TimeSeries * | series, |
REAL8 | dt | ||
) |
Definition at line 173 of file ResampleTimeSeries.c.
void LALResampleREAL4TimeSeries | ( | LALStatus * | status, |
REAL4TimeSeries * | ts, | ||
ResampleTSParams * | params | ||
) |
Definition at line 225 of file ResampleTimeSeries.c.