Class thl::dsp::utils::FrequencyShifter#

class FrequencyShifter#

Single-sideband frequency shifter using a Hilbert-transform approximation.

Two parallel chains of four first-order allpass filters approximate a 90° phase difference (Hilbert transform) over ~20 Hz – 20 kHz. The real and imaginary outputs are multiplied by a complex exponential to shift all frequencies by a constant Hz offset.

Positive shiftHz shifts up; negative shifts down. Allpass coefficients are pre-optimised for 44.1–48 kHz sample rates.

Call prepare() before use.

Public Functions

FrequencyShifter()#
void prepare(float shift_hz, float sample_rate)#
void set_shift(float hz)#
void reset()#
float process(float x)#