<< Chapter < Page Chapter >> Page >

In theory, the process we planned to use to create a harmonizing guitar pedal is very linear and straightforward. First we lowpass filtered the output signal of the guitar, then sampled it in order to get the signal in a digital form. With the digital signal, we could then lowpass filter it even farther to get rid of some high frequency noise, this time using an FIR filter. We then took the discrete Fourier transform (DFT) of the signal, so that we could analyze the frequency content of the signal. We identified the note being played by the guitarist, calculated the harmonics of this note, if any existed in the chosen key, and added dirac deltas at the harmonic frequencies to the original guitar signal to produce the out output chord. We then took the inverse DFT of this new signal, and output the time domain version to the guitar amplifier. through this process, if the original note played on the guitar was in the correct key, the signal that actually reached the amplifier would be a chord with that note as the base, still in the original key.

The first step in the process is sampling the analog, continuous time signal produced by the guitar and converting it into a sampled discrete time digital signal that we can process on a computer. The minimum sampling rate for a signal is two times the highest frequency component of the signal. Because of this fact, before we could sample the guitar output we had to run it through a lowpass filter such that it became band limited. We planned on sampling the signal at a rate of 44.1 kH, and therefore we needed to ensure that any and all of the frequency components of the original signal above 22.5 kHz were reduced to zero by the lowpass filter. Once the filtering is done, it is trivial matter of running the signal through an analog to digital converter (ADC) which samples at the rate we desire, 44.1 kHz. The output of the ADC can then be sent directly into our computer for processing. In our actual procedure, we used a device that did both the filtering and ADC sampling for us, as discussed below.

Once we have the digital signal in our computer, we begin to do the actual signal processing. FIrst, we once again low pass filter a copy of signal, this time at a lower frequency, for example 8 kHz, simply so that we could do our signal processing without worrying about high frequency noise. We retain the original guitar signal so that when we alter the output we can add our harmonic tones to the original signal. Then, if the magnitude of the input at the current time suggests that a note has just been played, we begin our frequency domain processing. We begin by using the fast fourier transform algorithm (FFT) to compute the DFT coefficients of our signal. It’s important that we choose a fairly short (~1/20th of a second) sample length from the signal to compute the DFT, as we only want one note to be present in the output of the guitar during the period of the output that we are analyzing. Once we have obtained the frequency domain representation of our input signal, we find the frequency component with the largest magnitude. We identify this frequency as the note which the guitar player played. Given this note and the key in which the guitarist is playing, we are able to calculate the correct harmonic frequencies, if there are any, as discussed above. We then increase the magnitudes of these harmonic frequencies to a magnitude similar to that of the core, “note” frequency. This gives us the frequency representation of our output signal. Finally, we take the inverse FFT of this signal. This gives us the time domain representation of our final output, which we then pass through a digital to analog converter (DAC) and on to our amplifier, which produces the signal as if it had come straight from the guitar. This process sounds very simple and straightforward in theory. However, in our actual implementation we ran into several problems and complications which showcase the difference between the theory and reality of digital signal processing.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2015. OpenStax CNX. Jan 04, 2016 Download for free at https://legacy.cnx.org/content/col11950/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2015' conversation and receive update notifications?

Ask