Downsampling data


Downsampling is the process of reducing the sampling rate of a signal. Downsample reduces the sampling rate of the input AOs by an integer factor by picking up one out of N samples. Note that no anti-aliasing filter is applied to the original data. Moreover, a offset can be specified, i.e., the sample at which the output data starts ---see examples below.

Syntaxis

	b = downsample(a, pl)
  

With the following parameters:

Examples

1. Downsampling a sequence of random data at original sampling rate of 10 Hz by a factor of 4 (fsout = 2.5 Hz) and no offset.

	x=ao(tsdata(randn(100,1),10)); % create an AO of random data with fs = 10 Hz
	pl = plist(); % create an empty parameters list 
	pl = append(pl, param('factor', 4)); % add the decimation factor
	y = downsample(x, pl); % downsample the input AO, x
	iplot(x, y) % plot original,x, and decimated,y, AOs
  
Downsample

2. Downsampling a sequence of random data at original sampling rate of 10 Hz by a factor of 4 (fsout = 2.5 Hz) and offset = 10.

	x=ao(tsdata(randn(100,1),10)); % create an AO of random data with fs = 10 Hz.
	pl = plist(); % create an empty parameters list 
	pl = append(pl, param('factor', 4)); % add the decimation factor
	pl = append(pl, param('offset', 10)); % add the offset parameter
	y = downsample(x, pl); % downsample the input AO, x
	iplot(x, y) % plot original,x, and decimated,y, AOs
  
Downsample




©LTP Team