Filters are driving me nuts

Elledan

[H]ard|DCer of the Month - April 2010
Joined
Oct 18, 2001
Messages
15,913
I need to filter out frequencies above 25 - 30 kHz (as long as it stays below 30 kHz, it's alright) in an audio signal. Cut-off is around 20 kHz.

At the moment I'm hoping that a passive low-pass filter will do the trick, but I'm uncertain whether the cut-off slope will be steep enough.

Some ripple in the passband is acceptable, as long as it stays below 0.5 dB. Ripple in the stopband of more than 0.5 mV is unacceptable (voltage of supplied signal is 5 V max).

Will a passive filter work, or would an active filter be more suitable? What kind of values for the filter circuit would be needed? I'm looking for a Chebyshev response.
 
What sort of stopband attenuation are you trying to achieve? I'm assuming this is for audio.
 
gee said:
What sort of stopband attenuation are you trying to achieve? I'm assuming this is for audio.
It's for audio, yes.

The circuit after the filter contains a number of components which will react to any significant change in the provided signal's voltage (e.g., from 0 to 1 or -1 mV). This should only happen for frequencies below 30 kHz if the circuit is to work properly.

What exactly do you mean with the stopband attenuation?
 
theshadow27 said:
why dont you try a 10khz tunable notch filter... ill dig up the schmatic if youd like
How would a notch filter help me to remove all higher frequencies from a signal?
 
Google for "filter free" by Nuhertz Technologies and play around a bit.

A quick hand calculation makes it seem like you need a 10 or 12th order filter...
 
gee said:
A quick hand calculation makes it seem like you need a 10 or 12th order filter...
*shock*

An active filter seems like a very attractive option all of a sudden :eek:

Thanks for the reference, though.
 
Your requirements are a little unclear from what you wrote-- but anyhow, I would also suggest looking around for some filter design programs-- they could save you some time. I believe that Microchip also has something like what you're looking for in design software, since analog lowpass filters are everywhere in the world of DAC's.

But from what I gather, you're trying to attenuate signals with 5 volt amplitude starting at 20KHz, such that the output is less than 1mV amplitude by the time you hit 30KHz. That gives you 1/2 octave to attenuate a signal by a factor of 5000, or 20*log(5000)=74dB. For sake of convenience, call it 75 dB. A filter gives you 3dB of attenuation per order per octave, so what you're asking for is a filter with a 150dB/octave slope, or 50th order. (Somebody tell me if I'm wrong here, it happened once before=)

Frankly, you can forget about analog, you need a digital signal processor if you're gonna pull this off with anything close to consistent reliability. May I ask what it is that you're trying to do?
 
Aristarchus said:
Your requirements are a little unclear from what you wrote
That's because this is my first time I've ever designed a filter ;)

But from what I gather, you're trying to attenuate signals with 5 volt amplitude starting at 20KHz, such that the output is less than 1mV amplitude by the time you hit 30KHz. That gives you 1/2 octave to attenuate a signal by a factor of 5000, or 20*log(5000)=74dB. For sake of convenience, call it 75 dB. A filter gives you 3dB of attenuation per order per octave, so what you're asking for is a filter with a 150dB/octave slope, or 50th order.
That sounds about right, yes.

The 5 V max amplitude is because it's placed right after an amplifier. The amplifier's input signal is closer to 1.5 - 2 Vrms.

The reason I placed the filter after the amplifier is because I was afraid that otherwise ripple in the stopband would be amplified, consequently wreaking havoc upon the rest of the circuit.

Frankly, you can forget about analog, you need a digital signal processor if you're gonna pull this off with anything close to consistent reliability. May I ask what it is that you're trying to do?
Out of an audio signal I need to use everything between 0 to around 20 kHz. Due to the design of the circuit, any ripple (voltage) unrelated to the aforementioned signal will severely mess with its functioning.

By the way, I just changed part of the design (dropped a successive approximation ADC, now constructing a single-slope ADC), so at the moment I may not even need the amplifier, as the 5 V requirement (to use the ADC's full spectrum) is gone.

This means that in theory I should be able to use the 2 Vrms input signal directly.
 
Okay, I've completely changed strategy: instead of trying to get a clean and fully prepared signal into the circuit I'm adapting it to accept any frequency and respond only to those below a certain limit. This means that the filter will basically be build into the (signal processing part of the) circuit. It's now just a matter of adding some monoflops and feedback logic.

I'm certain I'll need to design and use a filter one day, though ;)
 
why would a simple low pass filter not be an option?

f=1/(2piRC)

pick a cap and find a suitable resistor
 
Aristarchus said:
May I ask what the end goal of your project is?
It's basically a sound card, i.e. it allows one to record a sound (sine) wave, except that it doesn't employ the usual 'ADC at N samples/second' approach.

It's actually part of a much bigger project.
 
plot said:
why would a simple low pass filter not be an option?

f=1/(2piRC)

pick a cap and find a suitable resistor
Well, considering that I no longer need the sharp cut-off, I guess I could put in such a basic filter to at least get rid of HF noise.
 
Elledan said:
It's basically a sound card, i.e. it allows one to record a sound (sine) wave, except that it doesn't employ the usual 'ADC at N samples/second' approach.

It's actually part of a much bigger project.
Why not use an off-the-shelf ADC part, eg. an Analog Devices AD1871?

These use sigma delta conversion and only need a first order filter, since they sample at a huge bitrate and do low pass filtering internally.
 
gee said:
Why not use an off-the-shelf ADC part, eg. an Analog Devices AD1871?

These use sigma delta conversion and only need a first order filter, since they sample at a huge bitrate and do low pass filtering internally.
Pretty much because it's more than just a simple ADC. I can not (yet) provide any details at this moment, though.
 
Elledan said:
Well, considering that I no longer need the sharp cut-off, I guess I could put in such a basic filter to at least get rid of HF noise.

Hrm, you could use an active filter with an OpAmp i suppose, would easily acheive the same effect. Not sure if the cut off would be sharp enough though. With an LM324 i think we always measured the rolloff rate to be -20dB/decade
 
plot said:
Hrm, you could use an active filter with an OpAmp i suppose, would easily acheive the same effect. Not sure if the cut off would be sharp enough though. With an LM324 i think we always measured the rolloff rate to be -20dB/decade
If I'm going to use an filter, it'd probably be an active one.

Anyway, considering that the input source I'll be using with this circuit is relatively clean in terms of noise, and the PCB is already becoming more and more crowded (and I haven't even added the supply lines and pull-up resistors and decoupling caps, let alone the power-on reset circuit ;) ) I've decided to omit the filter for now. I may add it later if I can find some space on the PCB, though.
 
Back
Top