Overview
Two piece interpolation module
Discussion
This module performs interpolation using two line segments with a knee between the two pieces. The parameter threshold specifies the point of intersection of the two lines. The kneeDepth specifies the curvature of the smooth region connecting the two line segments. If kneeDepth is zero, then there is no knee, simply two lines connected to each other at the threshold point. If kneeDepth is nonzero, then the curved region will begin at threshold-kneeDepth and ends at threshold+kneeDepth. The slopeL and slopeH are the slopes of the left hand side line and right hand side line respectively.
...
When ratios are used and a ratio equals 0 then the corresponding slope is set to 1e6 (prevent divide by zero).
Type Definition
Code Block |
---|
typedef struct _ModuleTwoPieceInterpV2 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 threshold; // The point at which two line segments meet INT32 useRatios; // Specifies whether the line segments are specified using their slopes (=0) or ratios (=1) FLOAT32 slopeL; // The slope of the line segment on the left hand side FLOAT32 slopeH; // The slope of the line segment on the right hand side FLOAT32 ratioL; // 1/slope of the line segment on the left hand side FLOAT32 ratioH; // 1/slope of the line segment on the right hand side FLOAT32 kneeDepth; // Specifies the curvature of the smooth region connecting the two line segments FLOAT32* polyCoeffs; // Interpolation coefficients returned by the grid control. } ModuleTwoPieceInterpV2Class; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
threshold | float | parameter | 0 | -20 | -100:0.1:100 | |
useRatios | int | parameter | 0 | 0 | 0:1 | |
slopeL | float | parameter | 0 | 1 | -100:100 | |
slopeH | float | parameter | 0 | 1 | -100:100 | |
ratioL | float | parameter | 0 | 1 | -100:100 | |
ratioH | float | parameter | 0 | 1 | -100:100 | |
kneeDepth | float | parameter | 0 | 2 | 0:100 | |
polyCoeffs | float* | derived | 1 | [4 x 1] | Unrestricted |
Pins
Input Pins
Name: in
Description: audio input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: two_piece_interp_v2_module.m
...