[−][src]Struct sonogram::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) -> Result<(), Error>
[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.
pub fn save_as_csv(&mut self, fname: &Path, log_mode: bool) -> Result<(), Error>
[src]
Save the calculated spectrogram as a CSV file.
Arguments
fname
- The path to the CSV to save to the filesystem.log_mode
- Apply the log function to the frequency scale.
Auto Trait Implementations
impl Send for Spectrograph
impl Unpin for Spectrograph
impl Sync for Spectrograph
impl UnwindSafe for Spectrograph
impl RefUnwindSafe for Spectrograph
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,