[sdiy] How to design out "usb noise"?

Richie Burnett rburnett at richieburnett.co.uk
Fri Feb 9 14:17:23 CET 2024


It's just a lot more efficient to process audio samples in blocks though, 
even if these blocks are relatively small like 8 samples.  Otherwise the 
"setup" and "teardown" overhead of each audio processing task is 
disproportionately large in order to just process one single audio sample. 
Much better to gear up for a particular task (e.g. filtering audio,) then 
process a bunch of samples in one run, before suspending that task and then 
getting set up for the next task.  It "amortises" the setup and teardown 
overhead over a bunch of samples.

For instance my DSP virtual-analogue drum machine (hobby project) 
synthesises 1ms of audio for the bass drum, then synthesises 1ms of audio 
for the snare drum, then 1ms audio for the clap, etc, until it finally mixes 
all of these individual voice buffers into a 1ms stereo output buffer to be 
DMA'd out to the DAC.  If it had to generate one sample at a time for each 
of 16 voices it would not be realisable at all on a low-end DSP.

-Richie,


-----Original Message----- 
From: Mike Bryant
Sent: Thursday, February 8, 2024 3:32 PM
To: Mattias Rickardsson ; Richie Burnett
Cc: Synth DIY
Subject: Re: [sdiy] How to design out "usb noise"?


I'm afraid that doesn't actually work.

If you do everything in 2mS (or any other audio frequency) bursts, you still 
get repetitive patterns appearing on the memory lines so it still produces 
audio crap.  You really should do the actual audio processing at 48 or 
96kHz, then try to randomise lower frequency actions such as generating 
envelopes, handling MIDI calls and so on.  I divide the code for these up 
into 32 tasks, then calculate 31 in a random order, one per each 96kHz 
timeslot, but always with just the 32nd task being always on the 32nd 
timeslot which transfers the newly calculated values into the active memory 
locations all the other DSP processing uses.


From: Synth-diy <synth-diy-bounces at synth-diy.org> on behalf of Mattias 
Rickardsson <mr at analogue.org>
Sent: 08 February 2024 15:22
To: Richie Burnett <rburnett at richieburnett.co.uk>
Cc: Synth DIY <synth-diy at synth-diy.org>
Subject: Re: [sdiy] How to design out "usb noise"?

Den tors 8 feb. 2024 13:59 <rburnett at richieburnett.co.uk> skrev:
... if the main micro is processing audio in
2ms blocks that results in an ugly 500Hz current waveform that is quite
hard to filter out!  You either need a *LOT* of local stored charge or a
big inductor to smooth out the ripple of a 500Hz pulse waveform,
otherwise it's influence starts to spread across the board!


Or you just have to fill your processors to keep them busy at all times. 
Finally, feature creep is the solution! ;-)

/mr







________________________________________________________
This is the Synth-diy mailing list
Submit email to: Synth-diy at synth-diy.org
View archive at: https://synth-diy.org/pipermail/synth-diy/
Check your settings at: https://synth-diy.org/mailman/listinfo/synth-diy
Selling or trading? Use marketplace at synth-diy.org 


-- 
This email has been checked for viruses by AVG antivirus software.
www.avg.com


More information about the Synth-diy mailing list