<div dir="ltr">Have you done any math on whether noise shaping could help? I mean, specifically, rather than just adding random jitter, using a jitter pattern intended to push the sidebands outside of the audio band?<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 23, 2020 at 12:52 PM Tom Wiltshire <<a href="mailto:tom@electricdruid.net">tom@electricdruid.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi all,<div><br></div><div>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. The modulated clock runs from 25KHz to 500KHz ( a 20:1 range, not bad for a flanger, although not as good as the best analog flangers) and gives delay times from 20msec to 1msec with a typical 1024-stage BBD.</div><div><br></div><div><a href="https://electricdruid.net/flangelicious-a-super-dooper-flanger/" target="_blank">https://electricdruid.net/flangelicious-a-super-dooper-flanger/</a></div><div><br></div><div>However, this wasn’t entirely without costs, and I’m now aiming to improve the design.</div><div><br></div><div>The original design uses the PIC’s NCO for the BBD clock. This is a 24-bit phase accumulator with a maximum 20-bit frequency increment. The clock can run at a maximum of 16 MHz. The final clock frequency is half the NCO frequency since it is fed through a further hardware module. This “Complementary Waveform Generator” is able to generate the biphase waveforms, and can even include a deadband gap between the two phases (very handy!).</div><div><br></div><div>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).</div><div><br></div><div>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.</div><div><br></div><div>The sonic effect of these various effects is odd bird-like chirps or “watery” noises in the background.</div><div><br></div><div>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.</div><div><br></div><div>I’ve done some initial investigations. Increasing the NCO clock should help, since it decreases the jitter (a single clock cycle becomes shorter) but unless you also increase the NCO length, the frequency resolution gets worse (so with a 16MHz clock, I get frequencies every 15Hz, but with a 32MHz clock that step is every 30Hz). Small frequency steps are important since we want the modulation to be smooth. So what you win in one place, you lose in another.</div><div><br></div><div>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.</div><div><br></div><div>Does anyone have any ideas about how I might reduce the problems in this design? I see various issues:</div><div><br></div><div>1) Resampling of the LFO output by the NCO reset</div><div>2) Frequency stepping caused by the NCO minimum frequency step</div><div>3) Jitter cycles caused by the NCO</div><div><br></div><div>Any ideas appreciated. I’d like to do a “version two”, but it’s only worth it if I can squeeze a little better performance out of it.</div><div><br></div><div>Thanks,</div><div>Tom</div><div><br></div><div><div>
<div style="overflow-wrap: break-word;"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">==================<br>       Electric Druid<br>Synth & Stompbox DIY<br>==================</div></div>

</div>
<br></div></div>_______________________________________________<br>
Synth-diy mailing list<br>
<a href="mailto:Synth-diy@synth-diy.org" target="_blank">Synth-diy@synth-diy.org</a><br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy" rel="noreferrer" target="_blank">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">[s]</div>