Skip to content

TwoPieceInterp

Discussion

THIS MODULE IS DEPRECATED AND NOT RECOMMENDED FOR NEW DESIGNS. PLEASE USE THE TwoPieceInterpV2 MODULE INSTEAD.

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 .

Module Pack

Deprecated

ClassID

classID = 2045

Type Definition

typedef struct _ModuleTwoPieceInterp
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
FLOAT32 threshold;                            // The point at which two line segments meet
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 kneeDepth;                            // Specifies the curvature of the smooth region connecting the two line segments
FLOAT32* polyCoeffs;                          // Interpolation coefficients returned by the grid control.
} ModuleTwoPieceInterpClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
threshold float parameter 0 -20 -100:100
slopeL float parameter 0 1 -100:100
slopeH float parameter 0 1 -100:100
kneeDepth float parameter 0 2 0:100
polyCoeffs float* derived 0 [4 x 1] Unrestricted

Pins

Input Pins

Name in
Description audio input
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real

Output Pins

Name out
Description audio output
Data Type float

Matlab Usage

File Name: two_piece_interp_module.m 
 function M=two_piece_interp_module(NAME) 
 This Audio Weaver module performs interpolation using two line segments 
 with a knee between the two pieces. 

 Arguments: 
    NAME - name of the module. 

Copyright (c) 2026 DSP Concepts, Inc.