| Filter Design Toolbox | ![]() |
Construct an FIR hold interpolator mfilt object
Syntax
Description
hm = mfilt.holdinterp(l)
returns the object hm that represents a hold interpolator with the interpolation factor l. To work, l must be an integer. When you do not include l in the calling syntax, it defaults to 2. To perform interpolation by noninteger amounts, use one of the fractional interpolator objects, such as mfilt.firsrc or mfilt.firfracinterp.
When you use this hold interpolator, the samples added to the input signal between existing samples have the value of the most recent sample from the original signal. Thus you see something like a staircase profile where the interpolated samples form a plateau between the previous and next original samples. The example demonstrates this profile clearly. Compare this to the interpolation process for other interpolators in the toolbox, such as mfilt.linearinterp.
Input Arguments
The following table describes the input arguments for creating hm.
mfilt.holdinterp 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.holdinterp objects.The next table describes each property for an mfilt.holdinterp filter object.
Examples
To see the effects of hold based interpolation, interpolate an input sine wave from 22.05 to 44.1 KHz. Among other things to see, note that each added sample retains the value of the most recent original sample.
l = 2; % Interpolation factor hm = mfilt.holdinterp(l); fs = 22.05e3; % Original sampling frequency: 22.05 KHz n = 0:5119; % 5120 samples, 0.232 second long signal x = sin(2*pi*1e3/fs*n); % Original signal, sinusoid at 1 KHz y = filter(hm,x); % 10240 samples, still 0.232 seconds stem(n(1:22)/fs,x(1:22),'filled') % Plot original sampled at % 22.05 KHz hold on % Plot interpolated signal (44.1 KHz) in red stem(n(1:44)/(fs*l),y(1:44),'r') xlabel('Time (sec)');ylabel('Signal Value')
See Also
mfilt.linearinterp, mfilt.firinterp, mfilt.firfracinterp, mfilt.cicinterp, mfilt.cicinterpzerolat
| mfilt.firtdecim | mfilt.linearinterp | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |