Direct-form FIR polyphase fractional interpolator
hm = mfilt.firfracinterp(l,m,num)
mfilt.firfracinterp will be removed in
a future release. Use
hm = mfilt.firfracinterp(l,m,num) returns a direct-form FIR polyphase fractional interpolator
l is the interpolation factor. It
must be an integer. If not specified,
m is the decimation factor. Like
it must be an integer. If you do not specify
the calling syntax, it defaults to 1. If you also do not specify a
m defaults to 2.
num is a vector containing the coefficients
of the FIR lowpass filter used for interpolation. If omitted, a lowpass
Nyquist filter of gain
l and cutoff frequency of π/
is used by default.
By specifying both a decimation factor and an interpolation
factor, you can interpolate your input signal by noninteger amounts.
The fractional interpolator first interpolates the input, then decimates
to result in an output signal whose sample rate is
the input rate. For proper interpolation, you specify
be greater than
m. By default, the resulting interpolation
factor is 3/2 when you do not provide
the calling syntax.
The following table describes the input arguments for creating
Interpolation factor for the filter.
Vector containing the coefficients of the FIR lowpass
filter used for interpolation. When
Decimation factor for the filter.
Every multirate filter object has properties that govern the
way it behaves when you use it. Note that many of the properties are
also input arguments for creating
The next table describes each property for an
Reports the type of filter object. You cannot set this
property — it is always read only and results from your choice
Vector containing the coefficients of the FIR lowpass filter used for interpolation.
Reports the decimation (
Determines whether the filter states are restored to
their starting values for each filtering operation. The starting values
are the values in place when you create the filter if you have not
changed the filter since you constructed it.
Stored conditions for the filter, including values for the interpolator and comb states.
To convert a signal from 32 kHz to 48 kHz requires fractional
interpolation. This example uses the
to upsample an input signal. Setting
l = 3 and
2 returns the same
mfilt object as the default
l = 3; m = 2; % Interpolation/decimation factors. hm = mfilt.firfracinterp(l,m); % We use the default filter fs = 32e3; % Original sample freq: 32 kHz. n = 0:6799; % 6800 samples, 0.212 second long signal x = sin(2*pi*1e3/fs*n); % Original signal, sinusoid at 1 kHz y = filter(hm,x); % 10200 samples, still 0.212 seconds stem(n(1:32)/fs,x(1:32),'filled') % Plot original sampled at % 32 kHz hold on; % Plot fractionally interpolated signal (48 kHz) in red stem(n(1:48)/(fs*l/m),y(20:67),'r') xlabel('Time (sec)');ylabel('Signal Value')
The ability to interpolate by fractional amounts lets you raise the sampling rate from 32 to 48 kHz, something you cannot do with integral interpolators. Both signals appear in the following figure.