DOC PREVIEW
Rose-Hulman ECE 300 - Audio Signals and Spectra

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ROSE-HULMAN INSTITUTE OF TECHNOLOGY Department of Electrical and Computer Engineering ECE 300 Signals and Systems Fall 2007 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 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 Page 1 of 6EC 300 Signals and Systems Fall 2007 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. 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 There is no prelab Procedure 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 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. Your figures should look like those in Figure 1. Page 2 of 6EC 300 Signals and Systems Fall 2007 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.) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6-1-0.500.51TrainTime (sec)Amplitude0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8-1-0.500.51ChirpTime (sec)Amplitude Figure 1: Train and chirp signals. Examining Sinusoidal Signals 4. Use the MATLAB program you created in the prelab to create and display the time waveform ()0.1cos(2 3000 ) 0.1cos(2 7000 )xttπ=+tπand duration corresponding to a few periods of the lower frequency waveform. The sample rate Fs should be 20*8192 Hz. On the attached worksheet comment on the plot obtained and explain the plot features (e.g. is there enough resolution? and how is the signal energy is distributed in time?). Print out the plot. 5. Next, use the provided MATLAB function baf_fft.m to view the spectrum of the signal. For this to work properly, you will need to use a longer sample of the signal, i.e. a longer signal duration, say 64 periods. This FFT function will


View Full Document

Rose-Hulman ECE 300 - Audio Signals and Spectra

Documents in this Course
Exam 2

Exam 2

8 pages

Load more
Download Audio Signals and Spectra
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Audio Signals and Spectra and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Audio Signals and Spectra 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?