pub struct FastLearnedFftModel {
pub n_fft: usize,
pub n_mels: usize,
pub sample_rate: f32,
pub twiddles: Vec<f32>,
pub gates: Vec<f32>,
pub freq_mask: Vec<f32>,
pub denoiser: SpectrumDenoiser,
pub use_q8: bool,
pub hard_gate_threshold: Option<f32>,
/* private fields */
}Expand description
End-to-end learned spectral model for fast inference paths.
Fields§
§n_fft: usize§n_mels: usize§sample_rate: f32§twiddles: Vec<f32>§gates: Vec<f32>§freq_mask: Vec<f32>Per complex-bin mask (learnable), init 1.
denoiser: SpectrumDenoiser§use_q8: bool§hard_gate_threshold: Option<f32>When set, inference uses hard gates (0/1) at this threshold.
Implementations§
Source§impl FastLearnedFftModel
impl FastLearnedFftModel
pub fn new(cfg: &FftLearnConfig, n_mels: usize, sample_rate: f32) -> Self
pub fn with_hard_gates(self, threshold: f32) -> Self
pub fn mel_filters(&self) -> &[f32]
pub fn with_q8(self) -> Self
pub fn sync_q8(&mut self)
pub fn twiddles_for_forward(&self) -> Vec<f32>
pub fn spectrum_batch_raw( &self, signal: &[f32], batch: usize, ) -> Result<Vec<f32>>
pub fn spectrum_batch(&self, signal: &[f32], batch: usize) -> Result<Vec<f32>>
pub fn log_mel_batch(&self, signal: &[f32], batch: usize) -> Result<Vec<f32>>
pub fn welch_psd_batch( &self, signal: &[f32], batch: usize, params: WelchParams, ) -> Result<Vec<f32>>
Sourcepub fn welch_peaks_batch(
&self,
signal: &[f32],
batch: usize,
params: WelchPeakParams,
) -> Result<Vec<f32>>
pub fn welch_peaks_batch( &self, signal: &[f32], batch: usize, params: WelchPeakParams, ) -> Result<Vec<f32>>
Fast Welch path (few segments) → top-K (bin, power) spikes only.
pub fn mean_gate(&self) -> f32
pub fn active_gates(&self, threshold: f32) -> usize
Trait Implementations§
Source§impl Clone for FastLearnedFftModel
impl Clone for FastLearnedFftModel
Source§fn clone(&self) -> FastLearnedFftModel
fn clone(&self) -> FastLearnedFftModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FastLearnedFftModel
impl RefUnwindSafe for FastLearnedFftModel
impl Send for FastLearnedFftModel
impl Sync for FastLearnedFftModel
impl Unpin for FastLearnedFftModel
impl UnsafeUnpin for FastLearnedFftModel
impl UnwindSafe for FastLearnedFftModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more