Struct nnnoiseless::DenoiseFeatures
source · pub struct DenoiseFeatures {
pub x: [Complex32; 481],
pub p: [Complex32; 481],
pub ex: [f32; 22],
pub ep: [f32; 22],
pub exp: [f32; 22],
/* private fields */
}
Expand description
Contains the necessary state to compute the features of audio input and synthesize the output.
This is quite a large struct and should probably be kept behind some kind of pointer.
Fields§
§x: [Complex32; 481]
The Fourier transform of the most recent frame of input.
p: [Complex32; 481]
The Fourier transform of a pitch-period-shifted window of input.
ex: [f32; 22]
The band energies of x
(the signal).
ep: [f32; 22]
The band energies of p
(the signal, lagged by one pitch period).
exp: [f32; 22]
The band correlations between x
(the signal) and p
(the pitch-period-lagged signal).
Implementations§
source§impl DenoiseFeatures
impl DenoiseFeatures
sourcepub fn new() -> DenoiseFeatures
pub fn new() -> DenoiseFeatures
Creates a new, empty, DenoiseFeatures
.
sourcepub fn shift_input(&mut self, input: &[f32])
pub fn shift_input(&mut self, input: &[f32])
Shifts our input buffer and adds the new input to it. This is mainly used when generating
training data: when running the noise reduction we use DenoiseFeatures::shift_and_filter_input
instead.
sourcepub fn shift_and_filter_input(&mut self, input: &[f32])
pub fn shift_and_filter_input(&mut self, input: &[f32])
Shifts our input buffer and adds the new input to it, while running the input through a high-pass filter.
sourcepub fn compute_frame_features(&mut self) -> bool
pub fn compute_frame_features(&mut self) -> bool
Computes the features of the current frame.
The return value is true
if the input was pretty much silent.
sourcepub fn pitch_filter(&mut self, gain: &[f32; 22])
pub fn pitch_filter(&mut self, gain: &[f32; 22])
Applies a filter to the audio, attenuating pitches that have poor correlation with the pitch-lagged signal.
Trait Implementations§
source§impl Clone for DenoiseFeatures
impl Clone for DenoiseFeatures
source§fn clone(&self) -> DenoiseFeatures
fn clone(&self) -> DenoiseFeatures
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more