Skip to content

Spectrogram

Ccwilliams314 edited this page Apr 4, 2026 · 1 revision

Spectrogram

Module limewire/pages/spectrogram.py
Class SpectrogramPage(ScrollFrame)

Overview

Frequency visualization page that generates linear, mel-scale, and constant-Q (CQT) spectrograms from audio files. Supports multiple colormaps, configurable FFT sizes, hover-to-inspect frequency/time readout, and image export.

Features

  • Spectrogram types: Linear (STFT), Mel, CQT
  • FFT size options: 512, 1024, 2048, 4096
  • Colormaps: viridis, magma, plasma, inferno
  • Interactive canvas with mouse hover showing time and frequency at cursor
  • Rendered via librosa + PIL, displayed on tkinter Canvas
  • Save spectrogram as PNG image
  • Per-page settings: default sample rate, dB floor, dB ceiling

Key Methods

Method Description
_generate() Compute and render spectrogram in a background thread
_on_hover(event) Display time/frequency readout at mouse position
_save_image() Export spectrogram canvas to PNG file
_browse() Open file dialog for audio file selection

Clone this wiki locally