Address external review: generator tests, class param docs, nits
- Add deterministic generator-level tests: BitReduceTests (level snapping + 1-bit floor), SampleRateDecimateTests (sample-and-hold groups), and ReverseDelayTests (silent-then-flat-replay). Asserts are output-gain independent. - Add class-level `- Parameters:` doc blocks to BitReduce, SampleRateDecimate, and ReverseDelay (dual-location param docs). - BitReduce: clamp the shift amount directly and note shift-safety; clarify mid-tread wording. - ReverseDelay: comment the unreachable baseAddress guard. Suite 247. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,11 @@ private let sampleRateDecimateZeroBlock: [Double] = makeSampleBuffer()
|
||||
///
|
||||
/// `downsample` is read at control rate (once per block). `1` passes the signal through; `N` holds
|
||||
/// each sample for `N` output samples (effective rate `sampleRate / N`). Output is mono (channel 0).
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - input: Audio-rate signal to decimate.
|
||||
/// - downsample: Hold length in samples — effective rate is `sampleRate / downsample`. Control
|
||||
/// rate; clamped to `>= 1` (`1` is transparent).
|
||||
public final class SampleRateDecimate: GeneratorBase, AudioGenerator {
|
||||
|
||||
/// Resolved input signal.
|
||||
|
||||
Reference in New Issue
Block a user