Wavetable Osc fail

DSP related issues, mathematics, processing and techniques
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Wavetable Osc fail

Post 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 34820 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...
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wavetable Osc fail

Post 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?
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Wavetable Osc fail

Post 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)
Attachments
Just a wavetable.fsm
(18.56 KiB) Downloaded 1427 times
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Wavetable Osc fail

Post by MyCo »

Here is the workaround, that I described above. It looks like that:
workaround.jpg
workaround.jpg (61.36 KiB) Viewed 34810 times
Attachments
Just a wavetable (Workaround).fsm
(45.29 KiB) Downloaded 1392 times
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Wavetable Osc fail

Post 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.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Wavetable Osc fail

Post 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.
Last edited by KG_is_back on Sun Dec 28, 2014 9:09 pm, edited 1 time in total.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Wavetable Osc fail

Post 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:
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Wavetable Osc fail

Post by tester »

In other words - waveread with different interpolation within it - could solve it? (+ phase and resync nodes somewhere).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Wavetable Osc fail

Post 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.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Wavetable Osc fail

Post 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 34797 times
Attachments
Just a wavetable (different interpolations).fsm
(24.03 KiB) Downloaded 1396 times
Last edited by MyCo on Sun Dec 28, 2014 9:26 pm, edited 1 time in total.
Post Reply