Interpolator filter specification
D = fdesign.interpolator(L)
D = fdesign.interpolator(L,RESPONSE
)
D = fdesign.interpolator(L,CICRESPONSE
,D
)
D = fdesign.interpolator(L,RESPONSE
,spec
)
D = fdesign.interpolator(...,spec
,specvalue1,specvalue2,...)
D = fdesign.interpolator
(...,Fs)
d = fdesign.interpolator
(...,MAGUNITS)
constructs
an interpolator filter specification object D = fdesign.interpolator(L)
D
with
the InterpolationFactor
property equal to the positive
integer L
and the Response
property
set to 'Nyquist'
. The default values for the transition
width and stopband attenuation in the Nyquist design are 0.1π
radians/sample and 80 dB. If L
is unspecified, L
defaults
to 2.
D = fdesign.interpolator(L,
constructs
a interpolator specification object with the interpolation factor RESPONSE
)L
and the 'Response'
property set to one of the supported
types.
D = fdesign.interpolator(L,
constructs
a CIC or CIC compensator interpolator specification object with the
interpolation factor, CICRESPONSE
,D
)L
, and 'Response'
property
equal to 'CIC'
or 'CICCOMP'
. D
is
the differential delay. The differential delay, D
,
must precede any specification option.
D = fdesign.interpolator(L,
constructs
object RESPONSE
,spec
)D
and sets its Specification
property
to spec
. Entries in the spec
represent
various filter response features, such as the filter order, that govern
the filter design. Valid entries for spec
depend
on the design type of the specifications object.
When you add the spec
input argument, you
must also add the RESPONSE
input argument.
Because you are designing multirate filters, the specification
options available are not the same as the specifications for designing
singlerate filters with design methods such as fdesign.lowpass
.
The options are not case sensitive.
The interpolation factor L
is not in the
specification options. The different filter responses support different
specifications. The following table lists the supported response types
and specification options.
Design Method  Valid Specification Options 

 See

 See

 See

 See


To specify a CIC interpolator,
include the differential delay after 
 See
To specify a CIC compensator interpolator,
include the differential delay after 


'Gaussian' 
The specification must be preceded by an
integervalued 
 See
If you use the quasilinear IIR design
method, 
 See

 See

 See

 See

 See

 See

D = fdesign.interpolator(...,
constructs
an object spec
,specvalue1,specvalue2,...)D
and sets its specifications at construction
time.
D = fdesign.
adds
the argument interpolator
(...,Fs)Fs
, specified in Hz, to define the
sampling frequency to use. In this case, all frequencies in the specifications
are in Hz as well.
d = fdesign.
specifies
the units for any magnitude specification you provide in the input
arguments. interpolator
(...,MAGUNITS)MAGUNITS
can be one of
'linear'
— specify the magnitude
in linear units.
'dB'
— specify the magnitude
in dB (decibels).
'squared'
— specify the
magnitude in power units.
When you omit the MAGUNITS
argument, fdesign
assumes
that all magnitudes are in decibels. Note that fdesign
stores
all magnitude specifications in decibels (converting to decibels when
necessary) regardless of how you specify the magnitudes.
These examples show how to construct interpolating filter specification
objects. First, create a default specifications object without using
input arguments except for the interpolation factor l
.
l = 2; d = fdesign.interpolator(2);
Now create an object by passing a specification option 'fst1,fp1,fp2,fst2,ast1,ap,ast2
'
and a design — the resulting object uses default values for
all of the filter specifications. You must provide the design input
argument when you include a specification.
d=fdesign.interpolator(8,'bandpass','fst1,fp1,fp2,fst2,ast1,ap,ast2');
Create another interpolating filter object, passing the specification
values to the object rather than accepting the default values for,
in this case, fp
,fst
,ap
,ast
.
d=fdesign.interpolator(3,'lowpass',.45,0.55,.1,60);
Now pass the filter specifications that correspond to the specifications
— n
,fc
,ap
,ast
.
d=fdesign.interpolator(3,'ciccomp',1,2,'n,fc,ap,ast',... 20,0.45,.05,50);
With the specifications object in your workspace, design an
interpolator using the equiripple
design
method.
hm = design(d,'equiripple');
Pass a new specification type for the filter, specifying the filter order.
d = fdesign.interpolator(5,'CIC',1,'fp,ast',0.55,55);
With the specifications object in your workspace, design an
interpolator using the multisection
design method.
hm = design(d,'multisection');
d=fdesign.interpolator(8,'bandpass','fst1,fp1,fp2,fst2,ast1,ap,ast2',... 0.25,0.35,.55,.65,50,.05,1e3);
In this, the last example, use the linear
option
for the filter specification object and specify the stopband ripple
attenuation in linear form.
d = fdesign.interpolator(4,'lowpass','n,fst,ap,ast',15,0.55,.05,... 1e3,'linear'); % 1e3 = 60dB.
Now design a CIC interpolator for a signal sampled at 19200 Hz. Specify the differential delay of 2 and set the attenuation of information beyond 50 Hz to be at least 80 dB.
The filter object sampling frequency is (l
x fs
)
where fs
is the sampling frequency of the input
signal.
dd = 2; % Differential delay. fp = 50; % Passband of interest. ast = 80; % Minimum attenuation of alias components in passband. fs = 600; % Sampling frequency for input signal. l = 32; % Interpolation factor. d = fdesign.interpolator(l,'cic',dd,'fp,ast',fp,ast,l*fs); hm = design(d); %Use the default design method.
This next example results in a minimumorder CIC compensator
that interpolates by 4 and compensates for the droop in the passband
for the CIC filter hm
from the previous example.
nsecs = hm.numberofsections; d = fdesign.interpolator(4,'ciccomp',dd,nsecs,... 50,100,0.1,80,fs); hmc = design(d,'equiripple'); hmc.arithmetic = 'fixed';
hmc
is designed to compensate for hm
.
To see the effect of the compensating CIC filter, use FVTool to analyze
both filters individually and include the compound filter response
by cascading hm
and hmc
.
hfvt = fvtool(hmc,hm,cascade(hmc,hm),'fs',[fs,l*fs,l*fs],... 'showreference','off'); legend(hfvt,'CIC Compensator','CIC Interpolator',... 'Overall Response');
FVTool returns with this plot.
For the third example, use fdesign.interpolator
to
design a minimumorder Nyquist interpolator that uses a Kaiser window.
For comparison, design a multistage interpolator as well and compare
the responses.
l = 15; % Set the interpolation factor and the Nyquist band. tw = 0.05; % Specify the normalized transition width. ast = 40; % Set the minimum stopband attenuation in dB. d = fdesign.interpolator(l,'nyquist',l,tw,ast); hm = design(d,'kaiserwin'); hm2 = design(d,'multistage'); % Design the multistage interpolator. hfvt = fvtool(hm,hm2); legend(hfvt,'Kaiser Window','Multistage')
FVTool shows both responses.
Design a lowpass interpolator for an interpolation factor of 8. Compare the singlestage equiripple design to a multistage design with the same interpolation factor.
l = 8; % Interpolation factor. d = fdesign.interpolator(l,'lowpass'); hm(1) = design(d,'equiripple'); % Use halfband filters whenever possible. hm(2) = design(d,'multistage','usehalfbands',true); hfvt = fvtool(hm); legend(hfvt,'SingleStage Equiripple','Multistage')
fdesign
 fdesign.arbmag
 fdesign.arbmagnphase
 fdesign.interpolator
 fdesign.rsrc
 setspecs