Navigation
API > API/Runtime > API/Runtime/SignalProcessing > API/Runtime/SignalProcessing/DSP
References
| Module | SignalProcessing |
| Header | /Engine/Source/Runtime/SignalProcessing/Public/DSP/SinOsc.h |
| Include | #include "DSP/SinOsc.h" |
Syntax
class FSineOsc
Remarks
FOsc Direct-form sinusoid oscillator. Created with a biquad filter (using only feedback coefficients) with poles directly on unit circle in z-plane. Setting frequency uses current filter state to compute initial conditions to avoid pops when changing frequency. Extremely cheap to run but expensive to set new frequencies. Good for test tones.
Variables
| Type | Name | Description | |
|---|---|---|---|
| float | Add | ||
| float | B1 | ||
| float | B2 | ||
| float | FrequencyHz | ||
| int32 | SampleRate | ||
| float | Scale | ||
| float | Yn_1 | ||
| float | Yn_2 |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FSineOsc () |
Constructor | ||
FSineOsc
(
const int32 InSampleRate, |
Non-default constructor |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FSineOsc () |
Virtual destructor |
Functions
| Type | Name | Description | |
|---|---|---|---|
| float | GetFrequency () |
Returns the current frequency. | |
| void | Init
(
const int32 InSampleRate, |
Initialize the oscillator with a sample rate and new frequency. | |
| float | ProcessAudio () |
Generates the next sample of the oscillator. | |
| void | SetAdd
(
const float InAdd |
Sets the scale of the oscillator. | |
| void | SetFrequency
(
const float InFrequencyHz |
Sets the frequency of the oscillator in Hz (based on sample rate). | |
| void | SetScale
(
const float InScale |
Sets the scale of the oscillator. |