pub struct STFT<T>{
pub window_size: usize,
pub fft_size: usize,
pub step_size: usize,
pub fft: Arc<dyn Fft<T>>,
pub window: Option<Vec<T>>,
pub sample_ring: SliceRingImpl<T>,
pub real_input: Vec<T>,
pub complex_input_output: Vec<Complex<T>>,
/* private fields */
}Fields§
§window_size: usize§fft_size: usize§step_size: usize§fft: Arc<dyn Fft<T>>§window: Option<Vec<T>>§sample_ring: SliceRingImpl<T>internal ringbuffer used to store samples
real_input: Vec<T>§complex_input_output: Vec<Complex<T>>Implementations§
Source§impl<T> STFT<T>
impl<T> STFT<T>
pub fn window_type_to_window_vec( window_type: WindowType, window_size: usize, ) -> Option<Vec<T>>
pub fn new( window_type: WindowType, window_size: usize, step_size: usize, ) -> Self
pub fn new_with_zero_padding( window_type: WindowType, window_size: usize, fft_size: usize, step_size: usize, ) -> Self
pub fn new_with_window_vec_and_zero_padding( window: Option<Vec<T>>, window_size: usize, fft_size: usize, step_size: usize, ) -> Self
pub fn new_with_window_vec( window: Option<Vec<T>>, window_size: usize, step_size: usize, ) -> Self
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
pub fn compute_into_complex_output(&mut self)
Sourcepub fn compute_complex_column(&mut self, output: &mut [Complex<T>])
pub fn compute_complex_column(&mut self, output: &mut [Complex<T>])
§Panics
panics unless self.output_size() == output.len()
Sourcepub fn compute_magnitude_column(&mut self, output: &mut [T])
pub fn compute_magnitude_column(&mut self, output: &mut [T])
§Panics
panics unless self.output_size() == output.len()
Sourcepub fn compute_column(&mut self, output: &mut [T])
pub fn compute_column(&mut self, output: &mut [T])
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.
Sourcepub fn first_time(&self, fs: f64) -> f64
pub fn first_time(&self, fs: f64) -> f64
corresponding time of first columns of the spectrogram
Sourcepub fn time_interval(&self, fs: f64) -> f64
pub fn time_interval(&self, fs: f64) -> f64
time interval between two adjacent columns of the spectrogram
Auto Trait Implementations§
impl<T> Freeze for STFT<T>
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§
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