Wiki

This version (20 Dec 2016 13:04) was approved by Venkatesan Krishnamoorthy.The Previously approved version (29 Nov 2016 19:08) is available.Diff

Asymmetric soft clipper



The Asymmetric soft clipper block is a soft clipper that clips the level of the input signal asymmetrically according to the set clipping thresholds. As the input signal reaches the clip threshold at either ends, the algorithm rounds the edges for a smoother clipped output.

The module supports two algorithms:
1.Standard Cubic Clip
2.Advanced Clip

Input Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Inputdecimal - audioInput signal to be clipped

Output Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Outputdecimal - audioThe soft-clipped output

GUI Controls


1.Standard Cubic clipper

GUI Control NameDefault ValueRangeFunction Description
Clip up10.1-10This pre/post scalar determines the amount of clipping that will occur at the positive part of the input signal. Although this influences the threshold value of the clipper, this is not the value at which clipping occurs. [See the function in the Algorithm Description]
Clip down10.1-10This pre/post scalar determines the amount of clipping that will occur at the negative part of the input signal. Although this influences the threshold value of the clipper, this is not the value at which clipping occurs. [See the function in the Algorithm Description]



2.Advanced clipper

GUI Control NameDefault ValueRangeFunction Description
Clip up10.1-0.9This pre/post scalar determines the amount of clipping that will occur at the positive part of the input signal. Although this influences the threshold value of the clipper, this is not the value at which clipping occurs. [See the function in the Algorithm Description]
Clip down10.1-0.9This pre/post scalar determines the amount of clipping that will occur at the negative part of the input signal. Although this influences the threshold value of the clipper, this is not the value at which clipping occurs. [See the function in the Algorithm Description]

DSP Parameter Information

1.Standard Cubic

GUI Control NameCompiler NameFunction Description
Alpha1SoftClipAlg1alpha1
SoftClipAlg1alpha1m1
When the Clip up value is changed in the GUI window, two parameters are downloaded to the DSP. The alpha1 value is written directly to the DSP as well as the inverse 1/alpha1 is written to the DSP.
Alpha2SoftClipAlg1alpha2
SoftClipAlg1alpha2m1
When the Clip down value is changed in the GUI window, two parameters are downloaded to the DSP. The alpha2 value is written directly to the DSP as well as the inverse 1/alpha2 is written to the DSP.

Note: There are other fixed parameters used for this algorithm, but they do not need to be updated when the alpha value is changed.

2.Advance Clip

GUI Control NameCompiler NameFunction Description
tau1SoftClipAlg1tau1
SoftClipAlg1onemtau1
SoftClipAlg1inv_onemtau1
When the Clip up value is changed in the GUI window, two parameters are downloaded to the DSP. The tau1 value is written directly to the DSP as well as 1/(1-tau1) and (1-tau1) is written to the DSP.
tau2SoftClipAlg1tau2
SoftClipAlg1onemtau2
SoftClipAlg1inv_onemtau2
When the Clip down value is changed in the GUI window, two parameters are downloaded to the DSP. The tau2 value is written directly to the DSP as well as 1/(1-tau2) and (1-tau2) is written to the DSP.

Algorithm Description

1.Standard Cubic


The Standard Cubic block asymmetrically clips portions of signal voltages according to a cubic asymmetric soft clip function. The pre/post scalar alpha1 and alpha2 make the soft clip more or less severe. alpha1 sets the clipping threshold for the positive part of the input signal, whereas alpha2, sets the clipping threshold for the lower part of the input signal.This block limits the range of the output signal according to the following formulas:


Output = Alpha1*f(x), if x>0
Output = Alpha2*f(x), if x<=0
x= Input*(1/Alpha1), if Input>0
x= Input*(1/Alpha2), if Input<=0
f(x)= {-2/3, x<=-1;
\\
x-x^3/3, -1<x<1; 
\\
2/3, x>=1}

Thus for the default value of Alpha1 = 1, Alpha2=1, the signal range will be from [-2/3, 2/3]. Changing the value of Alphas will affect the output range of the signal. The following graphs show the relationship between changing values of Alphas and obtaining different signal ranges.


Example

The following image shows the Soft Clipper, being compared to a Hard Clipper and also the direct signal coming from the Inputs.



The Hard Clipper and Soft Clipper are set with corresponding Alpha and threshold values so that their clip behavior occurs at the same time. However, you will notice in the following output comparison graph, the Soft Clipper has rounded smoother edges on the output where clipping begins to occur which has a more pleasing auditory effect.



Algorithm Details

Toolbox PathNon Linear Processors - Clippers - Soft Clip -Asymmetric Cubic Clip- Asymmetric Soft clipper
Cores SupportedADAU145x
“Grow Algorithm” Supportedyes - see Algorithm Growth Information
“Add Algorithm” Supportedno
Subroutine/Loop Basedno

Algorithm Growth Information

DescriptionWhen the SoftClip algorithm is grown, an extra pair of input/output pints is added to the control. The same Alpha parameter affects the clipping on grown Input pins.



2.Advanced Clip


The Advanced clip block asymmetrically clips portions of signal voltages according to a TanH asymmetric soft clip function. The pre/post scalar alpha1 and alpha2 make the soft clip more or less severe. alpha1 sets the clipping threshold for the positive part of the input signal, whereas alpha2, sets the clipping threshold for the lower part of the input signal.This block limits the range of the output signal according to the following formulas:


Output = Input, if |Input|<tau1 for Input>0, |Input|<tau2 for Input<0
Output = tau1 + (1 - tau1)*tanh((abs(Input) - tau1)/(1 - tau1)), if|Input|>=tau1 and Input>0
Output = -tau2 -(1 - tau2)*tanh((abs(Input) - tau2)/(1 - tau2)), if|Input|>=tau2 and Input<0





Thus for the default value of tau1 = 0.5, tau2=0.5. Changing the value of taus will affect the output range of the signal.

Example


The graph below shows an input sine tone and the resulting clipped output with threshold values at: Clip Up: 0.8 Clip Down: 0.2

Algorithm Details

Toolbox PathNon Linear Processors - Clippers - Soft Clip -Asymmetric Advanced Clip- Asymmetric Soft clipper
Cores SupportedADAU145x
“Grow Algorithm” Supportedyes - see Algorithm Growth Information
“Add Algorithm” Supportedno
Subroutine/Loop Basedno

Algorithm Growth Information

DescriptionWhen the SoftClip algorithm is grown, an extra pair of input/output pints is added to the control. The same Alpha parameter affects the clipping on grown Input pins.
resources/tools-software/sigmastudio/toolbox/nonlinearprocessors/asymmetricsoftclipper.txt · Last modified: 15 Dec 2016 07:57 by Prasad Kamath