Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
spectral_envelope_shifter.hpp File Reference

Spectral-envelope estimation and formant warping for phase-vocoder frame groups. More...

#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <pulp/signal/source_filter_analysis.hpp>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::signal::SpectralEnvelopeShifterConfig
class  pulp::signal::SpectralEnvelopeShifterT< SampleType >

Namespaces

namespace  pulp
namespace  pulp::signal

Typedefs

using pulp::signal::SpectralEnvelopeShifter = SpectralEnvelopeShifterT<float>
using pulp::signal::SpectralEnvelopeShifter64 = SpectralEnvelopeShifterT<double>

Detailed Description

Spectral-envelope estimation and formant warping for phase-vocoder frame groups.

Estimates the spectral envelope of a frame group by cepstral smoothing (homomorphic liftering per Oppenheim & Schafer, Discrete-Time Signal Processing) optionally refined with true-envelope iterations (Röbel & Rodet, "Efficient Spectral Envelope Estimation and its Application to Pitch Shifting and Envelope Preservation," DAFx 2005), then rescales every channel's bins by E(k * warp) / E(k).

warp semantics: features of the envelope at frequency f move to f / warp. A resample-based pitch shifter that scales the spectrum by pitch_ratio passes warp = pitch_ratio to preserve formants, and warp = pitch_ratio / formant_ratio to additionally shift them; a pure formant shift uses warp = 1 / formant_ratio.

The envelope is estimated once per frame from the channel group's RMS magnitude and the same gain is applied to every channel, so inter-channel relationships (and identical channels) are preserved.

warp must be finite and positive; invalid values fail closed without changing the frame. warp == 1 is an exact bypass. No allocation after prepare().