Main Content

comm.IntegrateAndDumpFilter

Integrate discrete-time signal with periodic resets

Description

The comm.IntegrateAndDumpFilter System object™ creates a cumulative sum of the discrete-time input signal, while resetting the sum to zero according to a fixed schedule. When the simulation begins, the object discards the number of samples specified in the Offset property. After this initial period, the object sums the input signal along columns and resets the sum to zero every N input samples, set by the integration period property. The reset occurs after the object produces output at that time step.

To integrate discrete-time signals with periodic resets:

  1. Create the comm.IntegrateAndDumpFilter object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

intdump = comm.IntegrateAndDumpFilter creates an integrate-an- dump filter System object, intdump. This object integrates over a number of samples in an integration period, and then resets at the end of that period.

intdump = comm.IntegrateAndDumpFilter(period,Name=Value) sets the IntegrationPeriod property to period.

intdump = comm.IntegrateAndDumpFilter(___,Name=Value) sets properties using one or more optional name-value arguments in addition to the any of the input argument combinations in the previous syntaxes. For example, comm.IntegrateAndDumpFilter(IntegrationPeriod=4) sets the integration period to 4.

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Integration period, specified as an integer in the range [2, ∞). The integration period defines the length of the sample blocks that the object integrates between resets.

Data Types: double

Number of offset samples, specified as a nonnegative integer or nonnegative integer vector. This property specifies the number of input samples that the object discards from each column of input data at the beginning of data processing.

When you set the Offset property to a nonzero value, the object outputs zeros in place of the discarded initial input samples.

When you specify this property as a vector of length L, each element of the vector represents the number of samples to discard from the corresponding column of the input data matrix. The length of the vector L must match the number of columns in the input data matrix.

When you specify this property as a scalar value, the object applies the same offset to each column of the input data matrix. The offset creates a transient effect, rather than a persistent delay.

Data Types: double

Decimation control of the output data, specified as a logical 0 (false) or 1 (true).

  • When you set the DecimateOutput property to true, the integrate-and-dump filter returns one output sample consisting of the final integration value for each block of IntegrationPeriod input samples. If the input is a K×IntegrationPeriod-by-L matrix, the output is a K×IntegrationPeriod-by-L matrix.

  • When you set the DecimateOutput property to false, the integrate and dump filter returns IntegrationPeriod output samples consisting of the intermediate cumulative sum values for each block of IntegrationPeriod input samples. In this case, inputs and outputs have the same dimensions.

Fixed-Point Properties

Full-precision override for fixed-point arithmetic, specified as one of these options.

  • When you set the FullPrecisionOverride property to true, the object computes all internal arithmetic and output data types using full-precision rules. These rules provide the most accurate fixed-point numerics. The object turns off the display of other fixed-point properties because they do not apply individually. These rules guarantee that no quantization occurs within the object. You can add bits, as needed, to ensure that no round-off or overflow occurs.

  • When you set the FullPrecisionOverride property to false, the object controls fixed-point data types through individual fixed-point property settings.

For more information, see Full Precision for Fixed-Point System Objects.

Method for rounding of fixed-point numeric values, specified as "Ceiling", "Convergent", "Floor", "Nearest", "Round", "Simplest", or "Zero".

Dependencies

To enable this property, set the FullPrecisionOverride property to false.

Action when fixed-point numeric values overflow, specified as "Wrap" or "Saturate". This property specifies the action to be taken in the case of an overflow. Overflow occurs when the magnitude of a fixed-point calculation result does not fit into the range of the data type and scaling that stores the result.

Dependencies

To enable this property, set the FullPrecisionOverride property to false.

Data type of the accumulator, specified as "Full precision", "same as input", or "Custom".

When you set this property to "Full precision", the object automatically calculates the word and fraction lengths of the accumulator output.

Dependencies

To enable this property, set the FullPrecisionOverride property to false.

Fixed-point data type of the accumulator, specified as a scaled numerictype (Fixed-Point Designer) object with a signedness of Auto.

Dependencies

To enable this property, set the AccumulatorDataType property to "Custom".

Data type of the output, specified as "Same as accumulator", "Same as input", or "Custom".

Dependencies

To enable this property, set the AccumulatorDataType property to "Custom".

Fixed-point data type of the output, specified as a scaled numerictype (Fixed-Point Designer) object with a signedness of Auto.

Dependencies

To enable this property, set the FullPrecisionOverride property to false and the OutputDataType property to "Custom".

Usage

Description

Y = intdump(X) periodically integrates blocks of N samples from the input data, X.

example

Input Arguments

expand all

Input data, specified as a column vector or matrix. X must consist of K×N rows, where K is a positive integer, and have one or more columns. The object treats each column as an independent channel, performing integration along each column.

Data Types: single | double | fi

Output Arguments

expand all

Output data, returned as a matrix or column vector. The dimensions of output Y vary based on the value assigned to the DecimateOutput property.

Data Types: single | double | fi

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Create an integrate-and-dump filter having an integration period of 20 samples.

intdump = comm.IntegrateAndDumpFilter(20);

Generate binary data.

data = randi([0 1],50,1);

Upsample the data and pass it through an additive white Gaussian noise channel.

unsampledData = upsample(data,20);
noisyData = awgn(unsampledData,25,"measured");

Pass the noisy data through the filter.

filteredData = intdump(noisyData);

Plot the original and filtered data. The integrate-and-dump filter removes most of the noise effects.

stairs([data filteredData])
legend("Original data","Filtered data")
xlabel("Samples")
ylabel("Amplitude")
grid

Figure contains an axes object. The axes object with xlabel Samples, ylabel Amplitude contains 2 objects of type stair. These objects represent Original data, Filtered data.

More About

expand all

Extended Capabilities

Version History

Introduced in R2012a

See Also

Objects