Component: Scale (DSP Operators): Difference between revisions
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 93: | Line 93: | ||
LeftShift(4) = Multiply by 16 / RightShift(4) = Divide by 16 | LeftShift(4) = Multiply by 16 / RightShift(4) = Divide by 16 | ||
| Line 107: | Line 111: | ||
===Calculate=== | ===Calculate=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Calculate''' | ||
|- | |- | ||
| colspan="2" | Performs the selected scaling on a value from the input buffer and passes to the output buffer. | | colspan="2" | Performs the selected scaling on a value from the input buffer and passes to the output buffer. | ||
| Line 121: | Line 125: | ||
===CalculateArray=== | ===CalculateArray=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CalculateArray''' | ||
|- | |- | ||
| colspan="2" | Performs the selected scaling on an entire buffer. | | colspan="2" | Performs the selected scaling on an entire buffer. | ||
| Line 135: | Line 139: | ||
===SetScalerFloat=== | ===SetScalerFloat=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetScalerFloat''' | ||
|- | |- | ||
| colspan="2" | Sets the Float scaler to be used when calling the calculate function. | | colspan="2" | Sets the Float scaler to be used when calling the calculate function. | ||
| Line 154: | Line 158: | ||
===SetScalerInteger=== | ===SetScalerInteger=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetScalerInteger''' | ||
|- | |- | ||
| colspan="2" | Sets the Integer scaler to be used when calling the calculate function. | | colspan="2" | Sets the Integer scaler to be used when calling the calculate function. | ||
| Line 174: | Line 178: | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 200: | Line 204: | ||
| colspan="2" | Sets the data direction flow of the component | | colspan="2" | Sets the data direction flow of the component | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Scaling | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix Ltd |
| Version | 1.1 |
| Category | DSP Operators |
Scale component
Allows the values in a single buffer to be scaled uniformly. Functions include: Multiply, Divide, LeftShift, RightShift, Float Multiply, Float Divide
Component Source Code
Please click here to download the component source project: FC_Comp_Source_DSP_Scale.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_DSP_Scale.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Here is an example which demonstrates variable scaling based on an analogue input.
Here are the traces as seen on the data recorder window.
The RightShift macro is a very efficient means of performing a division but only for values which are a power of 2.
The LeftShift macro is a very efficient means of performing a multiplication but only for values which are a power of 2.
LeftShift(1) = Multiply by 2 / RightShift(1) = Divide by 2
LeftShift(2) = Multiply by 4 / RightShift(2) = Divide by 4
LeftShift(3) = Multiply by 8 / RightShift(3) = Divide by 8
LeftShift(4) = Multiply by 16 / RightShift(4) = Divide by 16
Macro reference
Calculate
| Calculate | |
| Performs the selected scaling on a value from the input buffer and passes to the output buffer. | |
| Return | |
CalculateArray
| CalculateArray | |
| Performs the selected scaling on an entire buffer. | |
| Return | |
SetScalerFloat
| SetScalerFloat | |
| Sets the Float scaler to be used when calling the calculate function. | |
| Scaler | |
| Return | |
SetScalerInteger
| SetScalerInteger | |
| Sets the Integer scaler to be used when calling the calculate function. | |
| Scaler | |
| Return | |
