can't get rid of dc offeset on wav file.

Help for Audacity 2.x.x on Windows.

ImageThis forum is for Audacity 2.x.x on Windows.
Please state which version of Windows you are using,
and the exact three-section version of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.

can't get rid of dc offeset on wav file.

Permanent link to this post Posted by Lassar » Fri Dec 29, 2017 8:37 pm

I am using Audacity 2.2.1

I have used normalize, which looks like it does a good job, except
the silence portion has a dc offset.

It looks like a bug in the normalize plugin.

Is there any way to remove the dc offset without distorting
the audio waveform?

I am attaching the wav to this post.
Attachments
128138__dnab55__alarm-clock-mono-loop-public-domain.wav
(737.68 KiB) Downloaded 8 times
Lassar
 
Posts: 16
Joined: Fri Sep 13, 2013 3:15 am
Operating System: Windows 10

Re: can't get rid of dc offeset on wav file.

Permanent link to this post Posted by kozikowski » Fri Dec 29, 2017 8:50 pm

DC Removal is not perfect. It only works on natural sounds which naturally settle at "zero" DC. Any DC Offset in this case is generally caused by a broken microphone or preamp.

That's not a natural sound. That's a data construction with no nature at all.

You can get rid of it the "classic" way by lopping off the low frequencies. Effect > Equalization: Low Rolloff for Speech works, but you are warned that this process causes distortion of its own which is why Normalize doesn't do it this way.

You can also use Effect > High Pass Filter, 20Hz, 24dB.

Same thing. It causes distortion.

Koz
kozikowski
Forum Staff
 
Posts: 38805
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: can't get rid of dc offeset on wav file.

Permanent link to this post Posted by kozikowski » Fri Dec 29, 2017 8:58 pm

You may also find a manufacturing shortcut.

Nobody is interested in paying for a perfect alarm-clock sound when thumping and non eee-eee sounds in the tone generator will never make it past the tiny clock speaker.

You have what happens when you carefully lift that sound into a formal sound system where those distortions suddenly matter.

Koz
kozikowski
Forum Staff
 
Posts: 38805
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: can't get rid of dc offeset on wav file.

Permanent link to this post Posted by DVDdoug » Fri Dec 29, 2017 9:10 pm

Offset correction can be a compromise. In this situation I'd go with Koz's high-pass filter technique.

Your original waveform is asymmetrical, but there is no true DC offset. True DC offset will show-up during silence. Mathematically, the wave is more negative than positive, so you could say there's an overall negative bias or negative offset.

Is there any way to remove the dc offset without distorting
the audio waveform?
Either way you shouldn't be hearing any distortion... But, whenever you change the wave shape, that's "distortion". You can't hear DC, but you can (sometimes) hear a click when you start playing the file and the DC offset kicks-in and another click at the end of the file when the DC offset cuts-off.
DVDdoug
Forum Crew
 
Posts: 2981
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: can't get rid of dc offeset on wav file.

Permanent link to this post Posted by kozikowski » Sat Dec 30, 2017 3:07 am

The supplied sample sound file has a very serious DC offset but a more-or-less simple sound wave. I'm betting this sound file started out life with 100% DC offset and in its native state goes between ground and 5 volts. This is the problem with forum diagnostics following a poster's failed corrections instead of looking at the original, uncorrected work.

I'm betting the original work was something like this (scroll down).

Screen Shot 2017-12-29 at 19.03.34.png
Screen Shot 2017-12-29 at 19.03.34.png (33.04 KiB) Viewed 141 times


Koz
kozikowski
Forum Staff
 
Posts: 38805
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: can't get rid of dc offeset on wav file.

Permanent link to this post Posted by steve » Sat Dec 30, 2017 2:32 pm

Lassar wrote:It looks like a bug in the normalize plugin.

It isn't a bug.
DC offset correction looks at the average level across the entire selection. For "normal" audio, the positive going waveform will be exactly balanced by the negative going waveform.
In your sample, the negative going waveform exceeds the positive going waveform, giving an average level that is negative, That negative average is the "DC offset".
DC offset correction applies an equal and opposite bias to the entire selection, so that the average is zero.

What you are wanting to do is to apply DC offset correction to the "peep"s while ignoring the flat (silence) in between two "peep"s.
The obvious, though arduous, way to do that, is to manually select each of the peeps and apply DC offset correction to each of the peep's (one at a time).

Fortunately there is a shortcut which works almost as well:
Apply the Equalization effect, with the "Low roll-off for speech" preset and the "Length of filter" set to maximum.
This works because "DC" is essentially a frequency of "zero Hz", and the Equalization settings described will very strongly reduce frequencies below 60 Hz. The "peep"s have very little content below 800 Hz, so are virtually unaffected.

The Equalization effect is better in this case than the High Pass filter because the Equalization effect has linear phase response, meaning that it has little effect on the shape of the waveform of the "peep"s.

If this was a waveform that you generated programmatically, the better solution would be to fix the program so that it doesn't produce DC offset.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45667
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: can't get rid of dc offeset on wav file.

Permanent link to this post Posted by steve » Sat Dec 30, 2017 3:58 pm

steve wrote:If this was a waveform that you generated programmatically, the better solution would be to fix the program so that it doesn't produce DC offset.

While not a perfect copy, this code run in the Nyquist Prompt effect (http://manual.audacityteam.org/man/nyquist_prompt.html) gives a pretty close simulation (with no DC offset):
Code: Select all
(mult 0.3 (sum 1 (osc-pulse 1.86 0.24))
  (osc (hz-to-step 830) 1 *saw-table*)
  (sum -1 (mult 0.2 (osc (hz-to-step 80) 1 *saw-table*))))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45667
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu


Return to Windows



Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests