DC Offset

For discussion of the Voltage Modular synthesis ecosystem.
ColinP
Posts: 951
Joined: Mon Aug 03, 2020 7:46 pm

DC Offset

Post by ColinP »

I encountered a serious clipping problem in a patch today that took some time to debug.

Well, it's not actually a bug but something to be aware of in certain patches with modules that can't cope with large DC offsets added to their audio inputs.

Here's a test rig that shows the effect...
pulseDCoffset.png
pulseDCoffset.png (247.52 KiB) Viewed 2276 times
It's caused when a pulse wave is low-pass filtered. As you can see, one can end up with a huge DC offset.

The solution is to apply a high-pass filter with a low as possible cut-off frequency after the low-pass filter.
User avatar
huggermugger
Posts: 345
Joined: Tue Jun 29, 2021 6:42 pm

Re: DC Offset

Post by huggermugger »

Interesting, and good catch! Even dropping the HPF cutoff to 0 Hz makes the difference.
Attachments
Screen Shot 2022-04-26 at 11.41.08 AM.png
Screen Shot 2022-04-26 at 11.41.08 AM.png (785.19 KiB) Viewed 2269 times
User avatar
utdgrant
Posts: 540
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: DC Offset

Post by utdgrant »

You do have to be careful in this situation, though.

Effectively, once you've fed the output of the LPF into the HPF, the pulse wave is spending its low period just below 0V, but its brief high period will shoot up to nearly 10V. This is fine when the LPF is limiting the slew rate so it never reaches 10V. However, if you should raise the cutoff freq of the LPF, the peak voltage will break through and exceed 5V, leading to other potential clipping situations down the line.

If you attenuate the LPF output to 50% before feeding it to the HPF, you can guarantee to stay within the 'safe' limits of +/- 5V.

On a slight tangent, I don't believe the CA filter does actually get down to 0Hz, despite what the cutoff knob says.
Not to blow my own trumpet, but the Smol Rat goes waaaaaaaaay lower than it! :)
SmolRatDCOffset.png
SmolRatDCOffset.png (616.96 KiB) Viewed 2255 times
______________________
Dome Music Technologies
User avatar
honki-bobo
Posts: 306
Joined: Sat Nov 09, 2019 1:18 pm

Re: DC Offset

Post by honki-bobo »

It's not a bug, it's a feature... seriously!

Mathematically speaking, a LPF is basically performing a weighted moving average of a given number of samples. When you're feeding it a square wave with a pulse width of nearly 0% you're basically left with mostly samples of -5V, thus leaving you with mostly (close to) -5V at the output. If you crank up the pulse width to nearly 100% you will notice the output of the LPF moves towards 5V.

Speaking in terms of frequency, a DC offset is a signal of 0 Hz. This is why you can remove it by passing the signal through a HPF.

If the filter does not introduce resonance/feedback (or amplification, which it shouldn't), the output of the filter should also not exceed the voltage range of the input signal.
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
User avatar
seal58
Posts: 354
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: DC Offset

Post by seal58 »

A solution is on the way. I created a module, which can remove DC part of a signal without changing signal itself. That module waits for approvement.
MRBarton
Posts: 134
Joined: Sat Aug 10, 2019 7:11 pm

Re: DC Offset

Post by MRBarton »

Just a quick note. VM doesn't have a "safe zone" within a patch and will quite happily process trillion volt signals (without arcing). The only place that matters in this regard is the output signal back into the world, and if you exceed 5v there, just turn it down.
User avatar
utdgrant
Posts: 540
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: DC Offset

Post by utdgrant »

MRBarton wrote: Wed Apr 27, 2022 6:03 pm Just a quick note. VM doesn't have a "safe zone" within a patch and will quite happily process trillion volt signals (without arcing). The only place that matters in this regard is the output signal back into the world, and if you exceed 5v there, just turn it down.
Good to know. Many thanks!
______________________
Dome Music Technologies
ColinP
Posts: 951
Joined: Mon Aug 03, 2020 7:46 pm

Re: DC Offset

Post by ColinP »

MRBarton wrote: Wed Apr 27, 2022 6:03 pm Just a quick note. VM doesn't have a "safe zone" within a patch and will quite happily process trillion volt signals (without arcing). The only place that matters in this regard is the output signal back into the world, and if you exceed 5v there, just turn it down.
You are right at a theoretical level but in practice signal levels can be critical in all kinds of situations beyond just the final outputs.

Anything that involves envelope following for instance. Or modules that do wave folding, saturation or distortion. Or doing something like FM when there's an unexpected 3V bias to the modulation.
User avatar
utdgrant
Posts: 540
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: DC Offset

Post by utdgrant »

ColinP wrote: Sat Apr 30, 2022 6:44 pm Or modules that do wave folding, saturation or distortion.
I was checking out the differences in operation of some low-pass filters today. I was quite surprised at how quickly the VM904a started to go into saturation. The output appears to be clamped to +/- 5V.

Input is standard CA Oscillator on sawtooth wave (+/-5V) attenuated to various levels:

Attenuation at 32%:
904at32percent.jpg
904at32percent.jpg (14.9 KiB) Viewed 1855 times
Attenuation at 50%:
904at50percent.jpg
904at50percent.jpg (15.39 KiB) Viewed 1855 times
Attenuation at 75%:
904at75percent.jpg
904at75percent.jpg (15.03 KiB) Viewed 1855 times

to be continued (due to number of attachments allowed)...
______________________
Dome Music Technologies
User avatar
utdgrant
Posts: 540
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: DC Offset

Post by utdgrant »

Attenuation at 100%:
904at100percent.jpg
904at100percent.jpg (15.73 KiB) Viewed 1855 times
Whilst the saturation is symmetrical around 0V, when you add a DC offset to the input, the output becomes asymmetrical:

Attenuation at 100%, +1V DC offset at input:
904at100percentPlus1VoltDC.jpg
904at100percentPlus1VoltDC.jpg (15.17 KiB) Viewed 1855 times
Attenuation at 100%, +3.9V DC offset at input:
904at100percentPlus3.9VoltDC.jpg
904at100percentPlus3.9VoltDC.jpg (15.97 KiB) Viewed 1855 times
As you can see, the output becomes unipolar with a +3.9V DC offset at the input.

I'm not complaining about it, though! :) Just making an observation about possible knock-on effects from DC offsets before getting to the output stage.
______________________
Dome Music Technologies
Post Reply

Return to “Voltage Modular”