[sdiy] Wave table interpolation

Tom Wiltshire tom at electricdruid.net
Sun Nov 12 20:15:55 CET 2017



> On 12 Nov 2017, at 18:56, Tim Ressel <timr at circuitabbey.com> wrote:
> 
> Hi,
> 
> Another fun one. I've been looking at the WaveEdit software. It looks like it produces waves that are 256 samples by 16 bits. Obviously you'll want to interpolate between the samples. Linear interpolation works and is cheap but is brute force and causes lots of distortion. I've looked at cubic interpolation. Is that a viable approach? My app needs 4 tables live at a time so I can interpolate (linearly) between them, so this all has to happen on the fly. Cubic looks a bit math intensive.
> 
> Thanks!

Depends on your situation, Tim. What’s the worst limitation you’ve got? Processor cycles? Memory?

Linear interpolation works pretty well if the waves are well oversampled. If you’ve got 128 harmonics in a wave of 256 samples, you’ll hear it. If the highest harmonic is the 32nd, things improve. Can you make the waves longer? Bump them up to 1K or 2K and you’ll wonder why you need to bother with anything beyond linear interp, and at that length, maybe you don’t.

This is relevant if you want some numbers put on it:

"INTERPOLATION ERROR IN WAVEFORM TABLE LOOKUP”, Roger B. Dannenberg

https://pdfs.semanticscholar.org/01bb/73527c8810626ab14a1ca2db478eca9e06f5.pdf

With the graphs in this paper, you can make a more informed choice about what combination of table size, harmonic content, and interpolation method will get you the best quality while staying within the time and memory limitations you might have.

HTH,
Tom  

==================
       Electric Druid
Synth & Stompbox DIY
==================





More information about the Synth-diy mailing list