Shop OBEX P1 Docs P2 Docs Learn Events
How to input frequency measurements! PLEASE HELP — Parallax Forums

How to input frequency measurements! PLEASE HELP

Jeffrey MaguireJeffrey Maguire Posts: 4
edited 2007-02-25 18:55 in BASIC Stamp
I need to find a way to measure the frequency of notes played on a violin, just like an electric tuner would. Is there any way to measure frequency using using BASIC Stamp???? I've heard that a schmitt trigger can be used to square the sine wave of something, but what exactly does that mean??? Finally, if the schmitt trigger can be used, where can I find one???
- Thank you for your help!!! smile.gif

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-02-25 18:55
    Jeffrey,

    You can build your own Schmitt trigger using a comparator and a handful of passive components. Here's a schematic (untested) to get you started:

    attachment.php?attachmentid=45620

    The Schmitt triggering results from the hysteresis provided by the 2.2M feedback resistor. Combined with the 47K input resistors, you'll get about a 1% hysteresis. To increase this, thus reducing the number of logic transistions, reduce the value of the feedback resistor.

    The waveform shown below, demonstrates how the Schmitt triggering works:

    attachment.php?attachmentid=45621

    Because of the positive feedback, there are two thresholds: the lower one when the output is high; the higher one, when the output is low. This creates a dead band, inside which transistions will not cause the output to change. The width of this deadband increases as the hysteresis is increased.

    You will need to experiment with component values to ensure that only the fundamental frequency of the violin gets through, leaving the harmonic content in the dead band. An oscilloscope will come in very handy for this. You may still experience problems due to changing volume levels, since this circuit doesn't include an automatic gain control (AGC).

    Assuming you are able to "clean up" your input waveform adequately, you can then use the PBASIC COUNT command to measure the frequency.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 2/25/2007 6:59:40 PM GMT
    507 x 280 - 3K
    319 x 99 - 2K
Sign In or Register to comment.