Home > data-analysis > manip > cont > cont_resample.m

cont_resample

PURPOSE ^

cont_resample resample cont variable to given sampling rate

SYNOPSIS ^

function resampled_cont = cont_resample(cont, sampling_rate)

DESCRIPTION ^

cont_resample   resample cont variable to given sampling rate

 resampled_cont = cont_resample(cont, sampling_rate)

 We convert pos into a time series so that it's easy to resample it.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function resampled_cont = cont_resample(cont, sampling_rate)
0002 %cont_resample   resample cont variable to given sampling rate
0003 %
0004 % resampled_cont = cont_resample(cont, sampling_rate)
0005 %
0006 % We convert pos into a time series so that it's easy to resample it.
0007 ts = cont2ts(cont);
0008 timeProps = get(ts, 'TimeInfo');
0009 new_basis = timeProps.Start:1/sampling_rate:timeProps.End;
0010 ts = resample(ts, new_basis);
0011 resampled_cont = ts2cont(ts);
0012 end

Generated on Tue 23-May-2017 03:00:58 by m2html © 2005