Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Ross Bencina

> sinc(x) := sin(x)/x

On 12/09/2015 2:20 AM, Nigel Redmon wrote:

I’m also aware that some people would look at me like I’m a nut to even bring 
up that distinction.


I considered making the distinction, but it is discussed at the first 
link that I provided:


> https://en.wikipedia.org/wiki/Sinc_function

Mathworld also says: "There are two definitions in common use."

http://mathworld.wolfram.com/SincFunction.html


With hindsight, given the audience and intended use, I should have 
quoted the "DSP and information theory" definition.


R.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nuno Santos
Thanks! :)

> On 11 Sep 2015, at 16:43, Ross Bencina  wrote:
> 
> On 12/09/2015 1:13 AM, Nuno Santos wrote:
>> Curiosity, by sinc do you mean sin function?
> 
> sinc(x) := sin(x)/x
> 
> https://en.wikipedia.org/wiki/Sinc_function
> 
> https://ccrma.stanford.edu/~jos/pasp/Windowed_Sinc_Interpolation.html
> 
> Cheers,
> 
> Ross.
> ___
> 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


Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Alan Wolfe
As far as the artifacts, it sounds like the information you are lacking is
knowledge of bandlimiting and the nyquist frequency (:

Check these out, I think they will help you, especially the second one, but
the first one might have some info for you as well!

http://blog.demofox.org/2012/05/19/diy-synthesizer-chapter-2-common-wave-forms/

http://blog.demofox.org/2012/06/18/diy-synth-3-sampling-mixing-and-band-limited-wave-forms/

Also, are you interpolating between the samples in your table?  Hopefully
you are at least using linear interpolation!

Sinc interpolation is a way of interpolating between samples in a way that
makes the result band limited.

Just for fun, here's another way to interpolate data that is decent and
higher quality than linear, but not as high quality as sinc.

http://blog.demofox.org/2015/08/08/cubic-hermite-interpolation/


On Fri, Sep 11, 2015 at 8:43 AM, Ross Bencina 
wrote:

> On 12/09/2015 1:13 AM, Nuno Santos wrote:
>
>> Curiosity, by sinc do you mean sin function?
>>
>
> sinc(x) := sin(x)/x
>
> https://en.wikipedia.org/wiki/Sinc_function
>
> https://ccrma.stanford.edu/~jos/pasp/Windowed_Sinc_Interpolation.html
>
> Cheers,
>
> Ross.
>
> ___
> 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

Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread robert bristow-johnson



if, by a 1024 window that means you are looking at your original samples 
from x[n-512] up to x[n+512], i would say that it's overkill.


sometimes, when doing interpolation there is an upsampling factor 
implied.  if there is an upsampling factor of, say, 32 in there, and 
you're really only considering samples from x[n-8] to x[n+8], then i 
would say it's not enough.


bestest,

r b-j


On 9/11/15 10:20 AM, Victor Lazzarini wrote:

Excellent, thanks.

Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952


On 11 Sep 2015, at 09:16, Stefan Stenzel  wrote:

No.


On 10 Sep 2015, at 21:15 , Victor Lazzarini  wrote:

Is there much to gain in going above a 1024 window, when doing sinc 
interpolation (for table lookup applications)?

(simple question; no intention of starting flame wars; not asking about any 
other method, either ;) )

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
___
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


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp





--

r b-j  r...@audioimagination.com

"Imagination is more important than knowledge."



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Stefan Stenzel
No.

> On 10 Sep 2015, at 21:15 , Victor Lazzarini  wrote:
> 
> Is there much to gain in going above a 1024 window, when doing sinc 
> interpolation (for table lookup applications)?
> 
> (simple question; no intention of starting flame wars; not asking about any 
> other method, either ;) )
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> ___
> 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


Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nigel Redmon
Great—glad to hear the articles were helpful, Nuno. (Website back up.)

> To build the oscillators tables I’m using that multi table technic you 
> describe on your waveforms series posts where maxHarms is: int maxHarms = 
> 44100.f / (3.0 * BASE_FREQ) + 0.5; Is this an heuristic? 

This equation is specific to my goal of showing the minimum number of 
wavetables for a high-quality oscillator at 44.1 kHz sample rate. That is, one 
wavetable per octave. The oscillator I demonstrated does alias in the audio 
band, but those components are confined to being above one-third of the sample 
rate (in this case 44100.0 / 3.0). I think the rest of the equation is 
obvious—dividing by the base frequency (20 Hz, for instance), because the lower 
the lowest (base) frequency that you want to represent, the more harmonics are 
needed to fill the audio band. And the 0.5 is to round up.

So, back to the SR/3 part: Again, we’re allowing one wavetable per octave. If 
you wanted no aliasing at all, you’d need to limit the highest harmonic to 
22050 Hz (half SR) when that table is shift ed up an octave. But the highest 
harmonic, for such a table, would only be at 11025 when not shifted up an 
octave. That’s not very good. Instead, we say that we’ll allow aliasing, but 
limit it to staying very high in the audio band where we can’t hear it, or at 
least it’s unnoticed. Well, if we allow 1k of aliasing, when shifted up, it 
would alias at 21050, and at the low end it would be 12025. The aliasing would 
be acceptable (not only unhearable, but this is for a synth—higher harmonics 
are typically lower amplitude than lower harmonics, AND we usually run through 
a lowpass filter), but there’s not much improvement for the start of the 
octave’s highest frequency component. Optimal is probably where the highest 
component of the bottom of the octave meets the worst-case aliasing from the 
top—and that is the half-way point of the top octave of the audio band (that 
is, 11025 to 22050 Hz). The half-way point of the top octave is 22050/1.5, or 
44100/3—14700 Hz.

So, the equation just determines how many harmonics should be in the table for 
a given octave—the highest harmonic for a given octave table should be limited 
to 14700 Hz to allow for shifting up an octave.

Of course, you could use more tables and limit the shifting to a fraction of an 
octave, and do better, but good luck hearing the difference ;-) It’s simply a 
good tradeoff.


> On Sep 11, 2015, at 10:18 AM, Nuno Santos  wrote:
> 
> Nigel,
> 
> You wordpress blog was crucial to understand how to implement a band limited 
> oscillator. I confess there were some small details I couldn’t figure out by 
> that time and then moved on. 
> 
> Right now I have a really complete synthesiser engine and I haven’t changed 
> or improved the oscillators section since then.
> 
> Question: How should I calculate the minimum table length size to have no 
> artefacts on a LFO? 
> 
> To build the oscillators tables I’m using that multi table technic you 
> describe on your waveforms series posts where maxHarms is: int maxHarms = 
> 44100.f / (3.0 * BASE_FREQ) + 0.5; Is this an heuristic? 
> 
> For the LFO tables I have only one table and the maxHarms is SAMPLE_RATE/2
> 
> And YES Alan, I’m using a interpolation algorithm but currently only on core 
> Delay unit. No interpolation on the oscillators unit right now. I’m using the 
> cubic hermit and it definitely contributes for a better sound.
> 
> Nuno Santos
> Founder / CEO / CTO
> www.imaginando.pt 
> +351 91 621 69 62
> 
>> On 11 Sep 2015, at 17:39, Nigel Redmon > > wrote:
>> 
>> Hi Nuno,
>> 
>> First, can I suggest that you take a look at my series on wavetable 
>> oscillators? It covers some of the questions you have, and in particular 
>> goes into detail about table length.
>> 
>> Well, this is annoying, I think an automated WordPress update killed my 
>> site, I need to look into it. But normally, go to earlevel.com 
>>  and click the right-column topics for oscillators and 
>> the series will come up. But you can get the gist of it from my video:
>> 
>> https://youtu.be/k81hoZODOP0 
>> 
>> Note that linear interpolation would help your low frequency oscillator 
>> issue, and help your oscillator at high frequencies too. 2048 is a good 
>> minimum table length for 20 Hz and up, so you’re in the right ballpark. 
>> (Longer if you aren’t using interpolation between samples, and longer to get 
>> sharp edges for LFO—for instance, a low frequency sawtooth won’t have a 
>> crisp “tick tick tick”, but a more muffled one, at 1 Hz if your table is 
>> only 2048.)
>> 
>> Nigel
>> 
>> 
>>> On Sep 11, 2015, at 8:13 AM, Nuno Santos >> > wrote:
>>> 
>>> Hi,
>>> 
>>> Curiosity, by sinc do you mean sin function?
>>> 
>>> Before 

Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nigel Redmon
BTW, Ross, I should have made it clear that while I quoted your reply, I was 
commenting for the benefit of Nuno (and others)—hope that didn’t sound like I 
was correcting you. ;-)

> On Sep 11, 2015, at 9:40 AM, Ross Bencina  wrote:
> 
> > sinc(x) := sin(x)/x
> 
> On 12/09/2015 2:20 AM, Nigel Redmon wrote:
>> I’m also aware that some people would look at me like I’m a nut to even 
>> bring up that distinction.
> 
> I considered making the distinction, but it is discussed at the first link 
> that I provided:
> 
> > https://en.wikipedia.org/wiki/Sinc_function
> 
> Mathworld also says: "There are two definitions in common use."
> 
> http://mathworld.wolfram.com/SincFunction.html
> 
> 
> With hindsight, given the audience and intended use, I should have quoted the 
> "DSP and information theory" definition.
> 
> R.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Victor Lazzarini
Excellent, thanks.

Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 11 Sep 2015, at 09:16, Stefan Stenzel  
> wrote:
> 
> No.
> 
>> On 10 Sep 2015, at 21:15 , Victor Lazzarini  wrote:
>> 
>> Is there much to gain in going above a 1024 window, when doing sinc 
>> interpolation (for table lookup applications)?
>> 
>> (simple question; no intention of starting flame wars; not asking about any 
>> other method, either ;) )
>> 
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>> ___
>> 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


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Ross Bencina

On 12/09/2015 1:13 AM, Nuno Santos wrote:

Curiosity, by sinc do you mean sin function?


sinc(x) := sin(x)/x

https://en.wikipedia.org/wiki/Sinc_function

https://ccrma.stanford.edu/~jos/pasp/Windowed_Sinc_Interpolation.html

Cheers,

Ross.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nuno Santos
Nigel,

You wordpress blog was crucial to understand how to implement a band limited 
oscillator. I confess there were some small details I couldn’t figure out by 
that time and then moved on. 

Right now I have a really complete synthesiser engine and I haven’t changed or 
improved the oscillators section since then.

Question: How should I calculate the minimum table length size to have no 
artefacts on a LFO? 

To build the oscillators tables I’m using that multi table technic you describe 
on your waveforms series posts where maxHarms is: int maxHarms = 44100.f / (3.0 
* BASE_FREQ) + 0.5; Is this an heuristic? 

For the LFO tables I have only one table and the maxHarms is SAMPLE_RATE/2

And YES Alan, I’m using a interpolation algorithm but currently only on core 
Delay unit. No interpolation on the oscillators unit right now. I’m using the 
cubic hermit and it definitely contributes for a better sound.

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 11 Sep 2015, at 17:39, Nigel Redmon  wrote:
> 
> Hi Nuno,
> 
> First, can I suggest that you take a look at my series on wavetable 
> oscillators? It covers some of the questions you have, and in particular goes 
> into detail about table length.
> 
> Well, this is annoying, I think an automated WordPress update killed my site, 
> I need to look into it. But normally, go to earlevel.com 
>  and click the right-column topics for oscillators and 
> the series will come up. But you can get the gist of it from my video:
> 
> https://youtu.be/k81hoZODOP0
> 
> Note that linear interpolation would help your low frequency oscillator 
> issue, and help your oscillator at high frequencies too. 2048 is a good 
> minimum table length for 20 Hz and up, so you’re in the right ballpark. 
> (Longer if you aren’t using interpolation between samples, and longer to get 
> sharp edges for LFO—for instance, a low frequency sawtooth won’t have a crisp 
> “tick tick tick”, but a more muffled one, at 1 Hz if your table is only 2048.)
> 
> Nigel
> 
> 
>> On Sep 11, 2015, at 8:13 AM, Nuno Santos > > wrote:
>> 
>> Hi,
>> 
>> Curiosity, by sinc do you mean sin function?
>> 
>> Before anything: I’m a newbie. If I say something stupid don’t throw fire at 
>> me, please! :)
>> 
>> During this last year I have been developing a synthesizer. My lookup table 
>> hadn’t more than 2048 samples. The sounds coming out from the oscillators 
>> was alright.
>> 
>> When I got to develop a chorus, I was using the very same table for the lfo 
>> oscillators. The modulation was causing artifacts. It took me a while to 
>> understand that the problem was being caused by the lack of resolution of my 
>> tables. I ended up with a table 441000 length, for a 44100 sample rate. The 
>> artifacts were gone! My conclusion was that the raw steps were causing 
>> audible artifacts and increasing the resolution was the solution.
>> 
>> I haven’t tried to find the lowest point of resolution that doesn’t cause 
>> artifacts. I was so tired of trying to solve the artifacts that I have only 
>> remember this problem when I saw this question from Victor.
>> 
>> For the oscillators table I have simply doubled the initial value and now 
>> i’m using 4096.
>> 
>> What do you guys think of this? 
>> 
>> Thanks,
>> 
>> Regards,
>> 
>> Nuno
>> 
>>> On 10/09/2015, at 20:15, Victor Lazzarini >> > wrote:
>>> 
>>> Is there much to gain in going above a 1024 window, when doing sinc 
>>> interpolation (for table lookup applications)?
>>> 
>>> (simple question; no intention of starting flame wars; not asking about any 
>>> other method, either ;) )
>>> 
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>> ___
>>> 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
> 
> ___
> 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