From 91325880465b4d37fcf5222b737ce6953c7c3341 Mon Sep 17 00:00:00 2001 From: Sami Perttu Date: Thu, 14 Nov 2024 15:52:18 +0200 Subject: [PATCH] Add forwarding method. --- src/resynth.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/resynth.rs b/src/resynth.rs index 58990f7..bc2526f 100644 --- a/src/resynth.rs +++ b/src/resynth.rs @@ -147,6 +147,13 @@ impl FftWindow { self.output[channel][i] = value; } + /// Forward `input` channel to `output` channel unchanged. + pub fn forward(&mut self, input: usize, output: usize) { + for i in 0..self.bins() { + self.set(output, i, self.at(input, i)); + } + } + /// Create new window. pub fn new(length: usize, index: usize, inputs: usize, outputs: usize) -> Self { Self { @@ -219,7 +226,7 @@ impl FftWindow { /// Frequency domain resynthesizer. Processes windows of input samples with an overlap of four. /// Each window is Fourier transformed and then processed into output spectra -/// by the user supplied processing function. +/// by the user supplied processing function. The window output starts from an all zeros state. /// The output windows are finally inverse transformed into the outputs. /// The latency is equal to the window length. /// If any output is a copy of an input, then the input will be reconstructed exactly once