Upsampling increases the sampling rate of the input AOs by an integer factor, which can be very useful for example to reduce data load.
Upsample can take the following parameters:Examples
1. Upsampling a sequence of random data at original sampling rate of 1 Hz by a factor of 10 with no initial phase.
pl = plist('tsfcn', 'randn(size(t))','nsecs',100,'fs',1,'yunits','m'); x=ao(pl); pl_up = plist('N', 10); % increase the sampling frequency by a factor of 10 x_up = upsample(x, pl); % resample the input AO (x) to obtain the upsampled AO (y) iplot(x, x_up) % plot original and upsampled data
2. Upsampling a sequence of random data at original sampling rate of 1 Hz by a factor of 21 with a phase of 20 samples. a filter defined by the user.
pl_upphase = plist('N', 21,'phase', 20); % increase the sampling frequency and add phase of 20 samples to the upsampled data x_upphase = upsample(x, pl_upphase); % resample the input AO (x) to obtain the upsampled and delayed AO (y) iplot(x, x_upphase) % plot original and upsampled data