Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DCBlocker Class Reference

Estimates the DC (very low frequency) content of a signal so it can be removed to form a DC blocker. More...

#include <gin_dcblocker.h>

Public Member Functions

 DCBlocker ()
 
 ~DCBlocker ()
 
void setSampleRate (float sampleRate_)
 
void setCutoff (float cutoff_)
 
float process (float x)
 Returns the low-pass (DC) estimate of x.
 
void reset ()
 

Detailed Description

Estimates the DC (very low frequency) content of a signal so it can be removed to form a DC blocker.

process() returns a first-order low-pass estimate of the input's DC bias. To block DC, subtract that estimate from the input: the difference is the high-passed signal. This is useful after certain DSP operations (like waveshaping or oscillators) that may introduce DC bias.

Key Features:

Usage:

blocker.setSampleRate(44100.0f);
blocker.setCutoff(10.0f); // Treat content below 10 Hz as DC
// Per-sample processing: subtract the DC estimate to block DC
float output = input - blocker.process(input);
Estimates the DC (very low frequency) content of a signal so it can be removed to form a DC blocker.
Definition gin_dcblocker.h:45
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25

Note: This is a per-sample filter. For stereo, use two instances.

See also
WTOscillator

Constructor & Destructor Documentation

◆ DCBlocker()

DCBlocker::DCBlocker ( )

◆ ~DCBlocker()

DCBlocker::~DCBlocker ( )

Member Function Documentation

◆ setSampleRate()

void DCBlocker::setSampleRate ( float  sampleRate_)

◆ setCutoff()

void DCBlocker::setCutoff ( float  cutoff_)

◆ process()

float DCBlocker::process ( float  x)

Returns the low-pass (DC) estimate of x.

Subtract this from x to block DC.

Referenced by WTOscillator::processAdding().

◆ reset()

void DCBlocker::reset ( )

The documentation for this class was generated from the following file: