Struct sonogram::SpecCompute

source ·
pub struct SpecCompute { /* private fields */ }
Expand description

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(2048)
    .load_data_from_file(&std::path::Path::new(wav_file))?
    .build();
   
  // Compute the spectrogram.  Need export it using `to_png()` or simlar.
  spectrograph.compute();

Implementations§

Create a new Spectrograph from data.

You probably want to use [SpecOptionsBuilder] instead.

Update the sample data with a new set. Note, none of the settings from the builder are applied, all the samples are used in their raw form.

Do the discrete fourier transform to create the spectrogram.

Arguments
  • n_fft - How many fourier transform frequency bins to use. Must be a power of 2.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.