brummer10 / guitarix

guitarix virtual versatile amplification for Jack/Linux
249 stars 26 forks source link

Add DC offset blocker at front of audio chain #29

Closed Rippert closed 3 years ago

Rippert commented 3 years ago

This may be the reason there was a highpass filter on the tubes.

I tried turning off my soundcard's ADC highpass filter to get rid of some ringing and I noticed that the VU meter on the Tube section in Guitarix was showing a very high noise floor. I couldn't hear any noise, and the signal meters on my mixer weren't showing any signal coming off of my soundcard output.

I added back the highpass filter on the tubes in guitarix.lib and it got rid of the VU meter problem even if I set the cutoff frequency to 1 Hz. This also worked if you replace the fi.highpass() with fi.dcblockerat() set to 1 Hz. I wouldn't recommend using fi.dcblocker(), as it is set to 35 Hz, which is too high.

The problem with having this at the tube stage is that the bypass setting still is affected, and anything before the tubestage is still affected. The change in sound is minimal at low gains, but at high gains, all sound stops because of the saturated DC offset.

I'm not sure where in the code to put this myself, but there needs to be a filter to block the DC offset at the very front of the audio chain. As I said, a regular highpass filter will work even when set to 1 Hz. It could also be set to 10 Hz for margin as this will not effect the audio in a perceivable way. I tested the 10 Hz case also on my Bass amp, and could not hear any degradation in the low end of the sound.

This is probably a fairly rare problem as most sound cards will not pass DC offsets. However some do, as mine does, and mine uses some kind of adaptive digital filter that creates an annoying ringing sound as a note decays to silence so I would prefer to leave it off.

Thanks, -Ted

brummer10 commented 3 years ago

Hi Ted Okay, I've add a dcblockerat(1.0) on the input, please check if that worked for you, as I can't her (or see) any different.

Rippert commented 3 years ago

That fixed it. Thank you.