Wondering how to get frequency directly from guitar pickups

Thread Starter

hiptip

Joined Jan 7, 2021
13
I can show you how to do this but before we go down this rabbit hole it would be helpful if you tell us exactly what you are trying to achieve.
I have a hexaphonic pickup. Each string has its own ouput. I'm trying to stream the signal from each string to my computer where i can then do some basic signal processing to get the fundamental frequency from each of the 6 strings
 

Thread Starter

hiptip

Joined Jan 7, 2021
13
The signal from a guitar pickup is not very large, so you probably will need a preamp of some kind. After that, here are two common paths -

1. a frequency-to-voltage converter that converts the input signal frequency to a proportional output voltage, followed by an A/D converter.

2. digitize the signal into a stream of digital data with a high-speed A/D, and then analyze the data in software to extract the fundamental frequency information.

Neither of these is a beginner's project.

ak
I definitely think I wanna go with the 2nd option, though I'm confused about one thing. Should there be some conversion happening since I'm going to get negative values from the pickups?
 

Papabravo

Joined Feb 24, 2006
21,227
I'd say 6,000 would be sufficient
That sampling rate would be sufficient to capture the audio range from 20 Hz. to 3 kHz. which is adequate for the human voice but would seriously degrade the upper registers of a typical guitar. Anything from the guitar in the range 3kHz. to 20 kHz. would be aliased back into the base band digital signal. To prevent that your pre-amplifier would need an analog lowpass filter to eliminate those high frequency components.
 

Thread Starter

hiptip

Joined Jan 7, 2021
13
That sampling rate would be sufficient to capture the audio range from 20 Hz. to 3 kHz. which is adequate for the human voice but would seriously degrade the upper registers of a typical guitar. Anything from the guitar in the range 3kHz. to 20 kHz. would be aliased back into the base band digital signal. To prevent that your pre-amplifier would need an analog lowpass filter to eliminate those high frequency components.
In terms of the signal coming from the pickups, it's also my understanding that it is AC. I don't believe that's compatible with the arduino's A/D converter. Any advice on how to handle that? Should i ditch the Arduino and work with something else? A side note is that I don't much care for the quality of the audio I end up with from the guitar -- only care about the fundamental frequencies
 

MrChips

Joined Oct 2, 2009
30,823
I have a hexaphonic pickup. Each string has its own ouput. I'm trying to stream the signal from each string to my computer where i can then do some basic signal processing to get the fundamental frequency from each of the 6 strings
Here are the signal processing basics you will require for each channel:

1) Low noise preamp
2) Anti-aliasing filter
3) ADC - the critical parameters are number of bits, noise, resolution, sampling rate
4) Sampling clock
5) Interface to PC

Each item above has to be considered on its own since they all have significant impact on the entire process and the results.

4) I will begin with the sampling rate. The commonly recognized frequency range for hifi audio is 20Hz to 20kHz. Some people claim that they can hear above 20kHz. There is a reason why a standard sampling rate is 44.1kHz which I shall not get into here.

The highest note on the guitar is about 1000Hz. In order to capture the timber of the instrument you should extend the frequency range to at least one order of magnitude, i.e. 10kHz. If the goal is to capture the fundamental frequency then going to 2kHz will suffice. This suggests that your sampling rate should be a minimum of about 4kHz. This is dictated by the Nyquist Theorem.

Once a sampling frequency is selected you need to pay attention to clock jitter. This is equally important as ADC noise and resolution since any jitter in the clock will show up as noise. Suffice to say that you will require a quartz crystal oscillator.

Edit: PB beat me to it.
 

MrChips

Joined Oct 2, 2009
30,823
In terms of the signal coming from the pickups, it's also my understanding that it is AC. I don't believe that's compatible with the arduino's A/D converter. Any advice on how to handle that? Should i ditch the Arduino and work with something else? A side note is that I don't much care for the quality of the audio I end up with from the guitar -- only care about the fundamental frequencies
You can ignore DC vs AC.
Audio recordings are usually AC, in other words, the DC component (sub 1Hz) has been removed.
The ADC will be able to digitize AC.
 

Thread Starter

hiptip

Joined Jan 7, 2021
13
Here are the signal processing basics you will require for each channel:

1) Low noise preamp
2) Anti-aliasing filter
3) ADC - the critical parameters are number of bits, noise, resolution, sampling rate
4) Sampling clock
5) Interface to PC

Each item above has to be considered on its own since they all have significant impact on the entire process and the results.

4) I will begin with the sampling rate. The commonly recognized frequency range for hifi audio is 20Hz to 20kHz. Some people claim that they can hear above 20kHz. There is a reason why a standard sampling rate is 44.1kHz which I shall not get into here.

The highest note on the guitar is about 1000Hz. In order to capture the timber of the instrument you should extend the frequency range to at least one order of magnitude, i.e. 10kHz. If the goal is to capture the fundamental frequency then going to 2kHz will suffice. This suggests that your sampling rate should be a minimum of about 4kHz. This is dictated by the Nyquist Theorem.

Once a sampling frequency is selected you need to pay attention to clock jitter. This is equally important as ADC noise and resolution since any jitter in the clock will show up as noise. Suffice to say that you will require a quartz crystal oscillator.

Edit: PB beat me to it.
This is extremely helpful, thanks for taking the time to type this up I really appreciate it. My only final questions will be these:

1. Does the method you laid out above account for the fact that the signal will be AC and the Arduino doesn't accept negative values? Just seeing now that you just answered this question

2. Is there another board other than the Arduino that I should be using to be better suited for my needs?

Thanks again
 

MrChips

Joined Oct 2, 2009
30,823
This is extremely helpful, thanks for taking the time to type this up I really appreciate it. My only final questions will be these:

1. Does the method you laid out above account for the fact that the signal will be AC and the Arduino doesn't accept negative values?

2. Is there another board other than the Arduino that I should be using to be better suited for my needs?

Thanks again
In engineering the best tool is the one that gets the job done.
Choose any board that works for you. You don't have to use Arduino.

As I already said, DC vs AC, positive vs negative is not an issue for an ADC. The signal can be shifted by any DC voltage required.

Here are the basic hardware components that you will need:

6 channel preamp -> 6 channel low pass filter -> 6 channel ADC -> USB interface

Here is an alternative processing chain whereby an MCU is used to detect the frequency of the note:

6 channel preamp -> 6 channel low pass filter -> 6 channel ADC -> MCU -> USB interface
 

Papabravo

Joined Feb 24, 2006
21,227
In terms of the signal coming from the pickups, it's also my understanding that it is AC. I don't believe that's compatible with the arduino's A/D converter. Any advice on how to handle that? Should i ditch the Arduino and work with something else? A side note is that I don't much care for the quality of the audio I end up with from the guitar -- only care about the fundamental frequencies
An A/D converter is just fine with an AC signal as long as the range is limited. You can add a DC offset, gain, and filter as required before presenting the result to the A/D input.
 
Top