+ All Categories
Home > Documents > Experiments in Digital Signal Processing

Experiments in Digital Signal Processing

Date post: 24-Sep-2016
Category:
Upload: paul-r
View: 215 times
Download: 1 times
Share this document with a friend
5
IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 3, AUGUST 1982 b) accredited programs in engineering should be designated as: "Accredited by the Engineering Accreditation Commission of the Accreditation Board for Engineering and Technology." 5. Use of its role in accreditation to influence the establish- ment of effective measures to clarify that programs in engi- neering and programs in engineering technology are different educational programs. The unique role of each program in preparing graduates for productive careers should be emphasized. 6. Employers of engineers, technologists and technicians should be encouraged to properly utilize these individuals. Titles, other forms of recognition and advancement should be used in a manner which improves professionalism, productivity and human relations among the team members. Experiments in Digital Signal Processing PAUL R. PRUCNAL, MEMBER, IEEE Abstract-A series of experiments, simulations, and demonstrations is described which has been developed to accompany a first course in digital signal processing at Columbia University. These experiments range from analog-to-digital conversion to adaptive filtering. Students perform modifications of programs from an extensive subroutine li- brary and link these subroutines together to carry out various simulations. INTRODUCTION FOR the engineering student to be effective in the modern laboratory environment, a sound understanding of digital signal processing is necessary. As with any engineering disci- pline, it is likely that the student's grasp of a first course in digital signal processing will be enhanced by "hands-on" ex- perience, in addition to the usual theoretical instruction. For this reason, a series of experiments has been developed in con- junction with an introductory course taught at Columbia Uni- versity over the past few years. The nature of the course and the laboratory are described below. COURSE CONTENT This one-semester course in digital signal processing is taught at the senior undergraduate to first-year graduate level. The prerequisites are an introduction to systems analysis as well as probability and random processes. The subject is defined broadly as "the transformation, compensation, detection, and estimation" of signals. The text, by Schwartz and Shaw [1], adopts this broad interpretation of signal processing, and pro- vides many good examples. Reference texts [2] - [4] are relied upon heavily for topics which the primary text does not cover in depth, such as the fast Fourier transform (FFT). The course is divided into three sections. In part 1, mathematical tools necessary for the analysis of discrete-time signals are intro- duced. In part 2, the emphasis shifts from deterministic to Manuscript received April 4, 1981; revised May 18, 1982. The author is with the Department of Electrical Engineering, Colum- bia University, New York, NY 10027. random discrete-time signals, and the time- and frequency- domain characterization of such signals. In part 3, detection and estimation theory is introduced. The design of digital filters and the z-transform are treated in detail in a separate course. The course is broad in scope, at the expense of treating some topics rather superficially. Weekly problem sets, a midterm, and a final are given. The first year the course was taught, the experiments in digital signal processing had not yet been de- vised, and a project was required of all students. The projects were allowed to take several forms: a theoretical paper on a specialized topic; a review paper on an application of signal processing; or a software or hardware implementation of a "signal processor." It was found, however, that the resulting projects varied considerably in quality, and were not a sensible requirement in an introduction course taken by students with diverse backgrounds. In subsequent years the course was taught, only the students who scored an "A" on the midterm exam were given the opportunity to do a project. In this way, only the most highly motivated and capable students elected to do one. For these students, the result was a truly enriching experience. It allowed, for some, the first opportunity for in- dependent research, as well as the first experience in technical writing. The students' response was enthusiastic and the re- sults were excellent. In fact, several of the projects were sub- sequently extended into independent research courses. LABORATORY STRUCTURE In an effort to provide the remainder of the students, who are perhaps not as capable of pursuing independent work, with an educational experience similar to a project, but not as de- manding, the experiments in digital signal processing described in this paper were developed. The objective of this series of experiments and simulations is to provide students the opportunity to quickly and easily im- plement basic signal processing tools (fast Fourier transform, power spectral density, etc.). 001 8-9359/82/0800-0091$00.75 © 1982 IEEE 91
Transcript
Page 1: Experiments in Digital Signal Processing

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 3, AUGUST 1982

b) accredited programs in engineering should be designatedas: "Accredited by the Engineering Accreditation Commissionof the Accreditation Board for Engineering and Technology."

5. Use of its role in accreditation to influence the establish-ment of effective measures to clarify that programs in engi-neering and programs in engineering technology are differenteducational programs. The unique role of each program in

preparing graduates for productive careers should beemphasized.

6. Employers of engineers, technologists and techniciansshould be encouraged to properly utilize these individuals.Titles, other forms of recognition and advancement should beused in a manner which improves professionalism, productivityand human relations among the team members.

Experiments in Digital Signal ProcessingPAUL R. PRUCNAL, MEMBER, IEEE

Abstract-A series of experiments, simulations, and demonstrations isdescribed which has been developed to accompany a first course indigital signal processing at Columbia University. These experimentsrange from analog-to-digital conversion to adaptive filtering. Studentsperform modifications of programs from an extensive subroutine li-brary and link these subroutines together to carry out varioussimulations.

INTRODUCTIONFOR the engineering student to be effective in the modern

laboratory environment, a sound understanding of digitalsignal processing is necessary. As with any engineering disci-pline, it is likely that the student's grasp of a first course indigital signal processing will be enhanced by "hands-on" ex-perience, in addition to the usual theoretical instruction. Forthis reason, a series of experiments has been developed in con-junction with an introductory course taught at Columbia Uni-versity over the past few years. The nature of the course andthe laboratory are described below.

COURSE CONTENT

This one-semester course in digital signal processing is taughtat the senior undergraduate to first-year graduate level. Theprerequisites are an introduction to systems analysis as well asprobability and random processes. The subject is definedbroadly as "the transformation, compensation, detection, andestimation" of signals. The text, by Schwartz and Shaw [1],adopts this broad interpretation of signal processing, and pro-vides many good examples. Reference texts [2] - [4] are reliedupon heavily for topics which the primary text does not coverin depth, such as the fast Fourier transform (FFT). The courseis divided into three sections. In part 1, mathematical toolsnecessary for the analysis of discrete-time signals are intro-duced. In part 2, the emphasis shifts from deterministic to

Manuscript received April 4, 1981; revised May 18, 1982.The author is with the Department of Electrical Engineering, Colum-

bia University, New York, NY 10027.

random discrete-time signals, and the time- and frequency-domain characterization of such signals. In part 3, detectionand estimation theory is introduced. The design of digitalfilters and the z-transform are treated in detail in a separatecourse.The course is broad in scope, at the expense of treating some

topics rather superficially. Weekly problem sets, a midterm,and a final are given. The first year the course was taught, theexperiments in digital signal processing had not yet been de-vised, and a project was required of all students. The projectswere allowed to take several forms: a theoretical paper on aspecialized topic; a review paper on an application of signalprocessing; or a software or hardware implementation of a"signal processor." It was found, however, that the resultingprojects varied considerably in quality, and were not a sensiblerequirement in an introduction course taken by students withdiverse backgrounds. In subsequent years the course wastaught, only the students who scored an "A" on the midtermexam were given the opportunity to do a project. In this way,only the most highly motivated and capable students electedto do one. For these students, the result was a truly enrichingexperience. It allowed, for some, the first opportunity for in-dependent research, as well as the first experience in technicalwriting. The students' response was enthusiastic and the re-sults were excellent. In fact, several of the projects were sub-sequently extended into independent research courses.

LABORATORY STRUCTUREIn an effort to provide the remainder of the students, who

are perhaps not as capable of pursuing independent work, withan educational experience similar to a project, but not as de-manding, the experiments in digital signal processing describedin this paper were developed.The objective of this series of experiments and simulations is

to provide students the opportunity to quickly and easily im-plement basic signal processing tools (fast Fourier transform,power spectral density, etc.).

001 8-9359/82/0800-0091$00.75 © 1982 IEEE

91

Page 2: Experiments in Digital Signal Processing

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 3, AUGUST 1982

The experiments are carried out individually by students (ina class of size 30, typically) as part of the weekly assignments,with the aid of the School of Engineering's PDP 11/60 UNIX-based computer system and Tektronix graphics terminals. Bytyping a set of input parameters into the graphics terminal, thestudent immediately sees a visual display of some signal pro-cessing operation. By then changing the set of input parame-ters, the student can develop a better intuition or "feeling"for how the signal processor works. Since each experimentsupplements the regular weekly problem set, the first part ofeach experiment is designed to be completed within one-halfhour. Thus, the reward to the student is immediate, dramatic,and easily obtained. The student does not have to spend anytime writing or debugging programs (which is not the purposeof the course) or setting up hardware to see these results. Infact, a set of instructions is provided for the novice, startingwith, "Turn on the switch which is located behind theterminal," followed by detailed log-in instructions, includingwhat to do if something goes wrong.The second part of each lab deals with variations and exten-

sions of the basic topic. In order to perform this section, it isnecessary for the student to modify a core of subroutines thatare provided. The student copies the necessary subroutinesfrom the computer memory library into his own work space,and then can freely make alterations in these subroutines. Themodifications are often minor, and they can be implementedwith relatively little effort, depending, of course, on the stu-dent's competence in computer programming.Each student receives a lab manual containing chapters on

various class-related topics, sample programs, sample results,and an extensive subroutine library. The subroutines areavailable to the students directly from computer memory ofthe PDP 11/60 system. For those students who are working inindustry, the subroutines are optionally available on floppydisks, so that the class assignment can be carried out with theaid of a computer at their job location.The structure of each chapter is as follows: the project

assignment is summarized, and the objectives of the experi-ment are outlined. The pertinent theory is reviewed. A step-by-step experimental procedure is given. A sample Fortranprogram implementing the procedure is presented. The sub-routines needed in the sample program are provided alpha-betically in the Appendix of the lab manual. All sample pro-grams and subroutines are, as described earlier, also availableto students from the computer memory library. Sample re-sults, showing the student what he should expect to see onthe graphics terminal output, are illustrated in the manual, sothe student will know if he is on the right "track." Two orthree sample questions are listed, including suggested experi-ments the student can perform by writing his own programsand modifying the subroutines provided.The student is asked to run the sample program and answer a

series of written questions. The student then observes whathappens to the output when various input parameters arechanged. The student is then asked to modify the sample pro-gram and run experiments that extend the basic concept. Howfar the student proceeds with this section depends on his owncreativity, ability, and motivation. Discussion of the results is

Fig. 1. Setup for real-time sampling demonstration.

carried out in class, and the students' creative ideas are con-sidered on an individual basis.

LABORATORY CONTENTAlthough the topics covered in the lab manual are not com-

prehensive in scope, they provide a starting point for the stu-dent to develop his own algorithms. They may also providesome impetus for the student to carry out more sophisticatedprojects on his own. The topics are chosen to correspond toclass material and are assigned simultaneously, or slightly de-layed, with respect to the class discussion. The topics con-tained in the first draft of this manual will now be described.

Conversion ofDataThe purpose of this chapter is to introduce the student to

typical A/D and D/A hardware available at the output and in-put ports of minicomputers, such as the PDP 1 1/03, 11/23,and 11/60. The accuracy and linearity of these devices arediscussed. Software subroutines that control these devices aredescribed, together with the essential parameters of these sub-routines. As an example, data conversion is performed on aDECLAB 1 1/03 computer using the experimental setup inFig. 1. The output of a periodic wave generator, such as asinusoid or triangle of fixed amplitude and period, is fed intothe A/D port of the computer. Real-time sampling of thewaveform is accomplished using standard DEC-supplied sub-routines, such as SETR, to run the real-time clock, and IPOKEand IPEEK for data conversion. The output from the D/Aconverter is viewed on a scope, along with the input waveform.The experiment is first demonstrated with 2 Hz waveformsand sampling rates of 8, 16, and 32/s. The sampling rate ismodified by the student in real time by an appropriate key-board entry. The student is asked to observe the effects ofquantization error as a function of waveform period andsampling rate.

Fast Fourier TransformThe purpose of this chapter is to acquaint the student with

time-frequency domain relationships and the fast Fouriertransform (FFT) by decimation in time. The project assign-ment is to calculate the FFT of given time sequences. The

92

Page 3: Experiments in Digital Signal Processing

PRUCNAL: EXPERIMENTS IN DIGITAL SIGNAL PROCESSING

Fig. 2. Square pulse of length 32 and its FFT, with zeros at 16, 32,48, * * - and main peak amplitude 32.

experimental procedure, which consists of an algorithm togenerate a time sequence, compute its FFT, and display theresult, is as follows.

1) Assign the number of time domain data samples, say 512.2) Generate a time sequence, such as a square pulse of

length 32.3) Call the subroutine FFTT.4) Compute the magnitude of the resulting complex data.5) Plot the result on the graphics terminal or printer.The student is given a sample program which computes the

FFT of a square pulse. A photograph of a sample result is alsoprovided in the manual (see Fig. 2), and this result should ap-pear immediately on the graphics terminal if he runs the sam-ple program correctly. The student is asked to find the FFTof other time sequences such as an impulse and a sinusoid.This involves a simple modification of the main program. Thestudent is also asked to perform the inverse FFT, and the FFTfollowed by the IFFT, and to comment on the results.

Convolution by FFTThis experiment allows the student to see the response of a

linear system to an arbitrary input. The basic concept of con-volution is illustrated. The project assignment is to calculatethe convolution of given time sequences. The experimentalprocedure, which consists of an algorithm to generate twotime sequences, compute their FFT's, multiply the result,compute the IFFT, and display the result, is as follows.

1) Assign the number of time domain samples for two inputsequences and one output sequence, say 200, 400, and 1024.2) Specify the input data, such as two square pulses of

length 100 and 200.3) Perform the FFT of the first time sequence.4) Perform the FFT of the second time sequence.5) Perform complex multiplication of the two FFT's.6) Compute the inverse FFT of the result.7) Plot the result.The student is given a sample program which computes the

convolution of two square pulses. A sample result (see Fig. 3)is also provided. The student is asked to make observationsconcerning the lengths of the input and output sequences, andto perform convolutions of other sequences. This only re-quires modification of two loops in the main program. Thestudent is also asked to compute the response of a cascade oflinear systems to an arbitrary input.

Fig. 3. Square input pulse of length 98. Square transfer function oflength 198. Response of linear system.

Fig. 4. Two Gaussian noise sequences of length 1000 and correspond-ing autocorrelation estimates of length 56.

Autocorrelation EstimationThe purpose of this experiment is to estimate the autocorre-

lation function of a random process. The experimental pro-cedure is as follows.

1) Assign the length of the data sequence and the autocorre-lation sequence, say 1000 and 56.2) Specify the mean and variance of the Gaussian noise, say

0 and 1.3) Generate a random data sequence using a uniform

random number generator.4) Generate a Gaussian noise sequence.5) Compute and plot the autocorrelation function of the

result.The student is provided with a sample program to perform

the above autocorrelation estimation, and sample results (seeFig. 4) to verify that the example was performed correctlyThe student is asked why the input sequences used are notwhite Gaussian noise, and why the result is not an impulsefunction. The student is then to perform his own experimentin which the Gaussian noise is filtered. The autocorrelation iscomputed and compared to the previous results.

Power Spectral Density EstimationThe purpose of this experiment is to acquaint the student

with estimation of the power spectral density (PSD) and its re-lationship with the underlying random process. It is particu-larly important that the student appreciate the difference be-tween the PSD and the Fourier transform of a deterministic

93

Page 4: Experiments in Digital Signal Processing

IEEE TRANSACTIONS ON EDUCATION, VOL. E-25, NO. 3, AUGUST 1982

Fig. 5. (Top) Sinusoid with period 3, length 2000, and power 0.045.(Middle) Sinusoid plus filtered Gaussian noise of power 1.96.(Bottom) Power spectral density of length 256.

signal, which is often a difficult concept to grasp at first. Theconcepts of bias and variance are also illustrated. The averagedspectral density is implemented to demonstrate a reduction invariance. In the experiment, a Gaussian noise generator andfirst-order digital filter with two feedback coefficients producea noise sequence. A deterministic signal is added to this ran-dom sequence. The power spectral density is produced fromthe magnitude squared of the FFT of the input. A summaryof the experimental procedure follows.

1) Generate filtered Gaussian noise, as discussed in theprevious section, a sequence length 2000, mean 0, variance 1,and filter parameters 0.7 and 0.1.2) For illustration, generate a deterministic signal such as a

sinusoid, and add it to the random noise.3) Plot the resulting signal.4) Compute the power spectral density. For illustration,

the variance of the resulting estimate is reduced (but the biasincreased) by first breaking the signal sequence into shortersubsequences and averaging the resulting PSD's.A sample program illustrating the above case is given to the

student. A sample result is also provided (see Fig. 5). In thiscase, the signal is divided into four equal-length subsequences.The student is asked to experiment with different examples ofPSD averaging and to compare the results. The student thentests the effects of different first-order filters on the shape ofthe PSD. This is perhaps one of the most difficult concepts inan introductory course of this nature, and the student is en-couraged to try many different examples ofPSD calculationsand to observe the relationship between the nature of the timesequence and its PSD.

Wiener FilterThe purpose of this experiment is to implement a Wiener

filter and observe the output for different signal powers andnoise powers. The experimental procedure is as follows.

1) Assign lengths to the signal, noise, and autocorrelationsequences, say 1000, 1000, and 91.2) Generate the signal and plot.3) Specify the noise power, say 16.9.4) Plot the signal plus noise.5) Measure the autocorrelation function.

Fig. 6. (Top) Filtered Gaussian noise of power 16.9. (Middle) Filterednoise plus Gaussian noise of power 16.9. (Bottom) Estimate atWiener filter output.

Fig. 7. (Top) Sinusoidal signal with period 100, length 1000, andpower 2. (Middle) Signal plus Gaussian noise with unity power.(Bottom) Estimate of sinusoid at adaptive filter output.

6) Determine the coefficient of the first-order filter gener-ating the signal.7) Determine the Wiener filter coefficients.8) Generate the signal estimate and plot.9) Calculate the error between the signal and the estimate.The student is given a sample program and sample results

(Fig. 6), corresponding to the above example. The studentthen changes the noise power and compares the new valuesfor the filter coefficients. The theoretical error is comparedto the error obtained from the simulation.

Kalman FilterThis experiment implements a Kalman filter, and is similar

in structure to the Wiener filter simulation. It assumes thatthe random signal to be estimated can be modeled as a first-order recursive process driven by zero-mean white Gaussiannoise. The Kalman filter output is compared for various signaland noise powers.

Adaptive Noise CancellationThe purpose of this experiment is to acquaint the student

with adaptive filtering, using the Widrow-Hoff algorithm as anexample. The experimental procedure is outlined as follows.

1) Assign lengths to the signal, data, and estimate, say 1000for each.

94

Page 5: Experiments in Digital Signal Processing

PRUCNAL: EXPERIMENTS IN DIGITAL SIGNAL PROCESSING

2) Assign the FIR filter length.3) Generate and plot the signal, say a sinusoid.4) Compute and plot the signal plus additive Gaussian noise.5) Compute the adaptation rate constant.6) Call subroutine to generate noise sequence.7) Feed the noise into the FIR filter.8) Calculate the estimate of the noise.9) Calculate the signal estimate.10) Calculate the FIR filter coefficients using the Widrow-

Hoff algorithm.11) Store the data and the estimate.12) Return to step 6) and proceed.A sample program is given, as well as the sample results, in

Fig. 7. The student is asked to observe the results using differ-ent adaptation rate constants, different signal waveforms, anddifferent noise powers.

SUMMARYThe series of experiments described provides a basic labo-

ratory for a first course in digital signal processing. The stu-dent response has been generally favorable. The first year thecourse was taught, the laboratory had not yet been developed.After the lab was implemented, the interest and responsivenessof the class increased dramatically. This is measured both interms of the liveliness of discussions in class and the responseof written questionnaires answered by the class at the end ofthe term. The only change several students suggested was thatthe sample programs not be given to students, but that they berequired to write them themselves. As discussed earlier, thisrequirement might be too difficult for less capable studentsto complete on a weekly basis.Additional experiments will be developed in the future, with

greater emphasis on the processing of physically generated sig-nals. The PDP 11/60 facility is being expanded with this inmind. A dedicated microprocessor interface is being estab-lished, capable of performing A/D conversion at a rate of8 kbits/s. A simple experiment that might be implemented inthe future is as follows. The output from a light-emitting

diode (LED) is incident on a photomultiplier tube, and theresulting random process at the output has noise added to asignal. The noise can be measured separately with the LEDoff to establish a threshold discrimination level. The signalplus noise can be sampled and compared to this threshold. Inthis way, a simple detection scheme is illustrated. This pro-cedure has previously been used for classroom demonstrations,but could serve as the basis for experiments for individual stu-dents in the future. Additional experiments include speechprocessing, which will be implemented with the aid of a micro-phone, and simple circuitry at the A/D input. In the future,these experiments will be expanded to complement introduc-tory courses in systems and communications as well.

REFERENCES

[1] M. Schwartz and L. Shaw, Signal Processing, Discrete SpectralAnalysis, Detection, and Estimation. New York: McGraw-Hill,1975.

[21 A. Oppenheim and R. Schafer, Digital Signal Processing. Engle-wood Cliffs, NJ: Prentice-Hall, 1975.

[3] R. Schwarz and B. Friedland, Linear Systems. New York:McGraw-Hil, 1965.

[41 A. Oppenheim,Applications ofDigital Signal Processing. Engle-wood Cliffs, NJ: Prentice-HaUl, 1978.

Paul R Prucnal (S'75-M'78) was born in Nor-walk, CT, on June 18, 1953. He received theA.B. degree from Bowdoin College, Brunswick,ME, in 1974, and the M.S., M.Phil., and Ph.D.degrees from Columbia University, New York,NY, in 1976, 1978, and 1979, respectively.Since 1979 he has been an Assistant Pro-

fessor of Electrical Engineering at ColumbiaUniversity, and has consulted with PhilipsLaboratories, BriarcliffManor, NY. His re-search interests are in optical communications

and sin processing.Dr. Prucnal is a member of Phi Beta Kappa, Eta Kappa Nu, Sigma Xi,

and the Optical Society of America.

95


Recommended