This is obvious, as step size is 8 point FFT and only 128 for 254 point FFT Using as computational metric: 2*FFT_LENGTH*log2(FFT_LENGTH) for each FFT-IFFT comboĬlearly, the 1024 point FFT is more efficient than the 256 point FFT Let me assume that I have 3000*896 samples to filter with a 129 coefficient LPĬonsidering only FFT and IFFT with a overlap-discard approachģ000 x 1024-point FFT-IFFT combo (stepsize 896)ħ000 x 512-point FFT-IFFT combo (stepsize 384)Ģ1000 x 256-point FFT-IFFT combo (stepsize 128) Even now, I have to add 512 "old" samples in with the 512 "new" ones, do the math using 1024 pt FFTs, in order to allow the discrete FFTs to work with continuous time signals. This would take 4X the processing power however, straining the Teensy. Actually, as I was writing this, I thought I could probably decrease my latency by using only 128 "new" audio samples (plus 384 earlier ones), doing the 513 pt convolution, and then only sending out only the last 128 samples of the convoluted result. I have to play by the rules of the Teensy Audio library, but the PC/MAC VSTs could be faster as they have 10X more processing power and don't have to work within the Teensy Audio framework. I measured 19.5 ms- must have been a bit of inaccuracy in my measurement there. There is a 1 block overlap in this, so 7 X 2.9 ms =20.3 ms. Then I have to send out the 512 audio samples, in 4 blocks, again ms per block. Then I do the convolution math, which is pretty fast. Smith for this excellent Yes, the process involves bringing in 512 audio samples (4 blocks) 2.9 ms per block or 11.6 ms. The Scientist and Engineer's Guide to Digital Signal Processingįound at You can buy the book, or read the various chapters in PDF, for free, at that website. If, like me, you are not a math wizard, this is the best treatment of the subject I have come across. I used the following source extensively in understanding what the underlying theory of FFT/convolution was all about. I haven't included my sketch-based (in-line code) version of the routine in the repository, but could add it if people were interested in developing guitar amplifier cabinet simulation for the Teensy, without actually adding this new object to the Teensy Audio library. I developed my audio library code by first modifiying DD4WH's "inline" SDR sketch code to perform only the FFT/convolution that I needed. Therefore, there definitely are limits on how many additional audio blocks you could use for your application. While the FFT-based convolution routine is very efficient, it does require 64% of the processor's execution capacity for 1 out of every 4 audio update cycles (the FFT/convolution processing must be done in 512 sample blocks, while the audio library works in blocks of 128 samples). h files needed for this library object, as well as 2 examples:Ģ) a guitar amplifier cabinet simulation example (uses the Teensy 3.6's on-board SD socket to host an SD card containing the cabinet simulation WAV file(s). A link to these instructions are contained in the repository I've created on Github for this FFT/convolution routine, at These modifications are identical to those needed for the DD4WH SDR project also found in this forum. However, this means that some modifications must be made to the Teensyduino distribution- to add the floating point CMSIS DSP routines needed for this object. The convolution routine is done in floating point, which eliminates the limitations imposed by the fixed-point (Q15) routines generally used in the Teensy audio library. In this case the "impulse" file (a WAV file) is used in place of the 513 point FIR filter coefficient array. Note that a conventional FIR filter object already exists in the Teensy Audio library, but it is limited to 200 taps, and is done using fixed-point math.īesides standard 513-tap FIR filtering applications, this routine can be used to do guitar amplifier cabinet simulation, such as is found in commercial DAW plug-ins, for example. I based my code on the excellent work done by Frank, DD4WH on his convolution SDR (posted on this forum). In other words, the convolution/filtering can be done in real time at the 44,100 Hz sample rate used in the Audio library. It is basically a 513-tap convolution filter performed by converting the signal & filter mask into the frequency domain where the convolution function can be performed much more quickly. I've written a floating point FFT-based convolution filter object for the Teensy Audio library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |