Re: 200+ sine oscillators on iOS
Re: 200+ sine oscillators on iOS
- Subject: Re: 200+ sine oscillators on iOS
- From: Brian Willoughby <email@hidden>
- Date: Mon, 28 May 2018 20:28:01 -0700
> On May 27, 2018, at 1:08 PM, Paul Davis <email@hidden> wrote:
>> On Sun, May 27, 2018 at 3:53 PM, Albin Stigö <email@hidden> wrote:
>>> An oscillator based on a lookup table would work well. You only need one
>>> table per wave type and then maintain separate pointers into the table for
>>> each oscillator.
>
> on most modern architectures, it is less costly to do the math to generate a
> sine than it is to do memory-based lookup. wavetables for sine waves are a
> mid-90s idea.
Paul is right. Lookup tables add distortion, unless you have a table for every
possible frequency and you don’t allow pitch bends. The various methods for
changing the pitch of a lookup table waveform all add distortion of one kind or
another.
In contrast, a state variable filter with unity feedback can create a perfect
sine wave that it ideal for the given sample rate and pitch, including
frequencies with periods that are fractional sample lengths.
I benchmarked the SVF implementation with a 64-bit FFT and found the distortion
to be very, very low - and quite comparable to the sin() function that has more
overhead.
Brian Willoughby
p.s. I’m curious what Apple is using for their sin() function and where to
expect the distortion to appear. The reason I’m curious is that I would like to
make sure that my benchmark is showing any distortion that might be there.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden