| LTPDA Toolbox | contents | ![]() |
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 desired output sample rate can be expressed as an integer ratio P/Q where both P and Q then band-limited interpolation can be 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 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', [10 20], ...
'Markers', {'o', '.'}, ...
'LineStyles', {'-', 'none'})) % plot original and resampled data
|
Upsampling a time-series AO | Interpolation of a time-series AO | ![]() |
©LTP Team