Table of Contents

Class FunctionGenerator

Namespace
Bonsai.Dsp
Assembly
Bonsai.Dsp.dll

Represents an operator that generates signal waveforms following any of a set of common periodic functions.

public class FunctionGenerator : Source<Mat>
Inheritance
FunctionGenerator
Inherited Members

Properties

Amplitude

Gets or sets the amplitude of the signal waveform.

public double Amplitude { get; set; }

Property Value

double

BufferLength

Gets or sets the number of samples in each output buffer.

public int BufferLength { get; set; }

Property Value

int

Depth

Gets or sets the bit depth of each element in an output buffer.

[TypeConverter(typeof(DepthConverter))]
public Depth? Depth { get; set; }

Property Value

Depth?

Remarks

If this property is not specified, the bit depth of output buffers will be F64.

DepthSpecified

Gets a value indicating whether the Depth property should be serialized.

[Browsable(false)]
public bool DepthSpecified { get; }

Property Value

bool

Frequency

Gets or sets the frequency of the signal waveform, in Hz.

[Range(1, 2147483647)]
public double Frequency { get; set; }

Property Value

double

Offset

Gets or sets the optional DC-offset of the signal waveform.

public double Offset { get; set; }

Property Value

double

Phase

Gets or sets the optional phase offset, in radians, of the signal waveform.

[Range(-3.141592653589793, 3.141592653589793)]
public double Phase { get; set; }

Property Value

double

SampleRate

Gets or sets the sampling rate of the generated signal waveform, in Hz.

public int SampleRate { get; set; }

Property Value

int

Waveform

Gets or sets a value specifying the periodic waveform used to sample the signal.

public FunctionWaveform Waveform { get; set; }

Property Value

FunctionWaveform

Methods

Generate()

Generates an observable sequence of buffers sampled from a signal waveform following the specified periodic function.

public override IObservable<Mat> Generate()

Returns

IObservable<Mat>

A sequence of Mat objects representing signal sampling buffers of a fixed length. See BufferLength.

Generate<TSource>(IObservable<TSource>)

Generates an observable sequence of buffers sampled from a signal waveform following the specified periodic function, and where each new buffer is emitted only when an observable sequence emits a notification.

public IObservable<Mat> Generate<TSource>(IObservable<TSource> source)

Parameters

source IObservable<TSource>

The sequence containing the notifications used for emitting signal buffers.

Returns

IObservable<Mat>

A sequence of Mat objects representing signal sampling buffers of a fixed length. See BufferLength.

Type Parameters

TSource

The type of the elements in the source sequence.