ELEC 243 Lab

Experiment 8.3

The Frequency Content of Signals

There are two approaches to improving the SNR by filtering: we could use a filter which rejects the noise and passes the signal (hopefully with minimum distortion), or we could design a filter to pass the desired signal while rejecting as much noise as possible. Before we do either, we need to examine the characteristics of both the signal and the noise.

Part 1: A Microphone Mixer

We are going to try out some of our spectrum and filtering ideas by using the emitter-detector pair we built last week as a miniature communication system. Since sine waves are useful for testing, but boring to listen to, we will try to make things somewhat more interesting by tramsmitting speech signals, as well as sine waves, over our system. To allow us to do both conveniently, we will build a microphone mixer using the circuit we developed last week.


Construction:

Using the same resistor values you utilized in Part 2 of Experiment 5.2, wire the following circuit. If possible, place it directly to the left of the LED driver.
\includegraphics[scale=0.500000]{ckt6.3.2.ps}


Testing:

Connect the function generator to J1-3 and plug the dynamic microphone into J1-4. A 1 V p-p input from the function generator and normal speech into the microphone should result in 1 V p-p signals at $v_{mix}$ .

Part 2: A Spectrogram VI

The spectrogram is an ideal tool for examining the frequency domain characteristics of our signals. Before we use it in earnest, let's practice on a few signals we already know the spectrum of.


Construction:

All the circuits we need for this Experiment have already been built, so there's really nothing to construct. All we have to do is interconnect the modules we already have, apply the proper inputs, and make the necessary observations

Our first arrangement looks like this:

\includegraphics[scale=0.500000]{ckt9.2.0.ps}

where $v_{in}$ is one of the various input sources we will be examining.

Testing:

Set the function generator to produce a 1 V p-p, 500 Hz sine wave and connect its output to $v_{in}$ . Load and run the "Spectrum" VI. You should see a sine wave displayed in the upper window and a bunch of spikes in the lower one. Although we would expect to see just a single spike at 500 Hz, because the function generator's sine waves are somewhat distorted, there are additional harmonics at multiples of 500 Hz.

A Better Sine Wave:

Producing an accurate sine waveform with analog circuitry turns out to be very difficult, while producing one digitally is almost trivial: just compute the appropriate values with the sin() function and send them to the D/A converter. The Spectrum VI contains the code to do this and produces the output on D/A channel 0. The frequency of this sine wave is controlled by the slider labeled Frequency.

Disconnect the function generator from $v_{in}$ and connect D/A channel 0. Observe the resulting spectrum. Is there any noticable harmonic content? If so, how does it compare to the function generator?

Part 3: Aliasing

Some of the funny stuff we saw on the spectrum of the function generator output is due to aliasing. In Lab 3 we mentioned that the sampling rate for A/D conversion had to be sufficiently high to accommodate any lack of smoothness in the input signal. A more accurate statement is that the sampling rate has to be high enough to accommodate the frequency content of the signal. Specifically, the sampling rate must be at least twice the highest frequency present in the signal or aliasing will occur.


A Demonstration of Aliasing:

Reconnect the function generator output to $v_{in}$ and set it to the 100 kHz range with sine wave output. Turn the FREQUENCY control fully counterclockwise. Restart the Spectrum VI and press the Full Range button. Slowly increase the function generator frequency and observe the main peak in the spectrum (i.e. the fundamental, try to ignore the harmonics). Its frequency should be the same as that of the function generator until it reaches 50 kHz. Since the sampling rate of this VI (and all of the VIs we will be using) is 100 kHz, 50 kHz is the magic number (half the sampling frequency) which represents the limit of reliable A/D conversion. As you continue to increase the frequency you should observe that rather than simply disappearing, the signal reappears at a lower frequency, called an alias. Since there are a lot of frequencies above 50 kHz, there is the potential for a lot of contamination from aliases of these frequencies if we don't filter them out before digitizing the analog signal. Continue increasing the function generator frequency until you reach the upper end of the range, making observations as appropriate.

Question 3:

Based on your observations, derive a formula for the aliased frequency of a sine wave as a function of its actual frequency and the sampling rate.

An Anti-Aliasing Filter:

To prevent aliasing, we can use an anti-aliasing filter between the analog signal and the D/A converter input. Rewire the connection to the Spectrum Display to incorporate a low-pass filter as shown below:
\includegraphics[scale=0.500000]{ckt9.2.1.ps}

Repeat the above measurement and note the difference in behavior. As filters go, this is not a very good one, so it does not completely eliminate aliasing. However, it does make a significant improvement so we will incorporate it into subsequent steps.

Part 4: Signal and Noise Spectra

Now that we've cleaned up the spectrum display a bit, let's look again at the spectra of some familiar signals.


Function Generator Signals:

Turn off the Full Range function of the VI. Connect the function generator output to $v_{in}$ . Produce a 1 kHz sine wave and note that there are still plenty of harmonics. Switch to triangle and square waves (which are supposed to have significant harmonics) and note how the spectrum changes.

Speech:

Plug a dynamic microphone into J1-4 and connect the output of the microphone mixer ($v_{mix}$ ) to $v_{in}$ . Speak into the microphone and observe the spectrum. Try different vowel sounds and different pitches and observe the resulting changes in the spectrum. If you have a musical instrument with you, play a few notes. If not, whistle a few notes and observe the spectrum.

Buzz from Ambient Light:

Disconnect $v_{mix}$ from $v_{in}$ and connect the output of the photodiode amplifier ($v_{photo2}$ ). Compare the spectra of the ceiling lights, the under-shelf flourescent lamp, and the incandescent lamp.

Part 5: Optical Communications, Take 2

Having seen the spectra of a number of different signals we will now mix them together in the same system to see if we can separate them by filtering. The system we will use is a miniature optical communication system based on the emitter-detector pair that we built last week.


Construction:

Assemble the system shown below by connecting the microphone mixer output ($v_{mix}$ ) to the LED driver input ($v_{drive}$ ), and the photodiode amplifier output ($v_{photo2}$ ) to the anti-aliasing filter input. Since we want to be able to listen to the system output, also connect $v_{photo2}$ to the handset earpiece. Remember to ground the other earpiece terminal as you did in Part 2 of Experiment 5.2.
\includegraphics[scale=0.500000]{ckt6.3.3.ps}

Examine your circuit carefully to ensure that any unwanted connections left over from pervious experiments have been removed.

Testing:

Apply a 1 V p-p 1 kHz sine wave to the $v_{fg}$ input of the mixer amp. The photodiode amplifier output ($v_{photo2}$ ) should be an identical sine wave of approximately equal amplitude. If the output is significantly different from 1 V p-p, adjust the gain of the LED driver appropriately (by varying $R_1$ in Fig. 5.6). You should also be able to hear the tone in the earpiece. Have your lab partner speak into the dynamic microphone. You should be able to hear the sound in the earpiece and see it on the oscilloscope.

Observations:

Start the "Spectrum" VI. Try various combinations of speech and function generator inputs, florescent lights on and off, and anything else you can think of. Convince yourself that the resulting spectra are consistent with previous observations.

The Future:

We will use this system next week to test several of our signal processing techniques, so don't disassemble anything and store your breadboard carefully.