Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DC Offset removal effect #2408

Open
petersampsonaudacity opened this issue Jan 11, 2022 · 9 comments · May be fixed by #5917
Open

Add DC Offset removal effect #2408

petersampsonaudacity opened this issue Jan 11, 2022 · 9 comments · May be fixed by #5917
Labels
Design / UX Bugs, enhancement requests and tasks a designer should look at Effects (EGATs) Effects, Generators, Analyzers and Tools Enhancement Request Or feature requests. Open-ended requests are better suited for discussions. minor feature low impact feature

Comments

@petersampsonaudacity
Copy link

petersampsonaudacity commented Jan 11, 2022

Describe the bug
DC offset removal is only bundled in the Normalize effect. This leads to DC offset not being done at all, or being done too late as a final editing step in Normalize.

DC on the signal should be removed early in the editing process but it is often overlooked by users as it is "hidden" in an effect normally used late in the editing process. Note that DC offset is not audible (so may not be corrected by the user) but reduces headroom for subsequent processing

This was originally logged as a Proposal in 2011 in the Audacity Wiki.

To Reproduce
Steps to reproduce the behavior:

  1. Look for a command in the menus for DC Offset Removal
  2. Observe: you won't find one

Expected behavior

  1. Create a new command for Remove DC offset
  2. arguable as to whether it should be in the Effect menu or the Tools menu
  3. remove the DC offset option from the Normalize effect

Screenshots
image

image

Additional information (please complete the following information):

  • OS: all
  • Version: all

Additional context
Could be automatically invoked immediately post-capture, or post import, if Audacity detects significant DC (to nudge the user into optionally dealing with it).

@petersampsonaudacity petersampsonaudacity added Enhancement Request Or feature requests. Open-ended requests are better suited for discussions. Design / UX Bugs, enhancement requests and tasks a designer should look at UX labels Jan 11, 2022
@petersampsonaudacity petersampsonaudacity added this to Undecided in Feature Requests via automation Jan 11, 2022
@LWinterberg LWinterberg added the Effects (EGATs) Effects, Generators, Analyzers and Tools label Jan 14, 2022
@LWinterberg LWinterberg moved this from Undecided to Accepted in Feature Requests Jan 21, 2022
@LWinterberg LWinterberg added this to To do / Unclaimed in Community Contribution via automation Jan 21, 2022
@LWinterberg LWinterberg removed the UX label Jan 26, 2022
@werame
Copy link

werame commented Jan 27, 2022

Can you clarify what you mean by the first two algorithms "dynamic bias adjust" and "absolute offset"?

SuperCollider only does the 3rd one IIRC, as LeakDC. Some useful discussion (in that context) regarding algorithms here: https://scsynth.org/t/why-leakdc-and-not-a-standard-hpf-for-dc-removal/4780/

@SteveDaulton
Copy link
Member

SteveDaulton commented Jan 27, 2022

Can you clarify what you mean by the first two algorithms "dynamic bias adjust" and "absolute offset"?

That came from some experiments that I tried over a decade ago. (The original posts are somewhere on the Audacity forum).

If I recall correctly, "dynamic bias adjust" measured the amount DC bias over the first part of the selection, and applied compensation. It would then repeat the process on blocks of data, updating the bias correction as it went - in effect, a very low frequency high-pass filter, but with the advantage that it looked ahead to determine the required bias correction, so no click at the start.

  • If the DC offset is constant, then "dynamic bias adjust" is identical to "DC offset correction" in Audacity's Normalize effect.
  • If the amount of DC offset drifts over time, then "dynamic bias adjust" performs better than "DC offset correction".

"Absolute offset" was (probably) adjusting the DC offset so that the highest positive peak is equal to the lowest negative peak. This does not necessarily remove DC (in fact it may introduce DC offset), but it allows maximum amplification before clipping.

@werame
Copy link

werame commented Jan 27, 2022

That's what I thought about the last para. Basically global vs local offset in a certain time window. Sane audio hardware compensates for the later with some output caps anyway. Fairly easy to measure with an oscope or even a voltage meter with memory or at least fast updates if it's a digital VM. Have done this for my own hardware out of curiosity in the past.

I'll check out the forum for details on the rest.

@SteveDaulton
Copy link
Member

Sane audio hardware compensates for the later with some output caps anyway.

Caps leak. Cheap caps can leak significantly. High quality audio interfaces often use dual power rails and high quality "audio" caps to minimise DC offset.

I'll check out the forum for details on the rest.

This is probably the most relevant topic: https://forum.audacityteam.org/viewtopic.php?f=42&t=68463
(not quite a decade ago ;-)

@LWinterberg LWinterberg removed this from Accepted in Feature Requests Mar 2, 2022
@LWinterberg LWinterberg changed the title Proposal DC Offset removal Add DC Offset removal effect Mar 2, 2022
@LWinterberg LWinterberg added the minor feature low impact feature label Mar 3, 2022
@JC3
Copy link
Contributor

JC3 commented Feb 6, 2023

Rather than implementing this as a new effect, does it make more sense to include one of the DC Offset Nyquist plugins on the forum in the standard distribution?

@petersampsonaudacity
Copy link
Author

Personally I'd prefer it as a new effect - so that way it gets more prominence, is more "discoverable"

@JC3
Copy link
Contributor

JC3 commented Feb 7, 2023

@petersampsonaudacity For the correction / removal operation, would you prefer "correct DC offset to X dB" (default X=0), or simply "remove DC offset"? The former allows specification of the new target offset, the latter hard codes the target to 0 but is a simpler UI choice.

The code should end up virtually the same either way, it's just a UI choice: simplicity vs. flexibility. I prefer the former option, but I don't know the user base well.

@petersampsonaudacity
Copy link
Author

@JC3 I guess it depends of one wants to have a command that also creates DC offset as well as removing it.

For my money I would have:

a) simple DC Offset Removal with "Remove DC offset"

b) then if we wanted a tool to create DC offset (for testing or other purposes) a Nyquist plugin could be written for that, provided as an optional plugin that users can add if and when required - as it is somewhat of a niche piece of functionality.

@ygoe
Copy link

ygoe commented Mar 18, 2023

I'd rather like to see a manual DC offset setting. It completely fails for me now. There's a slight positive offset in a file I have, but it's not removed at all. I need to tell it how to offset the samples to make it work.

@LWinterberg LWinterberg mentioned this issue Dec 1, 2023
30 tasks
@PatrickKallenbach PatrickKallenbach linked a pull request Feb 5, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design / UX Bugs, enhancement requests and tasks a designer should look at Effects (EGATs) Effects, Generators, Analyzers and Tools Enhancement Request Or feature requests. Open-ended requests are better suited for discussions. minor feature low impact feature
Projects
Status: timeline: 3.x
Development

Successfully merging a pull request may close this issue.

6 participants