can anyone help me design a low pass filter?

Thread Starter

jack_sparrow

Joined Aug 17, 2006
17
please help me design a low pass filter(not an ordinary RC filter) using op-amps. it's urgent...this is for our project which is a voice recorder..the low pass filter is used for the output signal coming from the DAC decoder...the cut-off freq. is 8khz and the supply voltage of the filter circuit must be 5 volts..i really need help...if anyone can give a circuit to me,kindly discuss to me the calculation in obtaining the cut-off freq at 8khz....thanks
 

beenthere

Joined Apr 20, 2004
15,819
Hi,

Hit the Microchop Technologies web site and get the free download of their Filterlab software. It does filters with multiple feedback and Sallen-Key topologies. You can even put in component values to agree with what you have on hand, and it will adjust the others to compensate.
 

Papabravo

Joined Feb 24, 2006
12,767
Wikipedia's da bomb

http://en.wikipedia.org/wiki/Sallen_Key_filter

SQRT(R1R2C1C2) = (2*pi*8kHz)^-1
If R1=R2 and C1=C2 then
RC = (2*pi*8kHz)^-1
RC = 19.9 e -6
Let C = .1 uF = 1 e-7
Then R = 199 Ohms

Recompute the corner frequency as 7.99 e3 Hz.
Edit**** rolloff is 12 dB/octave NOT 12 dB/decade and this is a voltage ratio, not a power ratio so we use 20 not 10 ****
As the article mentions the rolloff of the two pole filter is 12 dB/octave
So at 16 kHz the output will be about 1/4 of the output at 8 kHz
Since 10^(-12/20) = .251 = 1/4 = Vout/Vin
At 80 kHz we use 10^(-40/20) = 0.01 = 1/100 = Vout/Vin
*******
 

Ron H

Joined Apr 14, 2005
7,014
Wikipedia's da bomb

http://en.wikipedia.org/wiki/Sallen_Key_filter

SQRT(R1R2C1C2) = (2*pi*8kHz)^-1
If R1=R2 and C1=C2 then
RC = (2*pi*8kHz)^-1
RC = 19.9 e -6
Let C = .1 uF = 1 e-7
Then R = 199 Ohms

Recompute the corner frequency as 7.99 e3 Hz.
As the article mentions the rolloff of the two pole filter is 12 dB/decade
So at 80 kHz the output will be about 1/16 of the output at 8 kHz
Papa, you should have written 12dB/octave, which is 40dB/decade. At 80kHz, the output will be 1/100 of the output at 8kHz.
 

Papabravo

Joined Feb 24, 2006
12,767
You could try various standard parts.
A 741 probably won't work too well
An LM324 or LM358 should do a bit better
A TL084 should work fine.

Check the parameters call GBW for gain bandwidth product pick something with a GBW of at least 250,000. Also check the slew rate to make sure the output will follow inputs in the frequency range of interest and then some.
 

Thread Starter

jack_sparrow

Joined Aug 17, 2006
17
thanks...i think i'll go for TL084...another question...kindly explain to me about this dB/octave thing...i'm not quiet familiar with these things..what is the advantage if we've got high dB/octave or low dB/octave...if having a GBW lesser than value you gave me would make the circuit less accurate?
 

Papabravo

Joined Feb 24, 2006
12,767
It is a 2nd order circuit becaue it's characteristic equation has two roots. Roots in the denominator of a rational function are called poles. It is where the rational function goes off to infinity.

In frequency an octave is a factor of 2. Middle C on a piano is about 256 Hz. C above middle C is about 512 Hz. It is one octave above middle C. A decade is a factor of 10. 10 kHz is one decade above 1 kHz.

When you pick the corner frequency of a filter the dB/decade or dB/octave defines the slope of the filter response above the corner frequency, for a low pass filter. The plot is normalized so that the response in the passband, from DC to the corner frequency for a low pass filter, is at 0 dB. Right at the "corner" there is a smooth transition to the stop band.

If you need a steeper slope you cascade the 2nd order stages.

The way GBW product works is that you get an idea of how gain and bandwidth are related. If GBW is 100,000 then it means you can get a gain of 100 at 1 kHz, but only a gain of 1 at 100 kHz.

Google "Bode Plot" for a graphical picture. It also includes phase information.
 

Thread Starter

jack_sparrow

Joined Aug 17, 2006
17
by the way..how would i test this circuit?i do have a scope and signal gen..how would i know if the result is correct...how would it affect the amplitude?what necessary settings of the scope and signal gen should i set?
 

Papabravo

Joined Feb 24, 2006
12,767
You set the signal generator to some nominal level like 2 Volts peak to peak. As you sweep the frequency from some low value like 10 Hz up to just below the corner you should see the output at pretty much the same amplitude. At the corner the output should be about 70% of the input. That's 3 dB down or -3dB from the input level.

As you continue to increase the frequency the output will diminish by 12 dB/octave until at some frequency it will pretty much be down in the mud.

In Excel or other plotting package you can plot 20*log(Vout/Vin) as a function of frequency after you take the data.
 

Papabravo

Joined Feb 24, 2006
12,767
I don't know. It is typical for a filter to have some insertion loss: in the range of 1-2 dB. Depending on the application the power amplifier may or may not be desireable.
 

Thread Starter

jack_sparrow

Joined Aug 17, 2006
17
ahh...ok...then again,move on another topic,..do you know how does a PWM works?it's part of our project..my other partner needs my help and i don't know anything about it..such that the definition in some websites are too broad.. it's very complicated...in our project,our teacher wants us to implement PWM as a Digital to Analog converter then goes into the filter circuit..but,we implement PWM in VHDL code not a PWM circuit..but then again,we were able to search a sample program of PWM code but unfortunately we don't understand the coding..can you explain to me about the duty cycle thing,the importance of pulsewidth and the amplitude of the sample and the width of the PWM input...thanx
 

Papabravo

Joined Feb 24, 2006
12,767
I really think you should be able to do this on your own.

Start with an arbitrary, but fixed frequency. If a pulse at this frequency has a 50% duty cycle it will be on of 1/2 the time and off for 1/2 the time. If it has a 0% duty cycle it will be off all the time. If it has a 100% duty cycle it will be on all the time.

To modulate the pulse width means to change the pulse width in discrete steps from 0 % to 100%.

Now the homework question and the reason why a PWM is a poor mans D/A converter.

What is the integral over one period of the fixed frequency, or from t=0 to t = 1/f of a pulse with a constant duty cycle of d%, if the amplitude of the ground referenced signal is 1 Volt?

Don't you dare tell me you have no clue on solving this little exercise.
 

Papabravo

Joined Feb 24, 2006
12,767
Yes! The average of zero and Vcc is just, the duty cycle times Vcc. So the periodic signal passed through a filter will be, in some sense, a "smoother" average.

You may not be able to answer this question until you try it out, but should the fixed frequency of the PWM be above the filter's corner frequency, below the filter's corner frequency, or is the frequency of the PWM a don't care?

For some hints on the implementation:
1- Consider a free running binary counter
2- Consider a register with the same number of bits as the free running counter
3- Consider a magnitude comparator like a 74LS85. The datasheet even has the gate level implementation

Good Luck
 
Top