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
6 posts
• Page 1 of 1
Wave Table Read-primitive bug report
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 ). If this particular bug has been fixed meanwhile then please ignore this report.
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 ). If this particular bug has been fixed meanwhile then please ignore this report.
- Attachments
-
- WaveTableRead-primitive_bug.fsm
- (119.6 KiB) Downloaded 835 times
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Wave Table Read-primitive bug report
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...
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...
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Wave Table Read-primitive bug report
Thanks for the detailed analysis. An oscillator should be able to handle both positive and negative frequencies (run backwards). Makes it more flexible anyway.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Wave Table Read-primitive bug report
The Sawtooth and Triangle oscillator primitives also have this bug. The Sine oscillator primitive, however, modulates through zero without any problem.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Wave Table Read-primitive bug report
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
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Wave Table Read-primitive bug report
Great!MyCo wrote:This should be fixed in the next version.
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.MyCo wrote:However you shouldn't modulate the frequency down around 0 as this would cause one half cycle to be silence
- Attachments
-
- FM_through_zero.fsm
- (16.77 KiB) Downloaded 820 times
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 49 guests