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. LTPDA resample overloads resample function of Matlab Signal Processing Toolbox for AOs.
b = resample(a, pl)
The following parameters can be set:
2. Resampling a sequence of random data at original sampling rate of 1 Hz at an output sampling of 50 Hz.
% create an AO of random data with fs = 10 Hz pl = plist('tsfcn', 'randn(size(t))','fs',1,'nsecs',100,'yunits','m'); x = ao(pl); y = resample(x, plist('fsout', 50)); % resample the input AO (x) to obtain the resampled output AO (y) iplot(x, y) % plot original and resampled data
1. Resampling a sequence of random data at original sampling rate of 10 Hz at an output sampling of 1 Hz with a filter defined by the user.
% create an AO of random data with fs = 10 Hz pl = plist('tsfcn', 'randn(size(t))','fs',10,'nsecs',10,'yunits','m'); x = ao(pl) % filter definition plfilter = plist('type','lowpass','Win',specwin('Kaiser', 10, 150),'order',32,'fs',10,'fc',1); f = mfir(plfilter) % resampling pl = plist('fsout', 1, 'filter',f); % define parameters list with fsout = 1 Hz and the defined filter y = resample(x, pl); % resample the input AO (x) to obtain the resampled output AO (y) iplot(x, y) % plot original and resampled data
![]() |
Upsampling data | Interpolating data | ![]() |
©LTP Team