Thanks for the tip! Will check that one out.karrikuh wrote:A few weeks ago, I got curious myself about how to accurately estimate the frequency response of some filter algo. Meditating on the fundamental properties of the DFT, I realized that a DFT of size N with rectangular window yields the exact filter magnitude response if you feed a pulse train with period N into the filter input.
So I launched REAPER to write a little pulse train generator JS plugin and test if this works out. Now to my big surprise, when browsing the JS plugin folder I discovered somebody else already had put thought into all this and everything I needed was already there! The pulse train generator is, slightly misleadingly, called "Analysis/fft_noise_generator" and lets you adjust FFT size and amplitude. For DFT spectrum analysis, I used "Analysis/gfxanalyzer" with window parameter set to "rectangular", FFT size set the same as in "fft_noise_generator". Result is, as expected, perfect!
As a final note, this method will not work correctly for phase response as the misalignment of the pulses to the DFT analysis block (ideally, a pulse should occur at the first sample of the block) results in an additional linear phase term in the displayed response.
Testing filters
-
AdmiralQuality AdmiralQuality https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=83902
- Banned
- 6657 posts since 10 Oct, 2005 from Toronto, Canada
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
The DFT bin-matched method works for regular-slope periodic sounds too, so you don't need to use impulses (you can integrate to saw-waves instead, then scale the DFT output by inverse of the predictable slope). This can be advantageous if you're trying to measure something that doesn't behave nicely with impulses (eg "almost linear" filters can sometimes clip impulses in ways that make the result totally useless, yet still give meaningful values with a less degenerate test signal). It also makes the result less ear-piercing if you want to listen to the device-under-test at the same time. 
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4379 posts since 8 Mar, 2004 from Berlin, Germany
i occasionally use this:AdmiralQuality wrote:I'd find a softsynth source or test tone generator plug-in. (Does anybody know of any? I've been thinking of writing one for my own purposes but if there's a good one out there I'd happily use that instead.)
http://www.kvraudio.com/product/testtone_by_mda

