Wiki

This version (22 Jun 2012 14:56) was approved by William Jahn.The Previously approved version (21 Jun 2012 20:59) is available.Diff

Square Root

Click here to return to the Basic DSP page


The Square Root block takes the square root of the input and outputs the result.

Input Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Input xdecimal - anyInput signal

Output Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Output sqrt(x)decimal - anyOutput signal

Algorithm Description

This is the “standard” implementation of the square root function. It provides an approximation of the square root value of the input. For negative inputs to the block, the absolute value is taken before calculating the square root. Imaginary numbers are not supported. The following graph shows an input tone signal full scale at 500Hz (blue) and the resulting output through the square root block (red).



Standard Vs. Ultra Precision
The main difference between this “standard” implementation and the Ultra Precision square root, is instruction program count vs. accuracy. The ultra precision algorithm requires many more instructions (141 compared to 81) but is a bit accurate execution of the square root function for the SigmaDSP processor.

The accuracy difference between the two algorithms is a noise floor around approximately -78dB. The below plot shows a subtraction of the outputs from the Ultra Precision and the Standard square root functions. Notice that the noise floor difference is independent of signal level, thus the square root using the Standard approach is less accurate for low level signals.



Example

The sample schematic shown here was the schematic used to generate the first plot. A sine tone source at 500Hz is sent to the output and also to the square root block. Notice that for negative values of the sine tone, the square root block treats the values as if they were positive.



Algorithm Details

Toolbox PathBasic DSP - Arithmetic Operations - Square Root - Square Root
Cores SupportedAD1940
ADAU170x
ADAU144x
ADAU176x
ADAU178x
“Grow Algorithm” Supportedno
“Add Algorithm” Supportedyes - see Algorithm Addition Information
Subroutine/Loop Basedno
Program RAM81
Data RAM3
Parameter RAMnone

Algorithm Addition Information

DescriptionWhen the square root algorithm is grown, a second pair of input pins is added to the control.
Program RAM Repetition81 per add
Data RAM Repetition2 per add
Parameter RAM Repetitionnone
resources/tools-software/sigmastudio/toolbox/basicdsp/squareroot.txt · Last modified: 22 Jun 2012 14:56 by William Jahn