Have you ensured (a) that you are avoiding "denormal" floating-point numbers in the filter (see http://stackoverflow.com/questions/2487653/avoiding-denormal-values-in-c) and (b) the compiler is applying all possible optimizations such as SIMD, inlining, etc.?
Often in DSP code, a very small but nornal white noise is added to the signal before filtering. Hope this helps, Mike ----------------------------------------------------- Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Fri, Mar 10, 2017 at 11:56 AM, ChordWizard Software <corpor...@chordwizard.com> wrote: > Greetings, > > I'm in the process of building an experimental wavetable synth, and I have > come across something I can't understand. I'm hoping someone can shed some > light. > > I am using C++ and the audio buffer is in floats. It's an x86 architecture > if that makes a difference. > > At present the synth is primarily a render loop with 4th order interpolation > from the original waveform followed by a LPF IIR filter. The per-sample > workload in float arithmetic consists primarily of: > > - rendering: 5 multiplications, 3 additions, plus phase management > - filtering: 4 multiplications, 2 additions, 2 subtractions > > which on the face of it, look pretty similar, perhaps slightly heavier for > rendering. > > But when I profile the performance of this loop, it appears the IIR filter > takes up by far the majority of the time, around 8 to 10 times as long as the > rendering process. > > I've used two profiling tools, plus a custom internal profiling mechanism and > all methods reports similar ratios. I've confirmed that bypassing the filter > greatly does radically reduce the processing load. > > How can I make sense of this? > > Regards, > > Stephen Clarke > Managing Director > ChordWizard Software Pty Ltd > corpor...@chordwizard.com > http://www.chordwizard.com > ph: (+61) 2 4960 9520 > > > _______________________________________________ > dupswapdrop: music-dsp mailing list > music-dsp@music.columbia.edu > https://lists.columbia.edu/mailman/listinfo/music-dsp > _______________________________________________ dupswapdrop: music-dsp mailing list music-dsp@music.columbia.edu https://lists.columbia.edu/mailman/listinfo/music-dsp