Resampling is the process of changing the sampling rate of data. Resample changes the sampling rate of the input AOs to the desired output sampling frequency by performing band-limited interpolation, or interpolation.
If the ratio of the input and the output sample rate can be expressed as an integer ratio P/Q where both P and Q are smaller than 100, the band-limited interpolation is performed. In this case, the data-series is upsampled (by inserting zeros) and then a low-pass filter is applied at the original Nyquist frequency. In all other cases, the data are interpolated on to a higher-rate time-grid using spline interpolation.
In order to use this method,
b = resample(a, pl)
With the following parameter:
Key | Description |
---|---|
FSOUT |
The desired output sample. |
Here we will resample a sequence of random data from the original sampling rate of 1 Hz to an output sampling of 50 Hz.
pl = plist('tsfcn', 'randn(size(t))','nsecs',100,'fs',1,'yunits','m'); x = ao(pl) pl_re = plist('fsout', 50); x_re = resample(x, pl_re); % resample the input AO (x) to obtain the resampled output AO (y) iplot(x, x_re, plist('XRanges', [0 1], ... 'Markers', {'o', 's'}, ... 'LineStyles', {'-', 'none'})) % plot original and resampled data