Thread: [Audacity-devel] Patch: Spectrum analysis Y-axis limit tweak
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Stephan G. <sgr...@ya...> - 2012-04-10 15:37:56
Attachments:
FreqWindow.cpp.patch
|
Hello folks, it's been a while since I last posted here. Not only do I not need to use Windows 2000 any more since I got a brand spanking 4-year-old computer with Vista, I also finally figured out how to tackle the Y-axis lower limit in the spectrum analyzer window that had been annoying me for, like, ages. A patch is attached - it's essentially a 3-liner. I originally had a more complex version that took current FFT window size into account, but considered this to be too non-obvious and thus potentially confusing to the user. This patch uses the FFT gain expected for the maximum window size of 16384. (It would be nice if it could fetch maximum window size automatically in case that one changes in the future, but this seems non-trivial.) Minimum Y-axis limits now are: 36 dB: -90 dB (same as b4) 48 dB: -90 dB (same as b4) 60 dB: -102 dB (ex -60 dB) ... 145 dB: -187 dB (ex -145 dB) These are a lot less likely to bother anyone while keeping the spirit of the original code. Displayed values also stay a minimum of 0.5 dB above the X-axis now, which improves visibility at low window sizes. And no, don't ask me why int dBRange is treated like a float with the expected automatic extra type casts. I figured whoever decided to do it like that probably had a good reason. (I'm an analog/RF guy and not exactly a programming natural, you see.) Setting up the build environment was fairly smooth sailing this time, except I couldn't for my life get the Windows SDK v7.1 installed. This one doesn't include any compilers for VS2008 either. So I got the v7 Windows SDK and June 2010 DirectX SDK, which took a while to download but installed fine. No idea how others' experience with this has been, but it might be something to mention in the build notes. Stephan |