Difference between revisions of "Component: Waveform Generator (DSP Inputs)"
(4 intermediate revisions by the same user not shown) | |||
Line 93: | Line 93: | ||
[[File:FreqGenMulti.jpg]] | [[File:FreqGenMulti.jpg]] | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 114: | Line 124: | ||
− | === | + | ===GenerateArray=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GenerateArray''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Fills the output buffer with the selected waveform data. If the buffer is smaller or larger then the waveform data period then the data passed will follow on correctly for subsequent cycles. |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 138: | Line 138: | ||
− | === | + | ===GetOffset=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetOffset''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the current phase of the wave as an index from 0 to Num Samples. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 171: | Line 171: | ||
− | === | + | ===ModifyPhaseOffset=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ModifyPhaseOffset''' |
+ | |- | ||
+ | | colspan="2" | Shifts the output phase by the specified absolute angle in degrees. | ||
|- | |- | ||
− | |||
|- | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | PhaseOffset | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | colspan="2" | Phase offset in degrees |
− | | width="90%" | | + | |- |
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | Absolute | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 0=Relative offset to current o/p 1=Absolute offset to initial o/p |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 190: | Line 195: | ||
− | === | + | ===SetOffset=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetOffset''' |
+ | |- | ||
+ | | colspan="2" | Sets the current phase of the wave as an index from 0 to Num Samples. | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
+ | | width="90%" | Offset | ||
|- | |- | ||
+ | | colspan="2" | Offset Index: 0 to Num Samples -1 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Line 274: | Line 282: | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Frequency Calculation | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Frequency Calculation - Reference Only |
|- | |- | ||
|- | |- |
Latest revision as of 11:31, 23 October 2023
Author | Matrix Ltd |
Version | 1.2 |
Category | DSP Inputs |
Contents
Waveform Generator component
A waveform generator component designed to plug into the DSP system component and allow several discreet waveforms to be generated. Functions available include: Sine, Cosine, Square, Pulse, Triangle, Sawtooth, Noise, Custom
Component Source Code
Please click here to download the component source project: FC_Comp_Source_DSP_Wave_Gen.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_DSP_Wave_Gen.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Basic Sine Wave Generator
FreqGen The frequency is controlled by adjusting the potentiometer on the panel.
The frequency generator period is controlled using the Period Offset property and/or the SetOffset component macro. The Offset value is the LUT index multiplier so a offset of 3.0 will only read every 3 values of the waveform to provide 1/3 of the period and generate 3 x the frequency. As the waveform period is being reduced there is potential for the signal to start to become less defined and more stepped.
Multi Wave Signal Generator
Switch-able mode frequency generator example file generating different waveforms depending on the value on pins RB0 and RB1.
0 = Sine, 1 = Square, 2 = Triangle, 3 = SawTooth
The frequency is controlled by adjusting the potentiometer on the panel, the waveform is controlled by adjusting the switches on the panel.
Macro reference
Generate
GenerateArray
GetOffset
GetOffset | |
Gets the current phase of the wave as an index from 0 to Num Samples. | |
- UINT | Return |
ModifyFrequency
ModifyFrequency | |
Sets the frequency output rate by altering the period offset to a new value. | |
- FLOAT | OffsetRate |
0.2=F/5 0.5=F/2 1.0=F 1.5=F*1.5 2.0=F*2 | |
- VOID | Return |
ModifyPhaseOffset
SetOffset
SetOffset | |
Sets the current phase of the wave as an index from 0 to Num Samples. | |
- UINT | Offset |
Offset Index: 0 to Num Samples -1 | |
- VOID | Return |