DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::OfflineHardClipper< T > Class Template Referencefinal

OFFLINE ONLY: calibrates an antialiased hard curve on the complete source. More...

#include <OfflineHardClipper.h>

Inheritance diagram for dspark::OfflineHardClipper< T >:
Collaboration diagram for dspark::OfflineHardClipper< T >:

Additional Inherited Members

- Public Types inherited from dspark::detail::OfflineClipProcessor< T, false >
enum  Reason
 
using Curve = OfflineSoftClipCurve
 
using Options = std::conditional_t< Soft, OfflineSoftClipOptions, OfflineClipOptions >
 
- Public Member Functions inherited from dspark::detail::OfflineClipProcessor< T, false >
PlanResult makePlan (OfflineAudioSource< T > &source, const typename OfflineEnergyAnalyzer< T >::Analysis &analysis, const Options &options={}, const OfflineJobOptions &jobOptions={}) const
 Reuses complete-source energy analysis; no PCM or filtered audio is retained.
 
PlanResult analyze (OfflineAudioSource< T > &source, const Options &options={}, const OfflineJobOptions &job={}) const
 Analyzes the complete source and makes a reusable worker plan.
 
Result render (OfflineAudioSource< T > &source, const Plan &plan, OfflineAudioSink< T > &sink, const OfflineJobOptions &job={}) const
 Calibrates actual PCM, then verifies a provisional render before committing it.
 
Result run (const AudioBuffer< T, MaxChannels > &input, AudioBuffer< T, MaxChannels > &output, double sampleRate, const Options &options={}, const OfflineJobOptions &job={}) const
 Owning render; aliasing is safe and failure leaves output unchanged.
 
- Static Public Attributes inherited from dspark::detail::OfflineClipProcessor< T, false >
static constexpr double kTailTolerance
 Bound on the omitted exterior tail of the clipped signal: the accuracy the analysis padding is sized for. Float output uses 1e-9; the render then differs from a 1e-10 one by at most 3 ulp at -149 dB re peak, below the format's resolution, and runs 2.2x faster on 3 s of noise (Sine, 12 dB) and 1.4x on drums. Double output keeps 1e-10.
 

Detailed Description

template<FloatType T>
class dspark::OfflineHardClipper< T >

OFFLINE ONLY: calibrates an antialiased hard curve on the complete source.

Uses the same analysis, numerical integration, calibration and transactional renderer as OfflineSoftClipper. Options::reductionDb is positive 0..12 dB; zero preserves exact PCM. Oversampling is explicit (1/2/4/8/16, default 4). At factor 1 the clipping residual of a 32-sample windowed-sinc reconstruction is integrated over each sample interval and band-limited by a continuous kernel flat to 0.40 fs and below -65 dB from 0.47 fs on all of its images, so distortion folded across Nyquist is removed wherever it lands. A sine clipped by 6 dB leaves a -95 dB alias floor at 10 kHz / 48 kHz and -108 dB at 5 kHz / 44.1 kHz, with harmonics below 20 kHz within -84 dB of the exact clipped sine; distortion above 0.40 fs is attenuated with it. A shared ceiling links mono/stereo channels. Internal latency is compensated. Exclusions preserve exact PCM with external 5 ms feathers. An unreachable target returns a failure and never publishes provisional output. Peak refers to the final samples; true peak is measured separately, without extra limiting.

Threading: synchronous worker only; source and plan remain immutable. Owned plans may be reused on the same source. No processSample/processBlock API.

Definition at line 35 of file OfflineHardClipper.h.


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