Author Archives: evstark

Studying and Modeling Guitar Harmonics Using Fourier Analysis

My goal with this project was simply to use Fourier analysis to explore the harmonics of guitar strings. As a guitar player of nine years, I have always been aware of harmonics or “overtones” on guitar but did not always understand how they worked physically, which inspired this project.

Background

In an ideal case, each individual guitar string obeys the wave equation:

where  Given some initial condition  and  for all  at t=0, the solution of the wave equation is

where  L is the length of the string. Observe that the angular frequency in the above solution is

giving us the frequency of the nth harmonic:

In English: not only does the string vibrate as a standing wave along its whole length (the fundamental frequency), but also along half its length, a third of its length, etc. Therefore, the string vibrates with a sum of periodic functions with the respective harmonic frequencies. For each harmonic, nodes, or points of no transverse motion, exist at integer multiples of L/n along the length of the string. It may now be obvious that harmonics take their name from the harmonic series: 

Even subtle variations in these overtones can be noticeable, and ultimately determine the timbre of a sound. The harmonics created by guitar strings are what make the sound richer and more complex. In contrast, pure tones created by a single frequency tend to be grating to listen to.

 

Method

The audio samples I used for this experiment were captured using my own 1996 G&L Legacy guitar, a Fender Frontman 10 W practice amp, a MacBook Pro with GarageBand Software and the built-in microphone. I recorded very short audio samples and edited them to remove the transient “pick attack” of the note so that I was only analyzing a short clip (i.e. a small array in MATLAB) with near-constant amplitude and constant frequencies. From GarageBand I exported these clips as WAVE files in my MATLAB folder. I then imported these WAVE files into MATLAB as arrays and used the built-in fft command to perform fast Fourier transforms on the audio signals, which then allowed me to take the power spectrum and observe the frequencies present in the clip.

 

C Major Chord Analysis

The first part of my experiment involved analyzing a brief clip of my guitar playing a C major chord, by definition containing the notes C, E, and G. Fourier analysis revealed the following frequencies:

Power Spectrum Amplitude Frequency (Hz) Nearest Note
13.28 132.3 C3
9.081 165.4 E3
223.6 198.4 G3
16.71 264.6 C4
30.98 333 E4
13.28 394.7 G4
2.633 593.1 D5
6.258 663.7 E5
2.815 796 G5
46.93 996.7 B5
1.125 1186 D6
1.797 1387 F6
1.458 1592 G6
2.295 1857 A#6
0.7868 1991 B6
0.5319 2324 D7
0.6912 2657 E7

The first five frequencies on the table are the fundamental frequencies of the five notes that I played. All the frequencies higher than 333 Hz are harmonics. Some of the quietest frequencies have amplitudes that are orders of magnitude lower than those of the highest frequencies, and there may be other frequencies that could be faintly heard that I could not pick out on the frequency spectrum. Most of the frequencies did not perfectly align with the defined note frequencies at concert pitch. This could be for several reasons: my guitar may not have been perfectly in tune, my guitar’s intonation may not be perfect, and the guitar’s equal temperament (i.e. uniformly spaced frets) actually does not facilitate pitch-perfect notes. These factors are all essentially tuning issues, and I wouldn’t expect that they determine the immediately recognizable timbre of the guitar.

Original signal:
Low-Pass (fundamental frequencies):
High-Pass (harmonics):

One other possibility is that the guitar’s steel strings – not “ideal” strings without stiffness or damping – do not create the perfect theoretical harmonics. My suspicion is that this “imperfection” of the string creates slightly dissonant harmonics that make the sound more interesting to the human ear, and that this is a main contributor to the string’s timbre. Even in an ideal case, however, we could expect to see that some of the highest audible harmonics are actually notes that are not in the chord at all, and my data reflects this.

Fig.1: Clockwise from top left: The original waveform of the signal, the frequency spectrum of the signal, the waveform after low-pass filter, the waveform after high-pass filter.

Synthesized C Major Chord

To see if I could synthesize something close to my original C major signal, I used MATLAB to generate several sine waves of the corresponding frequencies and weighting them with coefficients αn. Without the weighted coefficients, the frequencies all appeared at roughly the same amplitude in the spectrum, with an average value of 2244 and maximum and minimum values of 2272 and 2041, respectively. I am not certain what caused these amplitudes, but I suspect it may have to do with interference of the waves. In any case, to get roughly the same amplitudes as the original guitar signal, I did some algebra:

where  is the unweighted amplitude of that frequency. Using MATLAB’s built-in audiowrite command, I was able to export the synthesized signal as a new WAVE file. Even though the frequency spectra look practically identical to the naked eye, the synthesized signal is not a convincing recreation of the original guitar signal. I suspect that there are even more frequencies present in the original signal that were not clearly visible in the graphical frequency spectrum but are audible to the human ear. Case in point, I was unable to spot a few of the highest frequencies listed above until I zoomed in much closer to the spectrum graph. Adding these to the synthesized signal made a significant audible difference, even though those high frequencies have amplitudes that are lower than some others by orders of magnitude in the power spectrum.

Synthesized C Major Chord:

Fig.2: Comparison of the guitar waveform and frequency spectrum (left), with synthetic waveform and frequency spectrum (right).

Natural Harmonics

In the world of guitar, there is a technique known as “playing harmonics,” which requires the player to place their finger at one of the nodes along the string, without pressing hard enough to fret the note. As a result, the string is forced to vibrate at the harmonic corresponding to the node the player touched. My goal for this section of my project was to analyze the frequency spectra of several played harmonics on the low E string of the guitar. My expectation was that the open E string would show the widest range of frequencies, while the different harmonics would only show subsets of the full range.

Harmonic E3 B3 E4 G#4 B4 E5 G#5 A#5? D6 D#6
Open (n=1) 165.4 247.0 330.8
12th fret 165.4 496.1
12th fret h (n=2) 165.4 328.5
19th fret h (n=3) 247.0
7th fret h (n=3) 247.0
5th fret h (n=4) 165.4 328.5 414.5 661.5
4th fret h (n=5) 163.2 247.0 330.8 412.3 493.9 826.9 912.9 1166 1252
9th fret h (n=5) 163.2 247.0 326.3 412.3 826.9 1255

However, there did not appear to be a clear pattern to the frequency spectra of the different harmonics. I would attribute this lack of correlation to several sources of error, particularly the quality of my recording equipment. I used a very unprofessional recording technique: using my laptop’s built-in microphone in the vicinity of my amplifier. Most professional record engineers use special recording microphones placed very close to the amplifier speaker and secured by a stand. The onboard microphone on most laptops is designed to pick up the midrange frequencies of the human voice and was not a suitable choice for this experiment (which had no budget). Look no further than the open E string spectrum, which does not even show the fundamental frequency of E2, which is 82.41 Hz.

Fig.3: The frequency spectra of several natural harmonics on the low E string.

Sources of Error and Next Steps

Other error sources include background noise coming from the amplifier, tuning and intonation discrepancies, the equal temperament of the guitar, inconsistent picking technique, and a lack of repeated trials.

Future experiments in a similar vein could include exploration of timbre on the guitar. For example, picking at a different point along the string or using a pickup in a different position both influence the timbre, which could show up in the frequency spectrum. This is partly due to the fact that the coefficient bn of each harmonic frequency is determined by the initial pluck shape :

Sources Cited

 

Share

Modeling the Potential Barrier in the Esaki Diode

Introduction

The Esaki tunnel diode is a semiconductor p-n junction that uses the phenomenon of quantum tunneling to its advantage. The junction between the two doped semiconductor materials creates a potential barrier between the valence band of the p-type material and the conduction band of the n-type material. If the potential barrier is thin enough, and depending on the bias of the junction, individual electrons can tunnel either “forward” or “backward” through the potential barrier, collectively creating a current. In fact, the tunnel diode exhibits the unique characteristic of having negative resistance at particular levels of forward bias. I have approximated this potential barrier in order to perform the sort of one-dimensional analysis we did in class. My goal is not to find accurate numerical quantities that describe a real-life Esaki diode, but rather to apply what we learned about potential barriers in class in order to demonstrate the relationship between the dimensions of a barrier and the transmission coefficient of an incident wavefunction in the context of a real device.

Background

Whereas electrons in individual atoms have discrete, quantized energy levels, electron in solids interact with each other in such a way as to form continuous “bands” of allowed energy. In semiconductors, we focus on the valence and conduction bands. At absolute zero, the states in the valence band are full, but optical or thermal excitation can excite electrons up to the conduction band – a necessary condition for the semiconductor to conduct electricity. When an electron is excited in this way, it leaves behind a corresponding “hole” – simply the absence of an electron – which can be thought of as having the electron mass with opposite charge. Together these are known as an electron-hole pair (EHP).

Semiconductors are often doped, meaning an otherwise pure semiconductor material has been injected with a small concentration of atoms that allow either for more electrons (n-type), or more holes (p-type). Every semiconductor has a fermi energy, below which almost all states are occupied, and above which nearly all states are vacant. An undoped semiconductor has fermi energy approximately halfway in between the valence and conduction bands, but n-type doping raises the fermi energy and p-type doping lowers it. The Esaki diode uses degenerate materials, which are doped so heavily that the fermi energy is outside the band gap.

When p- and n-type semiconductors are joined together, they form a junction. At equilibrium, the fermi energy must remain constant, which causes the bands of each material to bend with respect to one another by a quantity qV0, called the contact potential (times the elementary charge), over a depletion region of width W. When a bias, or voltage, is applied to the junction, the fermi energy can then have different values //on either side.

The tunnel diode is simply a p-n junction with the correct conditions for tunneling to occur. First, the contact potential is high enough that the valence band of the p-type region overlaps the conduction band of the n-type, so that an electron can tunnel through the potential barrier from one side to the either. This condition becomes hard to maintain at certain levels of forward bias – as the voltage increases and the respective valence and conduction bands move out of alignment, the tunneling becomes less likely per electron, resulting in a weaker current. Second, the materials must be degenerate to create regions of empty states. Third, the junction must have a forward or reverse bias, so that the fermi energies are unequal and thus an empty state can exist across from a filled state. Fourth, the width of the potential barrier must be narrow enough for electrons to be able to successfully tunnel from one side to the other. It is this last condition that we will be modelling.

Fig. 1: Band diagram representing Esaki diode under tunneling condition. The diode is reverse biased, allowing an electron on the p side to tunnel across to an empty state on the n side.

1-Dimensional Quantum Model

The Esaki diode’s potential barrier looks different from the barriers we’ve examined in class, in that it actually comprises two energy functions. Counterintuitive as this is, the important aspects of the barrier are its width, approximately W, and its finite height, qV0. Thus, since the “sides” of the barrier are nearly vertical when highly doped, we’ll approximate it as a simple rectangular barrier with the same dimensions. The potential on either side can simply be 0.

Fig. 2: Rectangular potential barrier representing Esaki diode barrier. This model has the same height and width as the real barrier.

An electron in this system has a wavefunction that satisfies the time-independent Schrödinger equation:

where

For the p and n regions, we can use the standard free particle solutions, assuming the electron is incident from the left:

with

.

The depletion region’s TISE can be written as

.

So the solution is given by

In order to determine the arbitrary coefficients, we must impose the boundary conditions, which state that the wavefunctions and their first derivatives must have continuity over each boundary. We get the following system of equations:

With some tedious algebra, we can solve for A in terms of F:

Now we can calculate the transmission coefficient:

Simplify and plug in original values for α and k to get expression in terms of given quantities:

This expression makes sense, because the limit as W goes to infinity is 0, and the limit as W goes to 0 is 1, meaning the electron is only likely to tunnel for small W.  Note also that as the contact potential V0 goes to infinity, T goes to 0, as we would expect from an infinite potential well. Initially, we assumed the electron was incident from the p-side, as in the reverse bias case, but the mirror symmetry of our model means that as far as the barrier is concerned, we can expect identical behavior for an electron incident from the n-side.

Fig. 3: This graph was produced in Mathematica using rough estimates for the energy values in the T equation. The numbers on the axes are not intended to represent actual quantities, and the graph merely suggests the shape of the function.

Conclusion

Although this model is very much an oversimplification of what the potential barrier in an Esaki diode actually looks like, it demonstrates the sort of behavior we would expect from the real thing, namely the behavior of the transmission coefficient with respect to the extremes of barrier width. Although the key characteristics of the tunnel diode are dependent on the doping of the two semiconductor materials, which falls outside the scope of this course, the rectangular barrier model focuses purely on the quantum mechanical process that lies at the core of this diode’s function.

Sources

Goswami, Amit. (1997). Quantum Mechanics. (2nd ed.). Waveland Press, Inc.

Griffiths, David J. (2004). Introduction to Quantum Mechanics (2nd ed.). Prentice Hall.

Streetman, Ben G., Banerjee, Sanjay Kumar. (1988). Solid State Electronic Devices (7th ed.). Pearson.

Share