ROSE HULMAN INSTITUTE OF TECHNOLOGY Department of Electrical and Computer Engineering ECE 300 Signals and Systems Spring 2006 Audio Signals and Spectra Lab 07 Bruce A Ferguson Objectives To become familiar with the concept of an aperiodic signal spectrum To investigate typical temporal and spectral features of audio signals Use MATLAB to investigate audio signal processing Equipment Laptop Computer with MATLAB Agilent E4402B Spectrum Analyzer Function Generator Oscilloscope Background We are learning that a signal can be represented either in the time domain or in the frequency domain Learning some basic realities of this dual representation will be an important goal of this course One of the cardinal rules is that events that happen quickly in time contain higher frequency content than events which occur more slowly Sounds converted to and from electrical audio signals provide an excellent way to investigate these relationships The human ear can hear sounds of frequencies in the range 20 Hz to 20 kHz However most sounds we work with only contain frequency content in the range of about 100 Hz to 8 kHz Lower frequency sounds such as a tug boat whistle have more frequency content in the low part of the audio range Higher frequency sounds such as bird song or dog whistles have more content in the upper part of the range Plotting the signal waveform versus time is familiar from our classwork When we plot an audio signal versus time we become aware of events happening on different time scales For example we might see the amplitude of the signal go up or down on the scale of tenths of a second This time scale determines mostly amplitude effects The signal also oscillates on the scale of tenths of a millisecond This time scale determines the frequency or pitch of the sounds We can also think of the signal as being composed of a number of sinusoids each having a distinct frequency amplitude and phase similar to a Fourier Series The tug boat whistle can be thought of as containing sinusoids at lower frequencies while the bird song contains sinusoids with higher frequencies Be sure you can differentiate between amplitude and frequency in terms of sounds The frequencies present and their relative amplitude and phase comprise the spectral content of the signal The signal spectrum is simply a plot of this spectral content vs frequency or how signal energy is distributed in frequency just as the waveform plot displays how signal energy is distributed in time However this display is averaged over a period of tens or hundreds of milliseconds thus losing information on the scale of seconds Page 1 of 5 EC 300 Signals and Systems Spring 2006 There are a number of tools available for examining the spectral content of the signal The spectrum analyzer is able to display the spectral content of the signal in pseudo real time in the same manner as an oscilloscope the refresh rate determines how close to real time the display is We can also investigate the spectral content of the signal by examining its digitized content with a digital signal processing DSP application called the Fast Fourier Transform or FFT This creates a view of the spectral content of the signal based on the entire signal sample In this way the FFT cannot display the spectral content in real time but rather displays only the spectral content averaged over the entire duration of the signal sample Yet another DSP application is available which displays how the frequency content of the signal varies with time sorta This is called a spectrogram or time frequency plot This combines the time and frequency dependent behavior of the signal by calculating a Short Time Fourier Transform over a small time window of the signal The center of the window in time is then shifted forward in time and a new STFT is calculated These STFTs are displayed as a function of window center time resulting in a display of how signal spectrum evolves with time This tool allows the evolution of the spectral content over longer time scales to be examined Pre Lab Investigate audio signal processing with MATLAB 1 Create a directory on your laptop called Matlab sounds Copy all of the files from the ece 300 audio lab directory into this directory Store all of your MATLAB programs and data files in this directory 2 Create a MATLAB program not a function which will allow you to display the time waveform of an audio signal as a plot The sound waveform samples are stored in mat files which are MATLAB format data files In each file is stored an array y of signal samples and a sampling rate Fs case is important The sample rate is equal to the reciprocal of the time between samples Ts From the sampling rate you will need to construct a time vector You can see what variables are present in a mat file by typing open filename mat at the MATLAB command prompt To actually load the data into the MATLAB workspace type load filename mat Test your program on the sample audio files Plot and compare the time waveforms of the train whistle file to that of the chirp noting on the plot both short and long term structure in the waveform versus time and important timescales 3 Add a line to your MATLAB main program which will play the sounds using the soundsc command Type help soundsc at the MATLAB prompt for details Make comments regarding what you hear when you listen to the train and chirp samples and relate these features to the time waveform plotted above Be specific 4 Imagine a deer whistle mounted on the front of a car that emits a frequency of 5 kHz in reality many of those devices don t even emit sound at all and so are ineffective Consider the Doppler effect on your perceived frequency of the whistle Sketch a time frequency plot describing the effect you hear as the car drives by you at 30 mph That is plot the perceived signal frequency as a function of time starting from when the car is far away and approaching you through when the car is far away and receding from you This is a simple Page 2 of 5 EC 300 Signals and Systems Spring 2006 spectrogram Hint this is a vector velocity problem Imagine you are standing at a point alongside the road a distance d from the road The car is traveling a velocity vx down the road This will create an effective velocity toward you Look up the Doppler effect to finish this problem 5 Define chirp as it pertains to signal frequency content 6 optional Obtain your favorite song and convert it to a wav file on your laptop Use your MATLAB program to
View Full Document