[sdiy] Flangelicious noises - some queries about NCO jitter and resampling and similar

Richie Burnett rburnett at richieburnett.co.uk
Thu Jan 23 21:56:00 CET 2020


Hi Tom,

> When I designed the original “Flangelicious” flanger effect, I used a PIC 
> 12F1501 to generate a modulated biphase clock suitable for driving a BBD 
> directly. This single chip replaced an LFO and VCO circuit and simplified 
> the flanger design significantly...

Interesting idea!

> The LFO runs at a 25KHz sample rate and modifies the NCO frequency 
> increment at this rate. The NCO will only accept the new increment when 
> the current cycle has ended (the freq inc is double-buffered). This leads 
> to an uncertain “resampling” period of the LFO output by the NCO clock. 
> This isn’t so bad when the NCO output is high, since the NCO will be 
> updated at close to 500KHz (2usecs max), but when the modulation wave 
> sweeps low, the clock output is getting close to 25KHz and the “update 
> discrepancy” between two rates of near 25KHz could be significant (40usecs 
> max).

I get what you're saying about the NCO essentially irregularly sampling the 
LFO waveform, and the sampling instants having about 40us of jitter on them. 
However, the LFO waveform is low frequency by definition, so it has a low 
rate of change.  So I doubt that 40us of jitter on such a low frequency 
waveform is the cause of your problem.  (You could theoretically resample 
the LFO waveform at the instants when the NCO calls for a new value, using 
linear interpolation based on the nearest two samples generated by the LFO 
oscillator, but it might be a pain to program in practice and may not yield 
a great improvement.)

> Another potential source of error is the NCO jitter. Even without any LFO 
> modulation, the NCO doesn’t produce a fixed frequency. Instead there is a 
> certain amount of jitter, and this jitter is regular and can occur at 
> audio rates.

I suspect this is the cause of the problem.  When your Virtual Voltage 
Controlled Oscillator (VVCO) is at its maximum frequency the NCO is 
essentially synthesising a 500kHz square wave using a 16MHz sample rate. 
This waveform will alias badly.  Or the transitions of the 500kHz square 
wave will be quantised to the edges of the 16MHz clock, if you prefer to 
think about it this way.  The proper way to do this is to generate a 
sinewave with the NCO, filter that with an analogue reconstruction filter to 
smooth off the steps and remove the images from the sampling process, then 
put this smooth sinewave through an analogue comparator to generate a 
variable frequency squarewave that is free of any jitter on its rising and 
falling edges.  The problem is, I guess the PICs NCO doesn't have a built-in 
sinewave LUT ROM?  It just has a digital I/O line output?

> The sonic effect of these various effects is odd bird-like chirps or 
> “watery” noises in the background.

I'm not surprised that it results in audible artefacts.  Any jitter on the 
BBD clock will result in jitter in the BBD delay time and that will cause FM 
sidebands either side of spectral lines present in the original audio input.

> There is now a newer chip available (the PIC 16F18313) which allows a 
> 32MHz clock for the NCO. The NCO is still 24-bit, but the frequency 
> increment is now 24-bit too, which enables higher frequency outputs.

You could double the sample rate of the NCO, but I doubt it will yield an 
improvement in SNR greater than 6dB.  Oversampling is an inefficient way to 
deal with anti-aliasing.

> Another thing I’ve tried is to add dithering to the NCO phase accumulator 
> to break up the jitter cycles. This seems to work, sort-of, but replaces 
> toned noise with hiss. It’s not a huge improvement.

That was going to be my suggestion!  Trying to introduce some dither noise 
to break up any regular patterns in the NCO output that produce annoying 
tones.  As you've found the penalty for suppressing the annoying tones, is 
that the energy gets moved to the background noise floor.

-Richie, 




More information about the Synth-diy mailing list