mfilt.farrowsrc
(Removed) Sample rate converter with arbitrary conversion factor
Compatibility
mfilt.farrowsrc
has been removed. Use dsp.FarrowRateConverter
instead. For more details, see Version History.
Syntax
hm = mfilt.farrowsrc(L,M,C)
hm = mfilt.farrowsrc
hm = mfilt.farrowsrc(l,...)
Description
hm = mfilt.farrowsrc(L,M,C)
returns a filter object that is a natural
extension of dfilt.farrowfd
with a time-varying fractional delay. It provides
an economical implementation of a sample rate converter with an arbitrary conversion factor. This
filter works well in the interpolation case, but may exhibit poor anti-aliasing properties in the
decimation case.
Note
You can use the realizemdl
method to create a Simulink® block of a filter created using mfilt.farrowsrc
.
Input Arguments
The following table describes the input arguments for creating
hm
.
Input Argument | Description |
---|---|
| Interpolation factor for the filter. |
| Decimation factor for the filter. |
| Coefficients for the filter. When no input arguments are specified, the default
coefficients are |
hm = mfilt.farrowsrc
constructs the filter using
the default values for l
, m
, and
c
.
hm = mfilt.farrowsrc(l,...)
constructs the filter
using the input arguments you provide and defaults for the argument you omit.
mfilt.farrowsrc Object Properties
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
mfilt.farrowsrc
objects. The next table describes each property for an
mfilt.farrowsrc
filter object.
Name | Values | Description |
---|---|---|
| Character vector | Reports the type of filter object. You cannot set this property — it is
always read only and results from your choice of |
| Character vector | Reports the arithmetic precision used by the filter. |
| Vector | Vector containing the coefficients of the FIR lowpass filter |
| Integer | Interpolation factor for the filter. It specifies the amount to increase the input sampling rate. |
| Integer | Decimation factor for the filter. It specifies the amount to increase the input sampling rate. |
|
| 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.
|
Examples
Interpolation by a factor of 8. This object removes the spectral replicas in the signal after interpolation.
[L,M] = rat(48/44.1); Hm = mfilt.farrowsrc(L,M); % We use the default filter Fs = 44.1e3; % Original sampling frequency n = 0:9407; % 9408 samples, 0.213 seconds long x = sin(2*pi*1e3/Fs*n); % Original signal, sinusoid at 1kHz y = filter(Hm,x); % 10241 samples, still 0.213 seconds stem(n(1:45)/Fs,x(1:45)) % Plot original sampled at 44.1kHz hold on % Plot fractionally interpolated signal (48kHz) in red stem((n(2:50)-1)/(Fs*L/M),y(2:50),'r','filled') xlabel('Time (sec)');ylabel('Signal value') legend('44.1 kHz sample rate','48kHz sample rate')
The results of the example are shown in the following figure: