Sign in

username or email:

password:



Not a member?
Forgot your password?

Search compdsp



Search tips

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGA

Discussion Groups | Comp.DSP | DC Removal for human voice

There are 19 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

DC Removal for human voice - Ury - 2012-08-07 09:04:00

Hello,

I have an audio file that contains human voice possibly with DC bias.
What are the pros and cons of DC removal using high pass filter vs. just
computing the average and subtracting from each sample?

If using high pass filter, then what should be the cut frequency?

Thanks,
Ury.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - Randy Yates - 2012-08-07 12:30:00



"Ury" <49838@dsprelated> writes:

> Hello,
>
> I have an audio file that contains human voice possibly with DC bias.
> What are the pros and cons of DC removal using high pass filter vs. just
> computing the average and subtracting from each sample?

It depends on your scenario. If you're are doing this at a desktop PC
one song at a time, the "compute the average" method is fine, or anytime
you know how to split the input into separate blocks. 

However, if you're embedded this into a processor, you usually have
to view the input as an indefinite stream of data.

> If using high pass filter, then what should be the cut frequency?

It's not black and white. Your telephone uses 300 Hz. I would think 50
Hz would be more than enough for most cases, and should give you an
easy design goal.
-- 
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - Robert Adams - 2012-08-07 13:38:00

If your audio file is long, just subtracting the average should be fine.

If the file is short, the accuracy of the dc estimate can be improved by starting and stopping
your average computation on a zero crossing.


Bob
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - Richard Owlett - 2012-08-07 14:20:00

Robert Adams wrote:
> If your audio file is long, just subtracting the average should be fine.
>

CAUTION - circular reasoning ahead!

> If the file is short, the accuracy of the dc estimate can be improved by starting
>  and stopping your average computation on a zero crossing.

OROBOROS has ended ;)
Would one not have to know "average value" to identify a 
"zero crossing"?
E.G. 1 v peak-to-peak signal superimposed on 10 v DC.
      Wherefore art thine "zero" crossings?

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - Robert Adams - 2012-08-07 14:48:00

I was assuming the signal is large and the dc is small, but if that's not true then you are
right that this technique might fail.


Bob
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - maury - 2012-08-07 15:50:00

On Tuesday, August 7, 2012 8:04:33 AM UTC-5, Ury wrote:
> Hello, I have an audio file that contains human voice possibly with DC bias. What are the
pros and cons of DC removal using high pass filter vs. just computing the average and
subtracting from each sample? If using high pass filter, then what should be the cut frequency?
Thanks, Ury.

If the low-frequency cutoff is high enough, try a simnple 1-pole filter 

y(n) = alpha*y(n-1) + (1-alpha)*x(n)

I used this in a telecom device, and it worked file, espicially if alpha is a factor of 2 (e.g.
1/256)

y(n) = y(n-1) >> 8 + x(n) - x(n) >> 8

If you want more emphasis on the past values instead of the current, then

y(n) = (1-alpha)*y(n-1) + alpha*x(n)
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - Tauno Voipio - 2012-08-07 16:11:00

On 7.8.12 10:50 , maury wrote:
> On Tuesday, August 7, 2012 8:04:33 AM UTC-5, Ury wrote:
>> Hello, I have an audio file that contains human voice possibly with DC bias. What are
the pros and cons of DC removal using high pass filter vs. just computing the average and
subtracting from each sample? If using high pass filter, then what should be the cut frequency?
Thanks, Ury.
>
> If the low-frequency cutoff is high enough, try a simnple 1-pole filter
>
> y(n) = alpha*y(n-1) + (1-alpha)*x(n)
>
> I used this in a telecom device, and it worked file, espicially if alpha is a factor of 2
(e.g. 1/256)
>
> y(n) = y(n-1) >> 8 + x(n) - x(n) >> 8
>
> If you want more emphasis on the past values instead of the current, then
>
> y(n) = (1-alpha)*y(n-1) + alpha*x(n)
>

This looks like a single-pole low-pass.

The OP asked for a high-pass.

-- 

Tauno Voipio

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - glen herrmannsfeldt - 2012-08-07 16:25:00

Randy Yates <y...@digitalsignallabs.com> wrote:

(snip, someone wrote)
>> I have an audio file that contains human voice possibly with DC bias.
>> What are the pros and cons of DC removal using high pass filter vs. just
>> computing the average and subtracting from each sample?

(snip)

> It's not black and white. Your telephone uses 300 Hz. I would think 50
> Hz would be more than enough for most cases, and should give you an
> easy design goal.

My stereo amplifier has a switchable 18Hz (12db/octave) filter.
Among other uses, warped vinyl records would be below that.

-- glen
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - mnentwig - 2012-08-08 02:45:00

Maybe one detail: 

computing the average of a signal that is known in its whole length is
conceptually the same as a FIR filter. It does not introduce group delay
ripple, as the impulse response is symmetric.  

A lowpass filter as discussed is IIR. It will cause group delay distortion
near the band edge. 

Most likely, this doesn't matter in real-world audio applications. But it
will show, if you plan to compare output to input for a known test signal.

An easy solution is to apply the same filter also to the reference signal,
so there is no group delay difference between signals.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: DC Removal for human voice - maury - 2012-08-08 09:17:00

On Tuesday, August 7, 2012 3:11:59 PM UTC-5, Tauno Voipio wrote:
> On 7.8.12 10:50 , maury wrote: > On Tuesday, August 7, 2012 8:04:33 AM UTC-5, Ury wrote:
>> Hello, I have an audio file that contains human voice possibly with DC bias. What are
the pros and cons of DC removal using high pass filter vs. just computing the average and
subtracting from each sample? If using high pass filter, then what should be the cut frequency?
Thanks, Ury. > > If the low-frequency cutoff is high enough, try a simnple 1-pole filter
> > y(n) = alpha*y(n-1) + (1-alpha)*x(n) > > I used this in a telecom device, and it
worked file, espicially if alpha is a factor of 2 (e.g. 1/256) > > y(n) = y(n-1) >>
8 + x(n) - x(n) >> 8 > > If you want more emphasis on the past values instead of the
current, then > > y(n) = (1-alpha)*y(n-1) + alpha*x(n) > This looks like a single-pole
low-pass. The OP asked for a high-pass. -- Tauno Voipio

oops  :(
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | |