Mx.Spectrogram (mx v0.1.0)

Copy Markdown View Source

Draws a spectrogram of a recording into a PNG image: seconds across, at 100 pixels a second unless per_second: gives another count, and frequency up the side on a scale of octaves.

The side spans the ten octaves from 20 Hz to 20,480 Hz, 48 pixels each, with a faint line at every octave from 20 Hz and every second. Brightness follows the level in dB, from 100 dB below the recording's loudest point up to it. Each column is the spectrum of 4096 samples, or of the seconds window: gives when that is fewer: a long window tells harmonics apart and a short one, such as 0.004, shows how the level moves within a note.

Summary

Functions

Writes the spectrograms of several sounds, each as {samples, rate}, to one PNG file, one above another from the first, so they can be compared moment by moment.

Writes a spectrogram of the samples to a PNG file.

Functions

stack(sounds, path, opts \\ [])

Writes the spectrograms of several sounds, each as {samples, rate}, to one PNG file, one above another from the first, so they can be compared moment by moment.

write(samples, rate, path, opts \\ [])

Writes a spectrogram of the samples to a PNG file.