Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Guitar fundamental extraction

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guitar fundamental extraction

    I thought it best to open another thread, as many people will glaze-over my other thread on PIC/Arduino and I want to focus on the analogue side of things:

    I've been experimenting with getting a workable fundamental extractor to work with my Arduino frequency to voltage converter. Everything I've tried so far produces glitches because the Arduino picks up on any frequency variations whereas when listening to the output of the many variations of fundamental extractor circuits the output sounds perfect.

    My starting point was just a simple filter and comparator to provide a square wave output. I'd used this with great success in an octave pedal and in that role it tracks well without any glitching. Feeding it into the Arduino gives a very different result, though. I moved on to the Boss OC-2 fundamental extractor, but this was no improvement. Changing the filter from 18dB to 24dB gave better results, but not good enough.

    The Craig Anderton extractor using an NE570 doesn't work either.

    Another approach I've tried is to sample the extractor frequency for a short period (30ms) and lock onto that - ignoring any further changes until the note has died completely. This gives excellent and steady output of the sampled note and is very fast, but it samples any glitching so produces wildly inaccurate notes. Of course, bends and slides are ignored, but my goal right now is to get accurate note sampling.

    Any thoughts are welcome.

  • #2
    What is different between the octave pedal and the Arduino? What is a glitch?

    Could we do away with the glitch if we considered the amplitude of the signal?

    Comment


    • #3
      The octave pedal uses a flip flop IC to generate the octave down, which is mixed with the original guitar signal. Any transient pitching errors aren't noticed due to their very short duration and the signal mix. There's a technique in using an octave pedal to reduce mis-tracking and within limits they work quite well. When I listen to the output of the fundamental extractor it sounds fine, but scoping it I see that as the string vibrates there's a shift in phasing but this doesn't affect the octave pedal at all.

      The Arduino picks up any frequency variation and because the output is feeding an oscillator and that's the only thing you're listening to, any frequency errors are really noticeable. I think the phase shifting of the signal is causing part of the problem. Another is there are some harmonics on the leading edge of the extractor output. I think that can be corrected - maybe caused by switching noise of the comparator. The Arduino picks up on the harmonics and sends the output to the DAC. A change in the opamp type in the comparator may be beneficial.

      Whilst it's too slow, the original PIC circuit tracks well and according to the description of how it works it samples the peak amplitude as well as using timers to determine the frequency. The slowness arises from the need to sample the amplitude, then again sample the signal to calculate the frequency. There's an old thread suggesting both functions could be done at once, but no further detail was given.

      The glitches are in the form of unwanted values being sent to the DAC. These can be;

      Wrongly pitched notes, especially on open strings or on notes played below the 5th fret on the bottom E string.
      Spurious high-pitched noises at the beginning of a note and especially on note decay.
      A single high-pitched note added to the end of an otherwise correct note when the string is damped to stop vibration.
      Rhythmic pitch shifting of a played note which correlates with the visual pattern of string vibration.

      I've tried sampling the note immediately when the string is plucked (at peak amplitude) and using the Arduino like a sample and hold until the note decays, but this doesn't really fix anything other than the note decay is cleaner.

      I should say that the Arduino behaves perfectly with a signal generator output. No bum notes, pips or squeaks. It all comes down to the guitar signal and how this is conditioned and processed. I think the answer lies back in the PIC code and the description that accompanies it in the magazine article. Whether this can be transferred to C++ easily is another matter.

      Comment


      • #4
        I've done a little more work on this. The leading-edge harmonics are gone (capacitor needed in opamp feedback loop) and I've identified that part of the problem is 50hz hum getting into the circuit. This is more difficult to eliminate due to the unshielded breadboard layout. I'd also like a steeper cutoff at 1kHz and if I can find a MAX7401 filter IC (8 pole) at reasonable cost that would be ideal.

        There's something going on with the Arduino note-end detection; if I comment out the relevant section so that there's no note-end process the frequency detection works a lot better (though the last note played always sounds). I think that the logic of assuming that a frequency below a certain cutoff signifies a note end is flawed and that amplitude needs to be considered. Either that, or pick detection is done outboard of the Arduino, which seems a waste of processing power.

        The PIC code detects maximum amplitude and uses this to calculate when a note ends and also when a new note is played. I don't see any reason why an analogue input could not be used for amplitude detection at the same time as the digital read for the frequency. Whether this is too slow is another matter - the default analogue read time is 100uS (10Khz), though and this effectively blocks other code operation. I understand this can be increased substantially be setting prescale values and other coding techniques.

        Comment

        Working...
        X