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

Guitar Audio Filter For Frequency Detection

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by transistance, Jul 8, 2008.

  1. Torben

    Torben Well-Known Member

    Joined:
    Oct 6, 2006
    Messages:
    2,507
    Likes:
    34
    Location:
    B.C., Canada
    In the schematic, you need to click the "Invoke" button, then click the IC symbol in question. You will then get a popup asking you to specify the gates you wish to add. Select "Power". This should give you a small symbol representing the Vcc and GND for the part which you can place as you like. Don't worry that it is not visibly connected to the part on the schematic; Eagle knows what is going on and it'll be connected properly in the board editor.

    Make sense?


    Torben
     
  2. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul
    PIC Basic Pro

    Here is the latest version of the filter. As of now my Vpp of output signal is 1.1V . Any ideas as to why? Is there a problem with the design or my actual circuit? Will 1.1Vpp adversely affect my PIC from reading in the frequency?

    Can anyone help me out with timer and RTI modules for a PIC controller (I will need RTI for frequency detection, right?) using PIC Basic Pro? I'm using a 16F877 to detect rising edges of my square wave output, start a count with first edge detected and stop on the 5th and reverse the average period to get fundamental frequency.

    How do you set the timer and rti modules in PIC Basic? How do you read the timer and rti modules?

    Some .bas code examples or pseudo code will be greatly appreciated.

    Thanks in advance,
     

    Attached Files:

  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    With no signal on the input, what dc voltage level is measured on the output.?
     
  4. dave

    Dave New Member

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


     
  5. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul

    Floating Input => VDC of Output = 2.54V
    Floating Input => VAC of Output = 2.35V

    Grounded Input => VDC of Output = 1.54V
    Grounded Input => VAC of Output = 0V
     
  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE

    hi,
    The grounded input, giving those output values seems odd.!
    Are you sure the system isnt unstable ie; oscillating.?

    Is the 1.1Vpk signal you posted earlier superimposed on the 2.54Vdc.?

    You should have the Vinput connected, with the Vin set to zero, when you take these measurements...
    Remember its a high input impedance opa.
     
    Last edited: Jul 21, 2008
  7. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,445
    Likes:
    937
    Location:
    Canada, of course!
    I think the circuit is on a breadboard with long wires all over the place acting like antennas to pickup mains hum.
    And/or the input cable is not shielded audio cable.

    When the input is shorted then the output is normally low (or if the input offset voltage was different then it would be normally high at about 7.8V). The output should switch from 1.4V to 7.8V when there is a signal. it needs to be attenuated so its max voltage is 5V.
     
  8. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul
    First of all, here is how I am testing my circuit:
    I'm using a software oscilloscope with coaxial cables running as scopes.

    I'm using a repeating strum of low E string as my testing input recorded and played through the same computer.

    Secondly, odd stuff:
    When I connect the scope directly to the recording, the oscilloscope shows a close-to-square wave presentation of the sound.

    I can not get the proper square wave anymore, every time string is plucked i get twice the frequency (at the beginning of each strum, this could be normal and be eliminated through software)

    When there is nothing connected to the input, here is the output I get. (shifting/moving)

    When the cable from the pc is connected to the input but nothing is played through the soundcard, here is the output I get.(shifting/moving)

    What do you mean by superimposed?

    You mean Vin set to 0 on oscilloscope settings?

    Yes, the circuit is on a brand new noiseless breadboard.
    Yes, there are a lot of wires running over the breadboard, the longest is about 13cm.
    Input cable is coaxial.

    I do not understand very clearly what you mean here. Can you expand on it?
     

    Attached Files:

  9. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,445
    Likes:
    937
    Location:
    Canada, of course!
    I think the circuit oscillates without an input because the 9V battery does not have a big (1000uF) bypass capacitor to keep the voltage fairly constant.

    If the battery is brand new then the voltage is 9.0V and the max output (unloaded) from the TL074 is 7.8V. The minimum voltage is about 1.4V.

    The frequency is doubled probably because the signal exceeds the negative common-mode input voltage range of the TL074 at about 2.5V. Then the output suddently inverts. It is called opamp phase inversion and it happesns with older FET-input opamps.
     

    Attached Files:

  10. mneary

    mneary New Member

    Joined:
    Feb 27, 2007
    Messages:
    4,502
    Likes:
    67
    Location:
    California USA
    One source of feedback is the Vcc/2 supply at R6 and R7. You have a spare stage of TL074, use one of them to create a low impedance reference.
     
  11. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,445
    Likes:
    937
    Location:
    Canada, of course!
    I also don't like to see the high impedance bias circuit.
    Instead of an opamp I think R6 and R7 should be 3.3k and C8 should be 330uF.
     
  12. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul
    What's the reason for these specific values? Will the bias circuit have any filtering effect?:eek: Wouldn't just lower resistance dividers and a higher value bypass capacitor do fine? Is there a final value that I should achieve here or a ratio between the dividers and the bypass?
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,

    'agu' is referring to the 1MΩ's R6/7.
    Change them to 3K3.
    The purpose of the two equal resistors is divide the +Vsupply, so the opa's are biassed to give a 'static' output from the opa's of Vsupply/2.

    This in theory should enable the opa's outputs to swing symmetrically about Vsupply/2.

    Do you follow OK.?:)

    EDIT: If as 'agu' states the minimum voltage of the TL074 is +1.4V, this is not suitable to connect to a PIC's digital pin also
    the positive swing of +7.8V is too high for the PIC input
     
    Last edited: Jul 22, 2008
  14. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul
    Yeah, I do know that part.. I meant to ask if there is a R*C or R/C value that I am supposed to keep constant.

    For example what if i used, 2k2's and 2uF?

    And it doesn't make sense to me either how I could have VDC of output at 1.54V when I have a grounded input and I'm pulling up the signal with 4.5V...

    I'm using a 12VDC power supply regulated to 9V. here is the regulator i use. srry, dont have the LM7809 pspice model...

    I had a clean square wave before, why am i getting phase inversion now? what's a practical way to fix this problem?
     

    Attached Files:

    Last edited: Jul 22, 2008
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    I dont use Spice.:eek:

    What voltage source is driving the 7809.?
     
    Last edited: Jul 22, 2008
  16. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Is this what you asked for in the PM.?
     

    Attached Files:

  17. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul
    I guess that makes my regulator setup pretty futile...

    this setup might help me get rid of the oscillations.. (I'm guessing due to the higher number of capacitors)

    thanks eric
     
    Last edited: Jul 22, 2008
  18. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,445
    Likes:
    937
    Location:
    Canada, of course!
    The original bias divider was two 1M resistors (500k in parallel) with a 1uF filter. Its time constant was 0.5 seconds which makes it a good filter if it wasn't loaded.

    I calculated two 3.3k resistors in series which draw 1.4mA the same as an opamp and I selected 330uF as a filter cap which creates a time constant of 0.54 seconds.

    The output of the TL074 has phase inversion when its input voltage drops to less than about 2.5V because the input signal level is too high.
    Try an LM324 quad opamp (same pin numbers). It doesn't have phase inversion.
     
  19. mneary

    mneary New Member

    Joined:
    Feb 27, 2007
    Messages:
    4,502
    Likes:
    67
    Location:
    California USA
    The reason I suggested the buffered reference is that the power supply was 9V. That often means that the power source is a 9V battery, and current drain might be important.
     
  20. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,445
    Likes:
    937
    Location:
    Canada, of course!
    My suggestion of using two 3.3k resistors and a 330uf filter does the same.
     
  21. transistance

    transistance New Member

    Joined:
    Apr 3, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Istanbul
    LM324 Noise

    Is LM324 low noise though? The advantage is that this IC has no phase inversion, will there be a disadvantage when replacing it for the TL074?
     
    Last edited: Jul 23, 2008

Share This Page