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 | Filter design.

There are 11 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

Filter design. - 2005-12-01 18:31:00

I have to design a simple low pass filter (for audio) to reject
frequencies beyond 3.6kHz. The design of the filter is quite simple.
However, I want to know what affect the sampling frequency of the audio
will have on such a filter design.

In other words, I can sample at 16kHz, filter the data and downsample
to 8kHz (which is finally the sampling rate I want) OR I can sample at
8kHz and filter the data. (This will save me precious MIPS, which I am
in great need of). I want to know what I am losing (if anything at all)
if I sample at 8kHz instead of 16kHz. Bear in mind that this is audio
(voice) data I am talking about, so I am not interested in frequencies
above say 3.8kHz. 

Regards,
Tanmay.

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

Re: Filter design. - Jerry Avins - 2005-12-01 20:37:00



t...@gmail.com wrote:
> I have to design a simple low pass filter (for audio) to reject
> frequencies beyond 3.6kHz. The design of the filter is quite simple.
> However, I want to know what affect the sampling frequency of the audio
> will have on such a filter design.
> 
> In other words, I can sample at 16kHz, filter the data and downsample
> to 8kHz (which is finally the sampling rate I want) OR I can sample at
> 8kHz and filter the data. (This will save me precious MIPS, which I am
> in great need of). I want to know what I am losing (if anything at all)
> if I sample at 8kHz instead of 16kHz. Bear in mind that this is audio
> (voice) data I am talking about, so I am not interested in frequencies
> above say 3.8kHz. 

There's a lot of voice information above 3.8 KHz, which is why it's 
easier to understand someone in person than over a telephone.

To sample at 8KHz, you need an analog filter that removes /everything/ 
above 4KHz from the analog signal. It's easier to start rolling off 
below that, so you will sensibly do all the filtering with an analog 
filter (Switched capacitor chip?). Your other option is sloppier analog 
filtering, a higher sample rate at the outset, digital filtering, and 
decimation. There are more and less efficient ways to do that, and 
sampling originally at 24 or 32 KHz may be not much more compute 
intensive than 16 when you chose the efficient way.

An upgraded processor may be cheaper than an added filter chip.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Filter design. - Joerg - 2005-12-01 21:08:00

Hello Jerry,

> There's a lot of voice information above 3.8 KHz, which is why it's 
> easier to understand someone in person than over a telephone.
> 

I had good friends calling in on cell phones and I couldn't even 
recognize who was talking.


> To sample at 8KHz, you need an analog filter that removes /everything/ 
> above 4KHz from the analog signal. It's easier to start rolling off 
> below that, so you will sensibly do all the filtering with an analog 
> filter (Switched capacitor chip?). ...


Switched cap filters kind of fell from grace, too expensive. My take is 
that the industry tried too much skimming of the top tier. That kept 
prices high and many people shunned them. I used them in only one 
industrial design but only because I had no other choice.

Doing this steep of an audio cut-off almost requires up-conversion to a 
few MHz, crystal filter, then back down to baseband. No big deal but the 
crystal filter will cost.


>                           ... Your other option is sloppier analog 
> filtering, a higher sample rate at the outset, digital filtering, and 
> decimation. There are more and less efficient ways to do that, and 
> sampling originally at 24 or 32 KHz may be not much more compute 
> intensive than 16 when you chose the efficient way.
> 
> An upgraded processor may be cheaper than an added filter chip.
> 

That's what I would try as well.

Regards, Joerg

http://www.analogconsultants.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Filter design. - dbell - 2005-12-01 22:30:00

Jerry,

Admittedly this reference is old (Digital Telephony by Bellamy, 1982),
but the analog filter template to meet then current CCITT
recommendations for analog filtering prior to PCM voice coders had only
14 dB of attenuation at 4KHz for 8KHz sampling (attenuation relative to
0 dB at DC).

I guess practicality got in the way of theory.

Dirk


Jerry Avins wrote:

<clipped>
>
> To sample at 8KHz, you need an analog filter that removes /everything/
> above 4KHz from the analog signal. It's easier to start rolling off
> below that, so you will sensibly do all the filtering with an analog
> filter (Switched capacitor chip?). Your other option is sloppier analog
> filtering, a higher sample rate at the outset, digital filtering, and
> decimation. There are more and less efficient ways to do that, and
> sampling originally at 24 or 32 KHz may be not much more compute
> intensive than 16 when you chose the efficient way.
>
> An upgraded processor may be cheaper than an added filter chip.
>
> Jerry
> --
> Engineering is the art of making what you want from things you can get.
> ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

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

Re: Filter design. - Jerry Avins - 2005-12-01 22:46:00

dbell wrote:
> Jerry,
> 
> Admittedly this reference is old (Digital Telephony by Bellamy, 1982),
> but the analog filter template to meet then current CCITT
> recommendations for analog filtering prior to PCM voice coders had only
> 14 dB of attenuation at 4KHz for 8KHz sampling (attenuation relative to
> 0 dB at DC).
> 
> I guess practicality got in the way of theory.
> 
> Dirk

The theory of good enough is much more complex than the theory of 
perfection.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Filter design. - Steve Underwood - 2005-12-01 23:08:00

Remember that the non-linearity of A-law and u-law compression limits 
the instantaneous signal to noise on the telephone network to about 
30dB. 14dB of attenuation, added to the filtering of higher frequencies 
usually occuring in telephone networks for other reasons, generally 
proves adequate to keep the overall mess due to aliasing down in the 
noise. It would take a signal with masses of energy above 4kHz and 
little below 4kHz to cause the aliases to show up badly. The spectrum of 
speech is never like that.

Regards,
Steve


dbell wrote:

>Jerry,
>
>Admittedly this reference is old (Digital Telephony by Bellamy, 1982),
>but the analog filter template to meet then current CCITT
>recommendations for analog filtering prior to PCM voice coders had only
>14 dB of attenuation at 4KHz for 8KHz sampling (attenuation relative to
>0 dB at DC).
>
>I guess practicality got in the way of theory.
>
>Dirk
>
>
>Jerry Avins wrote:
>
><clipped>
>  
>
>>To sample at 8KHz, you need an analog filter that removes /everything/
>>above 4KHz from the analog signal. It's easier to start rolling off
>>below that, so you will sensibly do all the filtering with an analog
>>filter (Switched capacitor chip?). Your other option is sloppier analog
>>filtering, a higher sample rate at the outset, digital filtering, and
>>decimation. There are more and less efficient ways to do that, and
>>sampling originally at 24 or 32 KHz may be not much more compute
>>intensive than 16 when you chose the efficient way.
>>
>>An upgraded processor may be cheaper than an added filter chip.
>>
>>Jerry
>>--
>>Engineering is the art of making what you want from things you can get.
>>¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
>>    
>>
>
>  
>
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Filter design. - Jim Thomas - 2005-12-02 09:57:00

Jerry Avins wrote:
> To sample at 8KHz, you need an analog filter that removes /everything/ 
> above 4KHz from the analog signal. It's easier to start rolling off 
> below that, so you will sensibly do all the filtering with an analog 
> filter (Switched capacitor chip?). Your other option is sloppier analog 
> filtering, a higher sample rate at the outset, digital filtering, and 
> decimation. There are more and less efficient ways to do that, and 
> sampling originally at 24 or 32 KHz may be not much more compute 
> intensive than 16 when you chose the efficient way.

The efficient way Jerry's talking about here is "don't calculate filter 
output samples you're going to discard."  This is easy with a FIR.  Your 
analog anti-aliasing filter can start rolling off at 3.6KHz even if you 
sample at 16K (or higher).  That'll get you a little more rejection than 
if the analog filter were to start rolling off at Nyquist.

There's a pretty good tutorial on decimating filters (aka multi-rate 
filter) on http://dspguru.com - check the FAQ section.

-- 
Jim Thomas            Principal Applications Engineer  Bittware, Inc
j...@bittware.com  http://www.bittware.com    (603) 226-0404 x536
When you know how things work, the world is one big sandbox.  - Avins
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Filter design. - 2005-12-02 11:37:00

On the system that I am working with right now, I cannot afford to
sample at 16kHz (in fact any frequency higher than 8kHz) since I am
running out of MIPS. So I HAVE to sample at 8kHz and sadly I do not
have very good analog pre-filtering for this sampling rate. Change of
processor/clock rates/bus speeds is also not an option.

Now I know that there is going to be 'some' energy in the signal at
frequencies higher than 4kHz before sampling it (at 8kHz). This energy
at frequencies higher than 4kHz will cause aliasing after sampling. I
have implemented a simple first-order Butterworth low pass filter with
a cut off of 3.6kHz. I don't think that this filter will help since the
aliasing damage is already done. I just need to figure out how much the
damage is. Is there a way to measure the distortion due to aliasing
(say by viewing the spectrum of the signal before sampling)?

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

Re: Filter design. - Fred Marshall - 2005-12-02 13:12:00

<t...@gmail.com> wrote in message 
news:1...@g43g2000cwa.googlegroups.com...
......Is there a way to measure the distortion due to aliasing
> (say by viewing the spectrum of the signal before sampling)?
>

Listening to the result is good.

Otherwise, you should be able to calculate it in some limited sense. 
Example:

A sinusoid at 3kHz, a sinusoid at 4.5kHz and a sinusoid at 7kHz all of equal 
amplitude with sampling at 8kHz.
The 4.5kHz will fold into 3.5kHz, the 7kHz will fold into 1kHz.
With no filtering, they will still have equal amplitudes.
With filtering, they will have different amplitudes that you can compute.

Then, you might express the result in terms of sort of a signal to noise 
ratio if that suits you.  But, how are you going to judge whether one number 
is OK and another is not OK?  Listening perhaps?

Fred 


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

Re: Filter design. - Jerry Avins - 2005-12-02 13:50:00

t...@gmail.com wrote:

   ...

> I have implemented a simple first-order Butterworth low pass filter with
> a cut off of 3.6kHz.

A single chip will get you a 4th order filter: 
http://www.national.com/ds/LM/LMF100.pdf

> I don't think that this filter will help since the
> aliasing damage is already done. I just need to figure out how much the
> damage is. Is there a way to measure the distortion due to aliasing
> (say by viewing the spectrum of the signal before sampling)?

Where is the filter? There is no damage while the signal is still 
analog. There is no help if the filter comes after. An anti-alias filter 
doesn't remove aliases; it removes components that would become aliases 
if allowed to remain.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | |