[−][src]Struct sonogram::spectrograph::Spectrograph
This contains all the initialised data. This can then produce the spectrogram, and if necessary, save it to the filesystem as a PNG image.
This Spectrograph
is created by SpecOptionsBuilder
.
Example
let mut spectrograph = SpecOptionsBuilder::new(512, 128) .load_data_from_file(&std::path::Path::new(wav_file)) .build();
spectrograph.compute(2048, 0.8); spectrograph.save_as_png(&std::path::Path::new(png_file), false);
Methods
impl Spectrograph
[src]
pub fn omega(&self, p: f32, q: f32) -> Complex<f32>
[src]
pub fn compute(&mut self, chunk_len: usize, overlap: f32)
[src]
Do the discrete fourier transform to create the spectrogram.
Arguments
chunk_len
- How long fourier transform window should be.overlap
- By how much (of a chunk) the fourier transform windows overlap. It must be value between 0.0 and 1.0.
pub fn save_as_png(&mut self, fname: &Path, log_mode: bool)
[src]
Save the calculated spectrogram as a PNG image.
Arguments
fname
- The path to the PNG to save to the filesystem.log_mode
- Apply the log function to the frequency scale.
Auto Trait Implementations
impl Send for Spectrograph
impl Sync for Spectrograph
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,