Commit 6870ad3
fix: flip spectrogram frequency axis to match freq_bins ordering (#53)
The server data has row 0 = highest frequency, but freq_bins property
calculates assuming row 0 = lowest frequency. This caused frequency
cropping to select the wrong portion of the spectrum (e.g., requesting
200-400 Hz would actually return high frequencies like 2000-2400 Hz).
Now flip the data immediately after loading in from_audio_id() so:
- Row 0 = lowest frequency (matching freq_bins[0])
- Row -1 = highest frequency (matching freq_bins[-1])
This fixes frequency alignment between spectrograms and pitch contours
in visualization contexts.
Note: Visualizations using this API should remove any flipud() calls
they were using to work around this issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2588367 commit 6870ad3
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
0 commit comments