#37

Add frequency-domain analysis (FFT + magnitude/phase) to the existing visualize tool

Openpedrolucas167opened 9mo ago

Right now we can export time-domain samples and visualize them, which is great for debugging signal flow, but it’s almost impossible to reason about what the filters are actually doing in the frequency domain.

Since the whole project is based on IIR/biquad filters, it would be extremely useful to have:

  • FFT-based magnitude response
  • phase response
  • and ideally the impulse response
  • This would allow verifying:
  • cutoff frequencies
  • Q / resonance
  • stability

and whether the digital version actually behaves like the intended analog effect

A simple numpy FFT over the existing exported sample buffers would already give a lot of insight, without changing the real-time audio path.

Activity

2
phstrauss9mo ago

I'm working on a realtime STFT analyzer but it needs debugging, see this link.

qasim786789mo ago

This is a really good suggestion. Time-domain plots are helpful, but for a project built around filters, frequency-domain views are honestly just as important.

Adding FFT-based magnitude and phase response to the existing visualizer makes a lot of sense, especially if it can work directly on the exported buffers. That keeps it simple and avoids touching the real-time path while still giving us what we need to check cutoff, Q, and overall behavior.

Impulse response support would also be very useful. Once you have that, magnitude and phase essentially fall out of it.

Regarding the realtime STFT work mentioned above, that sounds promising too, but I’d be inclined to start with an offline / non-realtime FFT mode in the current visualizer first. It’s easier to validate, easier to review, and already solves most of the debugging and verification needs. Realtime analysis could come later as a separate step once the foundations are solid.

If you’re interested in prototyping this, a first pass that adds: • impulse response generation • FFT magnitude plot • optional phase plot

to the current visualize tool would be a great starting point.