Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Wave Table Read-primitive bug report

For general discussion related FlowStone

Wave Table Read-primitive bug report

Postby martinvicanek » Sun Feb 15, 2015 5:13 pm

Hi devs,

I would like to point out a bug which I came across in the Wave Table Read primitive.

For certain small negatve requencies in the range -1e-5 < f < 0 the output signal will be zero. For other frequencies in the same range, the output will slowly oscillate as it should. (The prim will behave well outside that frequency range, as far as I can tell.)

Now you may argue that for one thing one should use positive frequencies, and besides, for such low frequencies wave tables are not the most efficient approach anyway. However, I happen to have an FM application where the modulated frequency may pass through zero. In that case the bug causes nasty spikes of one or more samples duration in the time domain, resulting in an annoying broadband noise in the frequency domain.

I am attaching a demo schematic. I should say that I am still using FS 3.0.3 (too many bugs in the newer releases :twisted: ). If this particular bug has been fixed meanwhile then please ignore this report.
Attachments
WaveTableRead-primitive_bug.fsm
(119.6 KiB) Downloaded 834 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wave Table Read-primitive bug report

Postby MyCo » Sun Feb 15, 2015 6:53 pm

Looks like there is check for neg. input missing in the wave read code. There are 2 sections in the code that use the freq input directly without checking for negative values. The first one calculates which wave should be used, the result is it uses the same wave ignoring the sign. So the wave for freq = 0.5 is the same as for freq = -0.5.

The second use is for the accumulator which isn't checked for negative values. This causes the internal accumulator to decrement below zero and there is no limit so it goes on and on... That can cause some funny effects, because over time the float value jumps into different rounding schemes causing changes in pitch and eventually complete silence forever.

This needs a fix...
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Wave Table Read-primitive bug report

Postby martinvicanek » Sun Feb 15, 2015 10:21 pm

Thanks for the detailed analysis. An oscillator should be able to handle both positive and negative frequencies (run backwards). Makes it more flexible anyway.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wave Table Read-primitive bug report

Postby martinvicanek » Mon Feb 23, 2015 8:18 am

The Sawtooth and Triangle oscillator primitives also have this bug. The Sine oscillator primitive, however, modulates through zero without any problem.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wave Table Read-primitive bug report

Postby MyCo » Thu Dec 17, 2015 6:19 pm

This should be fixed in the next version. However you shouldn't modulate the frequency down around 0 as this would cause one half cycle to be silence
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Wave Table Read-primitive bug report

Postby martinvicanek » Thu Dec 17, 2015 9:15 pm

MyCo wrote:This should be fixed in the next version.
Great! :D
MyCo wrote:However you shouldn't modulate the frequency down around 0 as this would cause one half cycle to be silence
No, why? There would only be silence if the frequency stays at zero for some time. If it keeps in motion, zero crossings of the frequency are perfectly OK. Negative frequencies should be allowed, resulkting in the oscillator running backwards. Check out the attachment for a demo.
Attachments
FM_through_zero.fsm
(16.77 KiB) Downloaded 819 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm


Return to General

Who is online

Users browsing this forum: No registered users and 48 guests