frequency ranges and frequency …itll.colorado.edu/modular_experiments_dir/itll_modules... · web...

21
Updated 09-30-08 Guitar Signal Analysis Materials and Equipment 1-Fender Practice Amplifier Blue National Instruments GPIB Adapter 1-Guitar 1-Korg Guitar tuner 1-¼” to ¼” male phone jack cable 2-BNC to ¼” male phone jack cable 1-BNC to BNC cable A. Intro to the LabVIEW Function Generator 1. This lab utilizes the function generator capabilities of the LabVIEW software to create a signal. Several types of signals are sent to a guitar amplifier, and the differences in the sound of the signals are analyzed. 2. Go to Guitar Signal Analysis folder in the Module folder on the desktop and open the program titled Spectrum Analyzer Filter, and then click on Spectrum Analyzer Filter.vi . A LabVIEW interface which controls the function generator of LabVIEW opens. 3. To send the signals from the function generator to the guitar amplifier, connect the output of DAC0 on the lab station (BNC connector) to the ¼” phone jack (connector) on the outside of the guitar-amplifier box labeled Attenuator. WARNING: Throughout this lab, be very aware of whether the Attenuator jack or the Input 1 jack (on the inside of the amplifier box) should be utilized. INCORRECTLY BYPASSING THE ATTENUATOR MAY DAMAGE THE AMPLIFIER. The ¼” phone jack on the outside of the guitar-amplifier box is connected to an attenuator which protects the amplifier from excessively- large signals. 4. Make sure that the volume control on the amp is turned to 0 . The volume will be adjusted later in the lab. 1 of 21

Upload: leque

Post on 23-May-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Updated 09-30-08

Guitar Signal AnalysisMaterials and Equipment

1-Fender Practice Amplifier Blue National Instruments GPIB Adapter 1-Guitar 1-Korg Guitar tuner 1-¼” to ¼” male phone jack cable 2-BNC to ¼” male phone jack cable 1-BNC to BNC cable

A. Intro to the LabVIEW Function Generator1. This lab utilizes the function generator capabilities of the LabVIEW software to create a

signal. Several types of signals are sent to a guitar amplifier, and the differences in the sound of the signals are analyzed.

2. Go to Guitar Signal Analysis folder in the Module folder on the desktop and open the program titled Spectrum Analyzer Filter, and then click on Spectrum Analyzer Filter.vi. A LabVIEW interface which controls the function generator of LabVIEW opens.

3. To send the signals from the function generator to the guitar amplifier, connect the output of DAC0 on the lab station (BNC connector) to the ¼” phone jack (connector) on the outside of the guitar-amplifier box labeled Attenuator.

WARNING: Throughout this lab, be very aware of whether the Attenuator jack or the Input 1 jack (on the inside of the amplifier box) should be utilized. INCORRECTLY BYPASSING THE ATTENUATOR MAY DAMAGE THE AMPLIFIER. The ¼” phone jack on the outside of the guitar-amplifier box is connected to an attenuator which protects the amplifier from excessively-large signals.

4. Make sure that the volume control on the amp is turned to 0. The volume will be adjusted later in the lab.

1 of 17

Updated 09-30-08

5. If using this module in one of the ITLL plazas, headphones should be used to listen to the different signals rather than the speaker of the guitar amplifier. Plug in the headphone amplifier (HeadAMP), Figure 1, to a power outlet on the lab station. Using a cable with two ¼” male phone jacks, connect the Stereo Input port of the HeadAMP to the HEADPHONES jack of the guitar amplifier (the far right jack). Plug in enough headphones into the HeadAMP for all group members to listen to the audio output of guitar amplifier.

Figure 1. Headphone Amplifier

6. Turn on the guitar amp using the power switch on the far right.

Figure 2: Guitar Signal Analysis Labview VI

2 of 17

Updated 09-30-08

7. Run the LabVIEW program by selecting the run arrow, , in the upper left of the LabVIEW screen. The function generator should start and two graphs that look similar to Figure 2 should be apparent.

8. Take a moment to make sure the two graphs in the LabVIEW screen are understood.

a. The bottom graph, Signal, is simply the signal sent to the guitar amplifier plotted against time. In this case, the signal is a sine function with frequency of 200 Hz and amplitude of 0.1 Vpp (Volts peak-to-peak).

b. The top graph, Magnitude, is a spectrum. A spectrum is found by calculating the Discrete Fourier Transform (DFT) of the original signal (bottom graph). The DFT finds the amplitude of each frequency component contained in a signal. As will be illustrated later in this lab, any waveform other than a sine wave is comprised of multiple sine waves at different frequencies. The amplitudes of the different frequencies comprising the time-domain signal are plotted again frequency in a spectrum plot, and because a sine wave has only one frequency, only the 200 Hz frequency with amplitude of 0.05 V is seen on the top plot.

9. Now SLOWLY turn up the volume knob on the guitar amp. It is not necessary to turn the volume past 1.

10. There is a box labeled Waveform Control in the upper left corner of the LabVIEW interface. There are two items within this box labeled Signal Type and Frequency (Hz). Run each of the first 5 waves (Sine Wave, Triangle Wave, Square Wave, Sawtooth Wave, White Noise) and observe what frequencies and amplitudes make up their signals.

a. Note how each waveform generates a different sound or timbre. Think of timbre as your ear’s ability to detect quality or texture within sound. Often times, musicians describe sounds with a lot of high frequency content, such as cymbal crashes, as being “bright”. On the other hand, they might describe sounds with no high frequency content as being “dark.” This is an example of the importance of timbre in music. Human ears are very sensitive listening devices, and can pick up small differences within complex waveforms.

b. Observe the differences in sound between the different signals and try to correlate the timbre with the frequency content of each signal.

Question 1)

How is the timbre of the square wave different from that of the sine wave? How does the FFT reflect this?

3 of 17

Updated 09-30-08

B. Fourier Series of a Square WaveAs mentioned previously, any waveform other than a sine wave consists of multiple sine waves at differing frequencies. The series of sinusoids making up any signal is known as the Fourier Series. The lowest frequency of the series comprising a signal is known as the fundamental frequency. Higher frequencies that are integer multiples of the fundamental frequency are known as a harmonics. Each harmonic is named by the integer multiple of its frequency relative to the fundamental. An example of this is the 5th harmonic, whose frequency is five times that of the fundamental.

A square wave is made up of infinite sine waves and is determined by the following equation:

(1)

where:A0 = amplitude of square waven = harmonic designation (i.e. 3 for 3nd harmonic)f= fundamental frequencyt = time

1. Now select the square wave on the waveform control. This will create a 200 Hz square wave with amplitude of 0.1 Vpp.

2. Find and record the fundamental and first nine harmonic frequencies of this wave and their corresponding amplitudes using the graph palette in Figure 3 to zoom in on the peaks of each harmonic. Remember that each harmonic is a multiple of the fundamental frequency.

Figure 3: Graph Palette

Question 2)

Calculate the amplitudes of the fundamental and the first nine harmonics using Equation 1. Compare the measured amplitudes from the spectrum plot to the mathematically predicted amplitudes.

3. Try to recreate this square wave knowing the fundamental frequency and the first nine harmonics. Go to the Multi Tone Generator in the Waveform Control box. Two arrays appear below the Signal graph, Figure 4. The first array is Tone Amplitudes; the second is Tone Frequencies. Enter in the values for each of the 10 frequencies AS THE VI IS RUNNING and listen to the sound change as the waveform is built.

4 of 17

Updated 09-30-08

4. Hit the Print Screen button to capture the waveform image after entering all nine frequencies. Paste and save the screen capture into a Word document for future reference.

Figure 4: Multi Tone Generator

C. Software Signal FiltersWe have included a software based signal filtering device below the Waveform Control box. The filter has four options: No Filter, Band Stop, High Pass, and Low Pass. The Band Stop filter works by eliminating all frequencies within a small frequency range below and above the frequency value selected. The Low Pass filter attenuates any frequencies above the selected value, and the High Pass filter attenuates any frequencies below the selected value. For now, the Order of the filters should be kept at 4, and the order of a filter will be further explained later in the lab.

1. Switch back to creating a 200 Hz square wave. Remove the fundamental frequency using the band stop filter and save a screen capture of the time- and frequency-domain plots.

Question 3)

What effect does a band stop filter at 200 Hz have on the spectrum? What effect does the filter have on the sound coming from the guitar amp?

5 of 17

Updated 09-30-08

2. Use the low pass filter at a setting of 2000 Hz. This will attenuate every harmonic above the 10th. Perform a screen capture. Note that this wave does not look exactly like the one created in part B. This is due to the fact that a low pass filter only attenuates the frequencies above its cutoff frequency, whereas the square wave built with 10 frequencies has no frequency content above 2000 Hz. Also, the low pass filter affects the phase of the harmonic frequencies with respect to the fundamental frequency of the square wave, thereby altering the appearance of the time-domain signal.

Question 4)

What effect does the LPF have on the frequency- and time-domain plots? What effect does the LPF have on the sound output from the guitar amp? Why?

3. Use the low pass filter to convert the square wave into a sinusoid and save a screen capture of the two plots.

Question 5)

To what frequency should the low pass filter be set in order to achieve the purest sinusoid?

4. Filters can be expressed using differential equations, and different orders of filters will change the effectiveness of the filter. For a high pass filter, a higher-order filter better attenuates frequencies below the selected frequency (the “cutoff” frequency). Vary the order of the LPF filter from a 4th order system to a 1st order system.

Question 6)

What is the difference between the 1st order and 4th order LPF?

D. RC Circuit FilterA simple 1st order filter (similar to the software filters from the above exercises) can be made using a basic resistor-capacitor (RC) circuit. A one-degree-of-freedom, first-order system is governed by the first-order ordinary differential equation:

6 of 17

Updated 09-30-08

(2)

where y(t) is the response of the system (the output) to some forcing function F(t) (the input). Eq. (2) may be rewritten as:

(3)

where τ = a1/a0 has the dimension of time and is the time constant for the system and k =

1/a0 is the gain.

Response of a First-order System to a Step Input

Consider a first-order system subjected to a constant force applied instantaneously at the initial time t = 0

(4)

The initial condition is y(0) = 0. The solution to Eq. (3) with the step input Eq. (4) is then

(5)

The response approaches the final value y∞= kA exponentially. Eq. (5) then may be rewritten as:

(6)

The rate at which the response approaches the final value is determined by the time constant. When t = τ, y has reached 63.2% of its final value as illustrated in Figure 5. When t = 5τ, y has reached 99.3% of its final value, and the response is referred to as being at steady state.

The time constant of a system can be determined from the measured response using a linear regression. Taking the natural log of both sides of Eq. (6) yields:

(7)

The slope, s, of the natural log term plotted against t gives the time constant τ through the relationship s = -1/τ..

7 of 17

Updated 09-30-08

Figure 5: Response of a First-Order System to a Step Input

Transient Response of a Resistor-Capacitor Circuit

Figure 6: Low-Pass-Filter Circuit

Resistor-capacitor circuits are also first-order systems. Consider the circuit diagram shown in Figure 6. The voltage drop across the resistor is:

(8)

The current through the capacitor is:

(9)

When Eq. (9) is substituted into Eq. (8) and expressed in the form of Eq. (3), the equations yield:

8 of 17

Updated 09-30-08

(10)

The time constant is τ = RC . If V in is a step-input function of amplitude V∞

then the output voltage will be given by Eq. (6).

Consider a first-order system subjected to a sinusoidal force of the form:

(11)

where Ain is the amplitude and ω is the angular frequency of the input. The general solution of Eq. (11) is given by

(12)

The first term of Eq. (12) is a transient decay. Aout(ω) is the amplitude

(13)

When signal goes through the stop band of an RC circuit, we introduce a phase change, meaning there is a time delay between the input signal and the output signal. In the same way that a mass on a spring has a delayed motion relative to its forcing function, the signal output of a filter circuit lags behind the voltage input. This distance is measured using an angular measure called a phase angle, the term φ(ω) from Eq. 12:

(14)

Decibel notation is commonly used to indicate amplitude ratios over a wide range. One notable example is the sense of hearing, which is sensitive to sound pressures over many orders of magnitude. The amplitude in decibels is defined as

(25)

For example, one signal twice the amplitude of another is +6 dB relative to it. A signal 10 times as large is +20 dB; a signal 100 times as large is +40 dB; a signal one tenth as large is -20 dB.

The performance of an electronic filter is often specified by the cut-off frequency (or break frequency) and the attenuation in dB per decade (the amplitude ratio decrease in dB for each factor of ten change in frequency) or in dB per octave (the amplitude ratio decrease in dB for each factor of 2 change in frequency). The simplest passive RC circuit filter has an attenuation of 6 dB per octave. More sophisticated active electronic filters may have a much more rapid drop-off such as an attenuation of 24 dB per octave or more.

9 of 17

Updated 09-30-08

An octave denotes the interval between two frequencies with a ratio of 2 to 1. Starting from a fundamental frequency, one octave higher is twice the frequency; one octave lower is half that frequency. The interval in octaves between any two frequencies is the logarithm (base

2) of the frequency ratio.

Equipment

1-Variable-Resistor-Capacitor Box

1-BNC cable, 2 T connector, 2 banana-BNC cables, 4 single banana cables, 1 BNC to ¼ inch guitar cable

1. Remove all cables and wires from the LabStation and the Variable-Resistor-Capacitor box (combination of small aluminum boxes with variable switches found in module cart).

2. With banana plug cables, build the circuit shown in Figure 6 with resistance and capacitance values of 15 kΩ and 0.01 μF. Using a T connector and banana-BNC cables, connect the function generator (FG) as the voltage source of the circuit, and also connect the FG signal to channel 1 of the oscilloscope with a coaxial cable. Remember that the negative side of the banana plug is marked with an “ear”. The output of the circuit should be connected to channel 2 on the oscilloscope with banana plug cables and a banana-BNC plug adapter.

3. Set the FG to produce a 0.1 Vpp, 100 Hz square wave. Press the Auto-Scale button on the oscilloscope. Both the input and the circuit response should be illustrated on the oscilloscope. If one (or both) of the signals is not apparent, check to be sure that the circuit has been wired with the correct polarity or try using another cable.

4. Set the volume of the guitar amplifier to 0.

5. Attach the output of the circuit to Input 1 on the amplifier inside the box using a BNC to ¼ inch guitar cable and a T connector. NOTE: You must bypass the attenuator on the box by plugging the signal cable directly into Input 1 on the guitar amp. Turn on the amplifier and turn up the volume to a reasonable level.

6. Use the cursors on the scope to measure the time constant of the output signal (the time required for the response to reach 63.2% of the final value). To do this, press the Cursors button on the oscilloscope; if the cursors are linked, press Select to unlink the cursors. Make sure you are manipulating the Channel 2 cursors by hitting the 2 button. Use the Multipurpose A and Multipurpose B buttons to move the cursors to various places on the waveform.

7. Change the resistance value on the variable resistor and repeat steps 7 and 8. Listen to the change in sound each resistance value produces. Repeat step 7 and 8 for a variety of

10 of 17

Updated 09-30-08

resistance and capacitance values. Be sure to take multiple samples for each RC circuit to be able to do the uncertainty analysis.

Question 7)

What are the theoretical time constants for each RC circuit? What were your measured values? Is the discrepancy between measured and predicted values within experimental uncertainty for +/-3% accuracy resistors and +/- 5% accuracy capacitors?

E. Frequency Response of the Fender Preamp

The frequency response of a system is a comparison of the output of the system (e.g., a speaker) to the input of the system. In the case of the speaker, signals with certain frequencies and amplitudes are sent to the speaker as the input to the system, and the amplitude and frequency of the sound generated by the speaker is the output. Most systems (like a speaker) only have a linear frequency response (i.e., the output is exactly the same as, or constant multiple of, the input) within a certain frequency range. Most speakers will attenuate high frequency inputs because of the dynamic limitations of the speaker components, and amplifiers often have tone controls which manipulate the frequency response of the input signal in order to achieve a desire output sound. The frequency response characteristics of the Fender pre-amplifier (not the speaker) will be explored in the section.

1. Disassemble and remove all wires/cables from previous section.

2. Using a short banana-connector cable, connect the (-) terminal of ACH1 to AIGND to create an absolute ground for ACH1 as shown in Figure 7.

11 of 17

Updated 09-30-08

Figure 7. Banana-Connector Cable Creating an Absolute Ground for ACH1

3. Connect the DAC0 output to the ACH1 input on the lab station panel with a short coaxial cable.

4. Now select Guitar Amp Frequency Response under signal type.

5. Press Run Test. The software will send a sine-sweep signal (a sine wave that varies in frequency from 100 Hz to 10,000 Hz) with a constant amplitude (1 Vpp) out the DAC0 output and though the system, in this case the cable, which is then read by the ACH1 input. Note that the frequency response of the cable is roughly flat (see Figure 8) and equal to one meaning that the signal coming into the cable is very close to the signal coming out of the cable. Note: It may be necessary to ignore the first and the last data points because of data acquisition errors.

12 of 17

Updated 09-30-08

Figure 8. Frequency Response of a Coaxial Cable

6. Now connect DAC0 to the to the Attenuator ¼” phone jack on the outside of the guitar-amplifier box. Make sure that the cable coming out of the attenuator is plugged into Input 1 on the guitar amp. Also, connect the pre-amplifier output of the guitar amplifier (labeled PREAMP OUT on the amplifier) to ACH1. This configuration is used to determine the frequency response of the pre-amplifier.

7. Turn the volume to 5 (or slightly less) on the front of the amp.

8. Close the lid of the soundproof enclosure in order to reduce the distraction to others in the lab; headphones may be necessary in order to reduce the annoyance to others.

9. Set the CONTOUR on the amp to 0 and press Run Test. You will hear the sine-sweep signal as it goes through the amp.

a. WARNING: The data points at the very beginning of the test (low frequency) and the very end of the test (high frequency) may be erroneous data points. These erroneous data points should be very apparent and easy to disregard in the Excel file that is created to store the data.

b. Save the frequency-domain data to an Excel file by labeling the file an .xls file extension. You will be able to look at the frequency data later and plot it in Excel.

10. Repeat Step 8 for each of the following contour settings: 0, 2, 4, 6, 8, and 10, saving data each time.

13 of 17

Updated 09-30-08

11. Remove the cable from the PREAMP OUT plug of the guitar amplifier. If the cable is not removed, an unstable system could result, depending on the VI settings.

12. Turn the volume of the guitar amplifier to 0.

Question 8)

What effect does the contour control have on the frequency response of the amp? What does this translate to in terms of guitar tone? Of the four major types of filter (low pass, high pass, band pass, band stop), which type of filter is the contour control?

F. Guitar Input

In this section, the frequency content of guitar notes is analyzed.

1. Be sure the cable from the PREAMP OUT plug of the guitar amplifier is removed from the guitar amplifier.

2. Tune the guitar by using the Korg tuner provided with the lab. Plug the guitar into the tuner input using the ¼” phone jack to ¼” phone jack cable.

a. There are 6 strings on a guitar. String 1 is the thinnest and the sizes of the strings chronologically increase until you reach string 6, the fattest. Table 1 describes the guitar strings and their corresponding notes when each string is allowed to vibrate freely.

Table 1: Notes of Basic Six-String Guitar

String Note

6 (fattest) E

5 A

4 D

3 G

2 B

1 (thinnest) E

14 of 17

Updated 09-30-08

b. Tune each string by plucking the string without touching the frets using either the pick or your finger. Adjust the knobs on the guitar head for each string until a green light registers on the Korg, as shown in Figure 9 below. The red lights on the side indicate whether you are sharp (slightly higher frequency) or flat (slightly lower frequency). Be sure to turn the tuner off after tuning all six strings.

Figure 9. Korg Tuner

3. After tuning the guitar, hook up the guitar so that it can be read in LabVIEW using a ¼” jack-BNC cable. Plug a ¼” jack into the guitar and plug the output jack (BNC) into ACH1 on the Lab Station panel. The BNC-to-¼” cable from DAC0 to Attenuator on the outside of the guitar-amplifier box should still be connected. Finally, connect a banana cable from the ACH1- terminal to one of the AIGND terminals. This will properly ground the guitar.

4. Be sure the volume of the guitar amplifier is set close to 1.

5. Set your waveform control to Guitar Input.

6. Play an A by plucking the 5th string without touching any of the frets. This note should correspond to a fundamental frequency of 110 Hz which should be evident in the spectrum plot on the VI screen.

Question 9)

Record what differences you see as the note fades out. Does it look more or less like a sine wave as time passes? How does the sound change as a result of this?

15 of 17

Updated 09-30-08

a. If the string is plucked too hard, the Clip! indicator may become lit. Clipping occurs when the signal generated by the guitar has too high of an amplitude compared to the allowable range of the data-acquisition hardware. When clipping occurs, the time-domain signal will likely show a sine wave with the curved higher-amplitude portions cut off and made flat (somewhat similar to a square wave).

b. The allowable range of the data-acquisition hardware can be adjusted with the Signal Limit dial above the Clip! indicator. Reduce the signal limit to 0.1. The time-domain waveform should become more truncated (look more like a square wave).

c. Change the Signal Limit to lower and higher values and watch the effect this setting has on the time- and frequency-domain plots.

Question 10)

Record what differences you see in the spectrum as the signal limit is decreased, i.e., when more clipping occurs. How can this phenomenon be correlated, or explained, by what has been learned previously in this lab?

7. Freeze the spectrum plot when playing an A note with the Signal Limit at 0.2 using the Capture Data button shortly after plucking the string. Record the corresponding frequencies and amplitudes for the fundamental frequency of the A note and first nine harmonics.

8. Recreate this note using the multi-tone generator from part B. Enter the multi-tone generator values AS THE VI IS RUNNING, as in part B. Switch back and forth between the recreated note and the guitar input to compare tones.

Question 11)

How close did the replicated sound using the multi tone generator come to the original guitar sound? Explain the difference (if any) in the tones.

9. Try removing harmonics from the simulated wave and observe the difference made to the tone.

16 of 17

Updated 09-30-08

10. Now try playing different notes and chords and observe the spectrum of the notes. If no one knows how to play the guitar, please see Darren McSweeney (ITLL 2B60A), and he will gladly play a few notes/songs.

17 of 17