blockInterpolator

Increasing the sampling frequency with linear interpolation and optional mean value filtering
Diagram of Interpolator

Extends from Icons.PartialBlockIcon (Icon for a discrete/continuous block).

Information

This block decreases the sampling time from the sampling time of the input signal (= inputSampleFactor*sampleClock.sampleTime) to the sampling time of the output signal (= outputSampleFactor*sampleClock.sampleTime). This is performed by linear interpolation between the current and the last sample leading to a delay of one input sampling period. Optionally, the resulting signal is filtered with a mean value FIR-filter, in order to remove undesired frequencies introduced by the linear interpolation. In most cases it is adviceable to utilize this filter. Note, the inputSampleFactor must be an integer multiple of the outputSampleFactor.

This block is demonstrated with example Examples.Interpolator leading to the following result when filtering a sine-signal with "continuous" (interpolator1.y), "discrete, unfiltered" (interpolator2.y) and "discrete, filtered" (interpolator3.y) Interpolator:

Parameters

TypeNameDefaultDescription
Types.BlockTypeWithGlobalDefaultblockTypeModelica_LinearSystems2.Controller.Types.BlockTypeWithGlobalDefault.UseSampleClockOptionType of block
BooleancontinuousblockType == Types.BlockTypeWithGlobalDefault.Continuous or blockType == Types.BlockTypeWithGlobalDefault.UseSampleClockOption and sampleClock.blockType == Types.BlockType.ContinuousTrue, if continuous block, otherwise discrete block
IntegerinputSampleFactor1Input sample time = inputSampleFactor * sampleClock.sampleTime
IntegeroutputSampleFactor1<html>Output sample time = outputSampleFactor * sampleClock.sampleTime<br>(inputSampleFactor must be an integer multiple of outputSampleFactor)</html>
BooleanmeanValueFiltertrue= true and discrete block, linearly interpolated signal is filtered by mean value filter

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputuContinuous or discrete input signal of block
Modelica.Blocks.Interfaces.RealOutputyContinuous or discrete output signal of block