FSineOsc

[FOsc](API\Runtime\SignalProcessing\DSP\FOsc) Direct-form sinusoid oscillator.

Windows
MacOS
Linux

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

Name Description

Protected variable

float

 

Add

Protected variable

float

 

B1

Protected variable

float

 

B2

Protected variable

float

 

FrequencyHz

Protected variable

int32

 

SampleRate

Protected variable

float

 

Scale

Protected variable

float

 

Yn_1

Protected variable

float

 

Yn_2

Constructors

Name Description

Public function

FSineOsc()

Constructor

Public function

FSineOsc

(
    const int32 InSampleRate,
    const float InFrequencyHz,
    const float Scale,
    const float Add
)

Non-default constructor

Destructors

Name Description

Public function Virtual

~FSineOsc()

Virtual destructor

Functions

Name Description

Public function Const

float

 

GetFrequency()

Returns the current frequency.

Public function

void

 

Init

(
    const int32 InSampleRate,
    const float InFrequencyHz,
    const float Scale,
    const float Add
)

Initialize the oscillator with a sample rate and new frequency.

Public function

float

 

ProcessAudio()

Generates the next sample of the oscillator.

Public function

void

 

SetAdd

(
    const float InAdd
)

Sets the scale of the oscillator.

Public function

void

 

SetFrequency

(
    const float InFrequencyHz
)

Sets the frequency of the oscillator in Hz (based on sample rate).

Public function

void

 

SetScale

(
    const float InScale
)

Sets the scale of the oscillator.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss