Contents

dsp.CICInterpolator System object

Package: dsp

Interpolate signal using Cascaded Integrator-Comb filter

Description

The CICInterpolator object interpolates inputs using a Cascaded Integrator-Comb (CIC) filter. Inputs and outputs to the object have signed fixed-point data types. You must have a Fixed-Point Designer™ license to use the CICInterpolator System object™.

To interpolate inputs using a CIC filter:

  1. Define and set up your System object. See Construction.

  2. Call step to interpolate the input according to the properties of dsp.CICInterpolator. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.CICInterpolator returns a System object, H, that you can use to interpolate the input with a cascaded integrator-comb (CIC) interpolation filter.

H = dsp.CICInterpolator('PropertyName',PropertyValue,...) returns a CIC interpolation object, H, with each specified property set to the value you specify.

H = dsp.CICInterpolator(R,M,N,'PropertyName',PropertyValue,...) returns a CICInterpolator object, H, with the InterpolationFactor property set to R, the DifferentialDelay property set to M, the NumSections property set to N, and other specified properties set to the values you specify.

Properties

InterpolationFactor

Interpolation factor of filter

Specify a positive integer amount by which the object interpolates the input signal. The default is 2.

DifferentialDelay

Differential delay of filter comb sections

Specify a positive integer delay value for the object to use in each comb section of the filter. The default is 1.

NumSections

Number of integrator and comb sections

Specify the number of integrator and comb sections in the CIC filter as a positive integer value. The default is 2.

FixedPointDataType

Fixed-point property setting

Specify the fixed-point data type as one of | Full precision | Minimum section word lengths | Specify word lengths | Specify word and fraction lengths |. The default is Full precision. When you set this property to:

  • Full precision – the CICInterpolator object automatically determines the word and fraction lengths of the filter sections and output.

  • Minimum section word length – the object automatically determines the word and fraction lengths of the filter sections and the fraction length of the output. You must specify the OutputWordLength.

  • Specify word lengths – the object automatically determines the fraction lengths of the filter sections and the output. You must specify values for the OutputWordLength and the SectionWordLengths properties.

  • Specify word and fraction lengths – the object does not automatically determine word and fraction lengths for the filter sections or the output. You must specify them using the OutputFractionLength, OutputWordLength, SectionFractionLengths, and SectionWordLengths properties.

SectionWordLengths

Word length of each filter section

Specify the fixed-point word length for each section of the CIC filter as a scalar or a vector of length 2*NumSections. This property applies only when you set the FixedPointDataType property to Specify word lengths or Specify word and fraction lengths. The default is [16 16 16 16].

SectionFractionLengths

Fraction length of each filter section

Specify the fixed-point fraction length for each section of the CIC filter as a scalar or a vector of length 2*NumSections. This property applies only when you set the FixedPointDataType property to Specify word and fraction lengths. The default is 0.

OutputWordLength

Word length of filter output

Specify the fixed-point word length for the filter output. This property applies only when you set the FixedPointDataType property to Minimum section word lengths, Specify word lengths, orSpecify word and fraction lengths. The default is 32.

OutputFractionLength

Fraction length of filter output

Specify the fixed-point fraction length for the output of the CIC filter. This property applies only when you set the FixedPointDataType property to Specify word and fraction lengths. The default is 0.

Methods

cloneCreate CIC Interpolator object with same property values
freqzFrequency response
fvtoolOpen filter visualization tool
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
impzImpulse response
isLockedLocked status for input attributes and nontunable properties
phasezUnwrapped phase response
releaseAllow property value and input characteristics changes
resetReset internal states of CIC Interpolator object
stepInterpolate signal using Cascaded Integrator-Comb filter

More Analysis Methods for Filter System Objects.

Examples

Interpolate signal by a factor of 2 (upsample the signal from 22.05 kHz to 44.1 kHz):

hcicint = dsp.CICInterpolator(2);
%    default NumSections = 2, DifferentialDelay = 1

% Create fixed-point sinusoidal input signal 
Fs = 22.05e3;      % Original sampling frequency
n = (0:511)';      % 512 samples, 0.0113 sec signal
x = fi(sin(2*pi*1e3/Fs*n),true,16,15); 

% Create SignalSource System object
hsr = dsp.SignalSource(x, 32); 

% Interpolate output with 64 samples per frame
y = zeros(16,64);
for ii=1:16
     y(ii,:) = step(hcicint,step( hsr ));   
end

% Plot first frame of original and interpolated signals.
% Output latency is 2 samples.  
gainCIC = ...
   (hcicint.InterpolationFactor*hcicint.DifferentialDelay)...
   ^hcicint.NumSections/hcicint.InterpolationFactor;
stem(n(1:31)/Fs, double(x(1:31)),'r','filled'); hold on; 
stem(n(1:61)/(Fs*hcicint.InterpolationFactor), ...
   double(y(1,4:end))/gainCIC,'b'); 
xlabel('Time (sec)');ylabel('Signal Amplitude');
legend('Original signal', 'Interpolated signal',...
   'location', 'north');
hold off;    

Algorithms

This object implements the algorithm, inputs, and outputs described on the CIC Interpolation block reference page. The object properties correspond to the block properties, except:

  • The Framing block parameter is not supported by the dsp.CICInterpolation object. The object always maintains the input frame rate.

  • The Rate options block parameter is not supported by the dsp.CICInterpolation object.

  • The Input processing block parameter is not supported by the dsp.CICInterpolation object.

  • The object does not have a property that allows you to specify the source of the coefficients. The object cannot import coefficients from an mfilt object.

Was this topic helpful?