Struct sonogram::Spectrograph
source ·
[−]pub struct Spectrograph { /* 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(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)?;
Implementations
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.
Save the calculated spectrogram as a PNG image.
Arguments
fname
- The path to the PNG to save to the filesystem.log_freq
- Apply the log function to the frequency scale.
Save the calculated spectrogram as a CSV file.
Arguments
fname
- The path to the CSV to save to the filesystem.log_freq
- Apply the log function to the frequency scale.