|Subject:||[fluid-dev] question on linear interpolation|
|Date:||Wed, 30 Dec 2015 18:42:15 -0800|
|User-agent:||Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0|
I'm developing an embedded project using some of the code in FluidSynth.
The target is an ARM Cortex M4 and am using integer math. Most of the coefficients are in Q15 format.
So far, I'm able to generate different notes with sound font files and use some of the CMSIS DSP libraries to generate high order IIR filters.
But I am having no luck with any interpolation routines. I ran some tests using the command line version of FluidSynth on a laptop running Ubuntu 14.
I created a sine wave sound font (using Swami) with a sample rate of 20050 Hz, root note is 86. It's looping over several cycles. The image Midi_60_no_interpolation.jpg picture shows the result with no interpolation (I get the exact same results on my embedded platform). This is using "interp 0". (Note that the ringing is due to the sinc function in the Codec filter/decimator.)
If I then set "interp 1", I get the image as shown in Midi_60_linear_interpolation.jpg which is a major improvement.
I have reviewed the code inside fluid_voice_dsp.c and have set up my program to emulate the equations. I converted the floating point coefficients to Q15 format. It seems to do exactly what it's supposed to do. Yet I see no improvement what-so-ever except at higher note values.
However...I don't see how linear interpolation can work. If you have straight lines (i.e. the "steps" in the first waveform), a linear interpolation won't change anything since the current sample and the next sample are the same over several samples.
Are you up-sampling before you to do the linear interpolation? I didn't see any evidence in the code. Or do you simply take the loop sample as is and step through it using dsp_phase_index? I don't think the bi-quad post filter has an effect since it has a very high cut-off. Nor should the reverb or chorus blocks have any effect (since they're disabled anyway in my test).
What am I missing?
Thanks for your time and consideration. Any advice or insight is appreciated. I really like FluidSynth.
P.S. I also implemented the 4th order interpolation but it didn't change anything--I still get the "stepped" waveform. (At 50MHz clock, the M4 can process 128 samples in <1uS with sound fonts stored in internal Flash memory. Pretty impressive.)
Description: JPEG image
Description: JPEG image
|[Prev in Thread]||Current Thread||[Next in Thread]|