DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
FrequencyShifter.h File Reference

Frequency shifting (not pitch shifting) using Hilbert transform. More...

#include "../Core/AudioBuffer.h"
#include "../Core/AudioSpec.h"
#include "../Core/DenormalGuard.h"
#include "../Core/DspMath.h"
#include "../Core/Hilbert.h"
#include "../Core/StateBlob.h"
#include <algorithm>
#include <atomic>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <numbers>
#include <vector>
Include dependency graph for FrequencyShifter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dspark::FrequencyShifter< T >
 Constant-Hz frequency shift optimized via Quadrature Oscillator. More...
 

Namespaces

namespace  dspark
 Main namespace for the DSPark framework.
 

Detailed Description

Frequency shifting (not pitch shifting) using Hilbert transform.

Shifts all frequency components by a fixed amount in Hz using Single Sideband (SSB) modulation. Unlike pitch shifting, this does NOT preserve harmonic relationships.

Implementation: Applies a Hilbert transform to extract the analytic signal (I + jQ). The complex signal is modulated by a quadrature oscillator e^(j*2*pi*f*t). To ensure phase coherency when mixing Dry/Wet, the "Dry" signal is taken directly from the real branch of the Hilbert transformer, avoiding comb-filtering.

Threading: prepare() belongs to the setup thread; processBlock() and reset() belong to the audio thread. Setters are lock-free atomic publications, safe from any thread, consumed at the next processBlock(). Non-finite setter arguments are ignored.

Dependencies: Hilbert.h, DspMath.h, AudioSpec.h, AudioBuffer.h, StateBlob.h.

Definition in file FrequencyShifter.h.