1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Sound filtering circuit - will this work?

Discussion in 'Homework Help' started by 'r-e-s-i-s-t-o-r', Jan 9, 2014.

  1. 'r-e-s-i-s-t-o-r'

    'r-e-s-i-s-t-o-r' New Member

    Joined:
    Jan 9, 2014
    Messages:
    10
    Likes:
    0
    Hello friends!

    Me and my friend are working on a project in school, in which we are intending to record sound using a michrophone, filter out unwanted frequencies using a band pass filter circuit (see: below), and finally send it out through a speaker. Eg99bRD.png
    Lowest frequency= (R1)/(2πL)
    Highest frequency= 1/( 2π(R1)*C )
    Gain= 1+R2/R3
    π=pi

    We're planning on using a very small microphone, and a very small speaker.

    Do you think this circuit will work the way we want it to? We've got very little knowledge in electronics, the circuit and formulas are based on things we found online.
     
  2. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,328
    Likes:
    585
    Location:
    Peterhead, Scotland
    ONLINE
    Probably not.

    There will be some filtering effect due to the tuned LC circuit and R1.
    Low and high frequencies will be attenuated compared with those at the resonant frequency of the LC circuit, but how much attenuation is difficult to determine with the information available.
    Also be aware that the filtering effect will be gradual, there will not be a sharp cut-off between the passband and stopband.

    You may also need a resistor between the LC and the input of the opamp.

    JimB
     
  3. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,048
    Likes:
    541
    Location:
    AZ 86334
    You will likely need two amplifiers; one that is doing the filtering and the other that is driving the speaker. The first can be a generic opamp; the second an audio power amplifier like an LM386. The total signal amplification from microphone level to speaker level can be distributed over the two amplifiers.

    Please specify the bandpass response, lower cutoff frequency, upper cutoff frequency?
    How much audio power do you need at the speaker (headphones or concert hall)?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE

    Your circuit shows a speaker but you typed a recorder. If it is a speaker then you will probably have acoustical feedback howling.

    You should look at the datasheet for the mic to see its recommended load resistance. It might not be able to drive R1 and the filter.

    Why do you want to cut low frequencies and cut high frequencies? To make it sound like a telephone?
     
    Last edited: Jan 9, 2014
  6. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    Hi,

    The part of the circuit with the resistor and inductor and capacitor forms a bandpass filter. A bandpass filter has two frequencies where the response is 3db down. The two angular frequencies are:

    w1=(sqrt(4*C*L*R^2+L^2)+L)/(2*C*L*R), and
    w2=(sqrt(4*C*L*R^2+L^2)-L)/(2*C*L*R)

    the two frequencies in Hertz are then:
    f1=w1/(2*pi)
    f2=w2/(2*pi)

    So it's a little more complicated then you might have originally thought, but not that much more. The op amp section just amplifies all the frequencies up to the limit of it's specs.

    Notice the two formulas are almost the same except in the numerator where one has L added and the other has L subtracted.

    Also, R in the formula is R1 in the schematic PLUS any series resistance of the microphone. So if R1 in the schematic is 1k and the mic has 600 ohms impedance then R in the formula becomes 1000+600=1600 ohms.

    Another point is that these formulas are exact when the inductor and capacitor have zero equivalent series resistance. When there is a little series resistance in either the response will be slightly different but it should be close enough for most purposes.

    As a final note, the bandpass filter above has a peak at some value of frequency between w1 and w2. The peak for this filter occurs with a value of angular frequency of:
    w=1/sqrt(L*C)

    and so the frequency in Hertz where the peak occurs is at:
    f=w/(2*pi)
     
    Last edited: Jan 9, 2014
  7. 'r-e-s-i-s-t-o-r'

    'r-e-s-i-s-t-o-r' New Member

    Joined:
    Jan 9, 2014
    Messages:
    10
    Likes:
    0
    Hell0 guys! Thank you for all of the helpful responses! MikeMl, when you say we need two amps, do you mean that we need to amplify the signal from the microphone before the bandpass filter (like in the picture below), or where would you suggest we add it? 1ZKpVyf.png
    If it's supposed to look like it does in this picture, rather than the last: is my gain simply gain from amp1 + gain from amp2 ((1+R4/R5)+(1+R2/R3)), or is the solution more complex?

    EDIT: The speaker in our case will probably be something in the size of headphones, nothing bigger!
     
  8. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    Hi

    The gain of your circuit, the part with the R, L and C, is as follows:
    Amplitude=Vin*(w*L)/sqrt((R-w^2*C*L*R)^2+w^2*L^2)

    where
    w is the angular frequency equal to 2*pi*f where f is the frequency in Hertz, and
    R is the series combination of R1 in the schematic and the mic resistance.

    With an amplifier before and after this section, the amplitude is simply multiplied by the two gains, so if we have the first gain G1 and the second G2 we end up with:
    Amplitude=G1*G2*Vin*(w*L)/sqrt((R-w^2*C*L*R)^2+w^2*L^2)

    The two 3db down frequencies i had given previously, and the midband max occurs at 1/sqrt(LC) as previously given, so the peak midpand gain is:
    Peak=G1*G2*Vin*1=G1*G2*Vin

    This comes from evaluating the Amplitude with w=1/sqrt(LC).

    However, the second amplifier appears to be an LM386, and the gain for that is set a little differently than for a regular op amp. You should look up the data sheet for the LM386 and find out how to set the gain for that section and also if it will change the frequency response a little bit. The first amplifier assuming it is a regular op amp looks correct.
     
  9. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    You should NEVER make a schematic without looking at the datasheets of the parts you are using like the LM386 little power amp (it is not an opamp):
    1) It is missing a VERY important supply bypass capacitor and series RC at its output to ground to prevent high frequency oscillation.
    2) It has built-in negative feedback so your resistors should be removed.
    3) It is designed to use only a single positive supply so remove the negative supply and connect its Ground pin to ground.
    4) Its input works at the DC voltage of ground and it has an input resistor to ground so add an input coupling capacitor.
    5) Its output is at half the supply voltage so add an output coupling capacitor.
    All these things are shown on its datasheet.
     
  10. Bob_b

    Bob_b New Member

    Joined:
    Jan 10, 2014
    Messages:
    7
    Likes:
    0
    This schematic represents a working design for the LM386 amplifier. It attaches to a PIC18 micro-controller to convert a square-wave audio tone to something more sinusoidal and to drive an 8 ohm speaker.
    AudioAmp_lm386png.png
    This amp has a voltage gain of 20 by default (26dB). Placing a 10uF cap between pins 1 and 8 will increase the gain to 200 (46dB). See the data sheet for more details.

    The advantage of the LM386 is that the output is DC biased to 1/2 VCC. This provides maximum drive capability with the lowest idle current making it a good choice for battery operated circuits.

    You can break the tiny speaker out of a cheap set of earbuds - works pretty good.

    http://roberthall.net/PIC18F4550_Audio
     
    Last edited: Feb 4, 2014
  11. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    An opamp is usually used as a mic preamp but the value of R7 is so low that it will short the output of the preamp.
    It is good that the value of R8 is 10 times higher than the value of R7 but if R7 is increased to 1k (and C12 also re-calculated) then R8 should be 4.7k and C13 re-calculated.
    R9 does nothing but reduce the output level and should be replaced with a piece of wire.
    Since the new value of R8 will be 4.7k then the value of the volume control should be 5 times higher at about 24k but use 20k if you can find it.

    Why do you have two 180uF output capacitors in parallel? Instead use one 330uF or 470uF instead and you will not hear any difference.

    Speech has vowels and consonances. Consonances are the important high frequency sounds of speech above 3kHz to as high as 20kHz.

    Listen to the words `sailing`and `failing`without the high frequencies and they sound the same. There are many more examples. Your filter removes these important sounds. Why?

    Oh, you are playing and recording music? Then without high frequencies a violin will sound the same as a trumpet.
     
  12. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    Hi,

    audioguru:
    I think you nailed it. The amplifier presented by Bob is interesting but there are a few problems as you noted.

    Bob:
    It's nice that you had shown an amplifier that uses the LM386 because we did not have a diagram like that in this thread yet and i think it was very much needed. But the section just before that isnt really up to par with what we normally want for an audio amplifier. That's because of the low frequency cut for one thing, and the resistor just before the pot cuts ALL frequencies by roughly one half, which just causes us to loose gain for no apparent reason.
    When we build an attenuator into an amplifier, it is for a good reason. We usually need to reduce the amplitude to the next stage. But in a general purpose amplifier we dont want to do that because it just takes away from the amplitude we have coming from the microphone, and that's not what we want. So it appears that amplifier was designed for some very specific purpose but not for general audio.

    If you feel like drawing it again without that input section i think it would be great to see. That way the OP will have a reference to look at. If you feel like showing a couple different values for gain settings too that would help also so everyone can plainly see how to set the gain for that section.
    I assume you looked up the data sheet and double checked that all the pin connections for the LM386 are correct.

    I personally dont like the LM386. In fact, my opinion of the LM386 is like that of audioguru's opinion of the LM358...it can be a nasty sounding amplifier.
     
  13. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    The LM386 is OK as a low powered amplifier.
    It does not have crossover distortion like the LM358 dual opamp.
    It does not cut high audio frequencies like the LM358.
     
  14. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    Hello there audioguru,

    Well maybe at low levels, but it's already limited in power output so it's hard to go too much lower than that.

    I used many of these chips buying them in groups of 6 for example. I have found that almost anything else is better.

    But when i used that comparison about the LM386 and LM358 i was not referring to the spec's themselves. I was referring to the dislike by each of us. In other words, if you think about how much you dislike the LM358 that's exactly how much i dislike the LM386. Maybe in a pinch i would use one again, but if i had any other way to do it i would go without the LM386 for sure.
     
  15. WTP Pepper

    WTP Pepper Active Member

    Joined:
    Jan 24, 2012
    Messages:
    648
    Likes:
    41
    Location:
    UK
    The circuit in post #6 has another problem. The first op-amp will undoubtable have a fair bit of gain depending on the sensitiviy of the mic. It is DC coupled and therefore will amplify its own input offset voltage - maybe to the point of damaging the speaker as the 386 also is DC coupled.
    A capacitor ~1uF in series with R5 will help as it forces the front end op-amp to have unity DC gain.
     
    Last edited: Jan 17, 2014
  16. 'r-e-s-i-s-t-o-r'

    'r-e-s-i-s-t-o-r' New Member

    Joined:
    Jan 9, 2014
    Messages:
    10
    Likes:
    0
    Thank you for all the well written responses. I was a bit lazy while making my second schematic and i realize that I hooked it up wrong. I'm very grateful for the circuit in post #9 but I understand that there are a few problems with it. Unfortunately, my knowledge in this area is too small to really understand what the problem is and how to fix it. Also, the formula in that post only gives a single frequency, would like to have a lower and higher frequency between which the frequencies are boosted.
     
  17. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    We assumed that you know that a series coupling capacitor feeding a resistance to ground like many of them in the circuit is a highpass filter that cuts low frequencies and passes high frequencies.
    Then the series resistor feeding a capacitance to ground is a lowpass filter as shown. The highpass filters in series with the low pass filters create a very simple [bandpass filter.

    You still did not explain why you are cutting low frequencies and high frequencies.
     
  18. Bob_b

    Bob_b New Member

    Joined:
    Jan 10, 2014
    Messages:
    7
    Likes:
    0
    BPF.png
    Both opamps are configured for unity gain. So a microphone preamp will be needed.

    (audioguru informed us that this had not been properly biased - R5 and R6 should fix this.)

    The LM386 Amplifier in #9 already has a 2-pole low pass at @3000 Hz. If the circuit of #9 were added to P2 on the output of this Sallen-Key band pass you'd get an additional 12 dB per octave rolloff. So you'd get @ 24 dB attenuation at 6800 Hz.

    Attenuation at low frequencies in audio circuits is usually the opposite of what's needed. Small speakers have a poor bass response already. Typically audio amplifier designs try to offer a bass-boost. Nevertheless, the human voice range that is designed into our legacy telephone system is the 300 - 3000 Hz bandpass. So this bandpass design approximately accommodates that. Tweaking the values of the resistors and capacitors in the circuit for a different bandpass value is a pretty simple task. This simplicity makes the Sallen-Key active filter topology popular.
    MicPreamp.png
     
    Last edited: Feb 4, 2014
    • Informative Informative x 1
  19. 'r-e-s-i-s-t-o-r'

    'r-e-s-i-s-t-o-r' New Member

    Joined:
    Jan 9, 2014
    Messages:
    10
    Likes:
    0
    I've understood that much but I could only see two resistors feeding into two capacitors to ground, I'm probably missing something.

    As to why we are doing this: we are working with a project focused on sound insulation. This whole thing is a little side project to see if we can block out all sound, while still being able to communicate with someone. We understand that these circuits wont block out all other frequencies, this is just to have some sort of practical demonstration and it does not have to be good at all.

    As for the circuit in #17, if I understand this correctly, I can just take this, put an amp-circuit before it and this will work? Should I just use an op-amp or should i use something special?
     
  20. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    Post #9 has TWO highpass filters:
    1) C11 is 0.1uF and it feeds the 50k resistor to ground at the input of the LM386 amplifier that is shown on its datasheet. The cutoff frequency is 32Hz.
    2) C10 and C14 in parallel are feeding the 8 ohm speaker with a cutoff frequency of 56Hz.
    Both filters cut low frequencies so the total cutoff frequency is about 88Hz. Their total can be 300Hz if you want.

    You will be reducing, not blocking low frequencies so that a man's voice will sound thin and tinny. You will be reducing some high frequencies and the important consonant sounds in speech will be missing making speech difficult to understand. "He is sailing" or "he is failing" both sound the same when consonant sounds in speech are missing.
    But you will still hear all the noise sounds between 300Hz and 3kHz.

    The circuit in post #17 is not biased properly so IT WILL NOT WORK.
     
  21. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ

    Hi there Bob,

    Well actually the cutoff frequency is a little more complicated than that. For example, for the low pass filter here the cutoff frequency is:
    w=(sqrt(sqrt(C2^2*R2^4+(4*C2^2-4*C1*C2)*R1*R2^3+(6*C2^2-8*C1*C2+8*C1^2)*R1^2*R2^2+(4*C2^2-4*C1*C2)*R1^3*R2+C2^2*R1^4)-C2*
    R2^2+(2*C1-2*C2)*R1*R2-C2*R1^2))/(sqrt(2)*C1*sqrt(C2)*R1*R2)

    where w=2*pi*f

    Also, to get a sharper response we have to make the two capacitors different values. An old ex member "Winterstone" brought this point up a while back.

    There may be a simplification for the equation above but that shows how much more complex it is.
    In terms of 'wo' and the denominator factor 'a' we have the cutoff frequency:
    w=sqrt(sqrt(2)*sqrt(wo^4-2*a^2*wo^2+2*a^4)+wo^2-2*a^2)

    where
    wo=1/sqrt(R1*R2*C1*C2), and
    a=(R2+R1)/(2*C1*R1*R2)

    Note that 'wo' is not the cutoff frequency.
     
    Last edited: Feb 4, 2014

Share This Page