Signal Processing Toolbox™ provides a number of functions that resample a signal at a higher or lower rate.
Apply FIR filter with resampling
Cubic spline interpolation
Other 1-D interpolation
Resample at new rate
For examples, see
resample function changes the sample
rate for a sequence to any rate that is proportional to the original by a ratio of
two integers. The basic syntax for
y = resample(x,p,q)
where the function resamples the sequence
p/q times the original sample rate. The length of the result
p/q times the length of
One resampling application is the conversion of digitized audio signals from one sample rate to another, such as from 48 kHz (the digital audio tape standard) to 44.1 kHz (the compact disc standard). See Convert from DAT Rate to CD Sample Rate for an example.
resample applies a lowpass filter to the input sequence to
prevent aliasing during resampling. The function designs this filter using the
firls function with a Kaiser window.
You can control the filter length and the beta parameter of the Kaiser window.
Alternatively, you can use the function
intfilt to design an interpolation filter.
interp functions are equivalent to
1, respectively. These functions
provide different antialiasing filtering options, and they incur a slight signal
delay due to filtering.
The toolbox also contains a function,
upfirdn, that applies an FIR filter
to an input sequence and outputs the filtered sequence at a sample rate different
than its original. See Multirate Filter Bank Implementation.
The standard MATLAB® environment contains a function,
spline, that works with irregularly spaced data. The function
interp1 performs interpolation, or
table lookup, using various methods including linear and cubic interpolation.