Ch. 9 - Stability problems with the Direct Oscillator | FX Book Questions | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Ch. 9 - Stability problems with the Direct Oscillator
New Member
January 11, 2016 - 10:14 pm
Member Since: August 29, 2014
Forum Posts: 2
sp_UserOfflineSmall Offline


I have noticed that the improved version of the Direct-Form Oscillator (§ 9.2.5 in the FX book) can easily get locked into a non-oscillating state (constant DC output of 1s) after trying changing the oscillating frequency a few times (especially when one tries moving the slider up and down quickly). This is because of the arcsine function giving a NaN result ("-1.#IND000") for values m_f_z1 > 1.0 in cookFrequency(), resulting into NaN values in the output (I assume that the NaN values are then converted into 1s by RackAFX).

Although I have not done any rigorous experimentation, it appears that if I turn on the oscillator and keep the frequency as is, the absolute maximum signal values seem to be sliding slowly above 1.0 after a while.

This is also the case for the original Direct Oscillator design, although in this case it never gets locked into a DC output because both m_f_z1 and m_f_z2 are explicitly updated with new sine values based on f_wT.

My question is: is it expected that the absolute maximum output values > 1.0 for this design? As far as I can tell, the design does not theoretically allow for this. So does this effect have to do with signal quantisation effects/truncation errors?


January 12, 2016 - 8:11 pm
Member Since: January 29, 2017
Forum Posts: 690
sp_UserOfflineSmall Offline


I have not noticed stability issues with the Direct Form oscillator, but I did not generally yank the slider control around.

The sinusoidal oscillator in RackAFX is the same Direct Form algorithm. In the latest release of RackAFX (v6.6), I used parameter smoothing to disallow rapid jumps in the controls for the frequency and amplitude sliders. See the post by Alexirae here:

His solution is elegant and simple. The MMA recommends using ramp-smoothing (see the DLS Level 1 and 2 specs) but I've found the LPF solution is simpler to implement.

The Direct Form oscillator works by placing poles directly on the unit circle. Any rounding/truncation errors in the calculation of the coefficients will affect the ultimate location of these poles, either just barely inside or outside the unit circle. This will have a long-term effect of gradually increasing, or decreasing of the signal amplitude, though it generally takes quite a while for this to occur.

You can get more oscillator algorithms (and great references) here:

All the best,


New Member
January 15, 2016 - 2:38 am
Member Since: August 29, 2014
Forum Posts: 2
sp_UserOfflineSmall Offline

Thanks for this. I had read the Datorro paper - indeed one with very useful references. In fact, my explanation for the instability that I noticed was based on this text. Regarding the Direct-Form oscillator, the paper says that "[a]ny instability in the sinusoidal waveform can only be attributed to signal quantization effects, primarily in the form of truncation error in this recursive topology."

Thanks also for pointing me to the zipper noise code.

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 1

Members: 775

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 846

Posts: 3353

Moderators: W Pirkle: 690