Filter design.
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Filter design.

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> DSP
Author Message
Guest






Posted: Fri Dec 02, 2005 1:17 am    Post subject: Filter design. Reply with quote

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.
Back to top
Jerry Avins
Guest





Posted: Fri Dec 02, 2005 7:37 am    Post subject: Re: Filter design. Reply with quote

tanmay.zargar@gmail.com wrote:
Quote:
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Back to top
Joerg
Guest





Posted: Fri Dec 02, 2005 8:08 am    Post subject: Re: Filter design. Reply with quote

Hello Jerry,

Quote:
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.


Quote:
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.


Quote:
... 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
Back to top
Steve Underwood
Guest





Posted: Fri Dec 02, 2005 9:16 am    Post subject: Re: Filter design. Reply with quote

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:

Quote:
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ




Back to top
Jerry Avins
Guest





Posted: Fri Dec 02, 2005 9:16 am    Post subject: Re: Filter design. Reply with quote

dbell wrote:
Quote:
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Back to top
dbell
Guest





Posted: Fri Dec 02, 2005 9:16 am    Post subject: Re: Filter design. Reply with quote

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>
Quote:

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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Back to top
Jim Thomas
Guest





Posted: Fri Dec 02, 2005 5:16 pm    Post subject: Re: Filter design. Reply with quote

Jerry Avins wrote:
Quote:
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
jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536
When you know how things work, the world is one big sandbox. - Avins
Back to top
Guest






Posted: Fri Dec 02, 2005 5:17 pm    Post subject: Re: Filter design. Reply with quote

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)?
Back to top
Fred Marshall
Guest





Posted: Sat Dec 03, 2005 12:12 am    Post subject: Re: Filter design. Reply with quote

<tanmay.zargar@gmail.com> wrote in message
news:1133541474.384256.324670@g43g2000cwa.googlegroups.com...
.......Is there a way to measure the distortion due to aliasing
Quote:
(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
Back to top
Jerry Avins
Guest





Posted: Sat Dec 03, 2005 12:50 am    Post subject: Re: Filter design. Reply with quote

tanmay.zargar@gmail.com wrote:

...

Quote:
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

Quote:
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Back to top
Vladimir Vassilevsky
Guest





Posted: Sat Dec 03, 2005 7:46 am    Post subject: Re: Filter design. Reply with quote

The amount of the distortion due to aliasing equals to the sum of power
for all components higher then Fs/2.

Indeed the speech spectrum envelope falls at about 12dB/oct at high
frequencues. The amount of the high frq content in the clear voice is
very low. So just the direct sampling at 8kHz will be generally OK for
the phone-like quality speech.

The first order filter is just the first order filter. It can't be
Butterworth or anything else. Of course it is going to be of very little
help for antialiasing.

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com

tanmay.zargar@gmail.com wrote:

Quote:
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)?
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> DSP All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB