Struct librustosa::stft::STFT
source · [−]pub struct STFT<T> where
T: FftNum + FromF64 + Float, {
pub window_size: usize,
pub step_size: usize,
pub fft: Arc<dyn Fft<T>>,
pub window: Vec<T>,
pub sample_ring: SliceRingImpl<T>,
pub real_input: Vec<T>,
pub complex_input: Vec<Complex<T>>,
pub complex_output: Vec<Complex<T>>,
}
Fields
window_size: usize
step_size: usize
fft: Arc<dyn Fft<T>>
window: Vec<T>
sample_ring: SliceRingImpl<T>
real_input: Vec<T>
complex_input: Vec<Complex<T>>
complex_output: Vec<Complex<T>>
Implementations
sourceimpl<T> STFT<T> where
T: FftNum + FromF64 + Float,
impl<T> STFT<T> where
T: FftNum + FromF64 + Float,
pub fn new(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn hann(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn hamming(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn blackman(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn nuttall(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn rectangular(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn boxcar(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn no_window(window_size: usize, step_size: usize) -> Result<Self, String>
pub fn output_size(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn append_samples(&mut self, input: &[T])
pub fn contains_enough_to_compute(&self) -> bool
sourcepub fn compute_column(&mut self) -> Result<Vec<T>, String>
pub fn compute_column(&mut self) -> Result<Vec<T>, String>
Computes a column of the spectrogram
pub fn compute_complex_column(&mut self) -> Result<Vec<Complex<T>>, String>
pub fn compute_magnitude_column(&mut self) -> Result<Vec<T>, String>
sourcepub fn move_to_next_column(&mut self)
pub fn move_to_next_column(&mut self)
Make a step
Drops self.step_size
samples from the internal buffer self.sample_ring
.
Auto Trait Implementations
impl<T> !RefUnwindSafe for STFT<T>
impl<T> Send for STFT<T>
impl<T> Sync for STFT<T>
impl<T> Unpin for STFT<T> where
T: Unpin,
impl<T> !UnwindSafe for STFT<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more