Page 1 of 2

Wavetable Osc fail

Posted: Sun Dec 28, 2014 5:35 pm
by MyCo
Hi,

I'm getting a weird problem when using the wavetable oscillator and playing back a saw wave (any wave with many harmonics, would do it too). When I play it very low, so that I get all of the frequencies in the wavetable into the audio band, I get this:
spec.jpg
spec.jpg (64.82 KiB) Viewed 34823 times


The wavetable I'm using is 2048 samples long, and the osc is playing at 8.1758 Hz. The weird peak you see there is exactly at the nyquist frequency of the wavetable wave (ignore the cursor tooltip in the image):

(2048 / 2) * 8.1758Hz = 8372.0192Hz

Any idea, why this happens? And how do I get rid of that. When you compare it with other synths you can clearly hear a difference...

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 7:35 pm
by martinvicanek
Hard to tell without the schematic. ;) I assume you are using a custom wavetable as the FS WTs are shorter? How is it organized? How do you interpolate? If you don't want to disclose your algo, perhaps you could PM?

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 8:13 pm
by MyCo
There is nothing special to it. It's just a normal create wavetable / read wavetable schematic.

Haven't found any FFT inside FlowStone that can meassure the problem. But it's there and with FFT Plugins you can see it pretty well. I use for example MAnalyzer: http://www.meldaproduction.com/plugins/ ... =MAnalyzer

I found a workaround but I'm not sure why this fixes the problem (And it's not a good solution): I remove the top frequencies of the orignal wavetable input array (2048 samples FFT -> zero 200 samples in the middle to remove high frequencies (with a smooth slope) -> iFFT -> wave table)

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 8:21 pm
by MyCo
Here is the workaround, that I described above. It looks like that:
workaround.jpg
workaround.jpg (61.36 KiB) Viewed 34813 times

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 8:34 pm
by RJHollins
I don't know the answer nor solution ... but a speculation ...

Is there some aliasing folding back into the audible range ??

I'm sure you are knowledgeable about all this ... but this is maybe a possibility :roll:

i don't know.

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 9:06 pm
by KG_is_back
I see it too, with meters in FS. The wavetable osc in FS works in a way, that it creates a list of wavetables. Each wavetable has one less higher harmonic then previous one, second to last has only the base frequency and the last one is silence (used when you input frequency above Nyquist into the oscillator). The osc simply picks the wavetable which will not cause aliasing but still contains the most frequencies.
Only aliasing can be caused by linear interpolation in the osc module, but why it would specifically lie at nyquist frequency is a mystery to me. However, it is not hard to imagine, that lower the frequency the more pronounced will the distortions of linear interpolation will be...


EDIT: it is the linear interpolation causing havoc. When it interpolates it creates harmonics that are multiples of Nyquist. I have found another harmonic exactly at 2*nyqist of the wavetable and 3*N as well.

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 9:07 pm
by tester
Can this be related to interpolation? If you have 2048 samples long cycle, it means that 1:1 at 44.1kHz is played at 21.5Hz (f=44100/2048) if I understand this correctly. Which means that at lower frequencies - content may be (may be?) added or changed, depending on interpolation method and rescaled shape.

//edit: we wrote at the same time. :mrgreen:

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 9:13 pm
by tester
In other words - waveread with different interpolation within it - could solve it? (+ phase and resync nodes somewhere).

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 9:15 pm
by MyCo
It's not related to interpolation, I've decoded the wavetable primitive's code and changed interpolation to B-Spline, Hermite, Lagrange... doesn't matter. It affects only the smaller distortions around that peak but not the peak itself. I'll make a cleaner schematic of my tests.

Re: Wavetable Osc fail

Posted: Sun Dec 28, 2014 9:21 pm
by MyCo
Ok, here my tests with different interpolations. The problem is the same. The first spectrum image that I posted was infact from the b-spline interpolation, as this cleans out the surrounding interpolation noise.

This is how it looks like with standard linear interpolation
linear.jpg
linear.jpg (58.66 KiB) Viewed 34800 times