SPKitRectifier


User's Guide

SPKitRectifier is a signal rectifier. By defaulf, it acts as a full-wave rectifier, i.e., converts negative input samples to their absolute values. The setHalfWave() function sets SPKitRectifier to half-wave mode. There, negative input samples are converted to zero.

Programmer's Reference

Defined in <spkit/rectifie.h>
Inherits from SPKitProcessor

SPKitRectifier overrides getSample() for rectifying the input signal.

Public Members

void setHalfWave(int onOrOff)
Set half-wave mode mode to 1 (on) or 0 (off).

int getHalfWave()
Returns 1 when half-wave mode is on, 0 otherwise.

int getSample(SPKitSample& outputSample, SPKitProcessor* caller)
Retrieve a processed audio sample.

getSample() requests a sample from its input and stores the absolute value of the sample in outputSample.

The function returns 0 when all its inputs run out of samples, 1 otherwise.

Protected Members

int halfWave
half-wave mode state


Return to top level.

Auhor: Kai Lassfolk