A TOOL FOR REAL-TIME DSP DEMONSTRATION AND EXPERIMENTATION Michael G. Morrow University of Wisconsin-Madison Thad B. Welch US. Naval Academy, MD Cameron H. G. Wright U.S. Air Force Academy, CO ABSTRACT
hardware is now dependent on driver files installed as part of Code Composer Studio, meaning the DSK hardware cannot he used except on machines with Code Composer Studio installed. This can pose a serious burden for teachers wanting to do demonstrations in classrooms or laboratories where Code Composer Studio is not installed; whether due to a lack of sufficient licenses or just not having time to install the package and uninstall it for a transitory demonstration. A related problem we found is that modifications were made to the drivers during major revisions of Code Composer Studio, rendering our software inoperative. Another issue is in fact caused by the extensive professional-grade capabilities of Code Composer Studio itself - it is indeed a very complex software package, and to the novice it is in fact often overwhelming. If your pedagogical goal is to get students to experiment with different coefficients in an FIR filter and observe the results in real-time, then using Code Composer Studio is quite likely overkill and potentially an inhibitor to leaming. In order to take students on a joumey from theory to real-time practice, there needs to he an infrastructure in place to support them and target as many modes of leaming as reasonably possible. [2] One very important segment of this structure is tools to support both faculty demonstrations and student experimentation and selfleaming. Professional-grade tools such as Code Composer Studio are generally just simply f o o capable and complex to lend themselves easily to this pursuit.
An innovative, stand-alone software package that demonstrates numerous DSP concepts is described, and examples of the program’s capabilities are given. By providing a simple and intuitive interface to capable DSP hardware, teachers and students alike can perform real-time interactive, graphical applications. Experimental learning is facilitated by providing simple access to real-time DSP filters and other concepts. This package can help ease the introduction of DSP theory and application to students at all age levels, and stimulate and encourage student interest in DSP. To facilitate student projects with graphical interfaces to DSP hardware, a complete software example has also been made available for use.
1. INIRODUCTION
This paper is a follow-up to the authors’ experience with their software package winDSK [ I ] that described a demonstration platform based in the Texas Instruments TMS320C31 DSP Starter Kit (DSK). Although this DSK is quite limited in memory space and has limited computational capability, it is nonetheless an effective platform for demonstration use, and in fact remains in active use at numerous universities around the world. Since that time, Texas lnstruments has released the TMS320C6711 DSK, incorporating a much more potent processor and significantly enhanced memory. This new DSK also ships with Texas lnstruments Code Composer Studio, a complete, integrated production-grade code generation, debugging, and analysis environment. While this greatly enhances the ability of skilled programmers to implement significant DSP algorithms m a laboratory setting, it also makes it more difficult to do demonstrations for several reasons. First, the DSK
0-7803-8116-5/02/$17.00 02002 IEEE.
2. A SOLUTION To overcome these difficulties, the authors developed a new software package tailored to the TMS32OC6711 DSK and much improved and more capable after several years of experience with winDSK. Our program winDSK6 is a Windows 9XiNT/2000 application that provides an intuitive and easy to use interface, and ensures that a
162
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on November 29, 2009 at 06:41 from IEEE Xplore. Restrictions apply.
student's first experience with the DSK is a positive and motivating one. It makes the DSK hardware much more accessible to students, and facilitates easy-to-use, readymade classroom and laboratoly demonstrations. For simplicity, all application software and DSK code is embedded in the executable file. A help file provides a section on each demonstration that discusses the theory and operation of the application, and context -specific help is available on each application conh.ol. To eliminate the requirement to have Code Composer Studio installed on a machine running the software, a completely new DSK driver was developed that operates under Windows 9X/NT/2000. (Operation under Windows XP has not been thoroughly tested as of the submission date o f this paper.) winDSK6 is written in C++, and centers on an object that encapsulates the DSK's physical and logical interface to the host computer. The applications that form the basis of winDSK6 have evolved over time and experience, with the authors' needs in the classroom and laboratory being the motivating force behind new applications and capabilities in the current version. Individual applications are dialog-based, and perform a similar sequence of operations to execute an application program: Reset and reboot the DSK Download the application software Locate the shared memory block and initialize any data to synchronize the host computer and the DSK Run the DSK application This occurs immediately upon selecting an application. Once the application is running, communications through the shared memory block are used to control the DSK application's behavior in response to user input on the host computer. This gives users real-time interactivity and immediate feedback when changes are made on the host computer.
as sampling rate) in real-time while the application is running on the DSK. The available applications include an oscilloscopelspectrum analyzer, multi-channel signal and/or arbitrary waveform generator, graphic equalizer, audio effects, guitar synthesizer, several filters, and DTMF generator. More detailed descriptions of some applications follow.
3.1. Talk-Through The talk-through application is a simple pass-through operation, echoing the input signal to the output. It allows for demonstrations of quantization effects by allowing the user to vary the effective number of bits from the maximum down to just 1. This provides for dramatic demonstrations of converter resolution versus perceived noise floor. Since most of the available audio codecs use sigmadelta converters, it is not possible to demonstrate aliasing at normal audio frequencies. By decimating without filtering, winDSK6 makes it possible to vary the effective sample frequency and demonstrate aliasing effects even when using these converters. Spectral inversion can also he demonstrated.
Figure 1 Screen capture of talk-through appplicatioa 3.2. Graphic Equalizer The graphic equalizer application implements a five-band graphic equalizer on each channel of the analog interface. It is implemented as five parallel FIR filters, an intentionally brute force method to demonstrate the available processing power. Individual slider controls are used manipulate the gain in each band and overall.
3. DEMONSTRATIONAPPLICATIONS The winDSK6 demonstration applications highlight a number of signal processing operations. Nearly all applications require only the basic DSK hardware to operate, although the limitations of the DSK's onboard codec do significantly restrict what can he accomplished. In our experience, we have found that using one of the CDquality codec daughtercards (available from Texas Instruments, Educational DSP, and other sources) to be much more useful. For this reason, winDSK6 provides support for these more capable analog interfaces in most applications. Applications also include a DSK Settings button that allows for the control of codec functions (such
Figure 2 Screen capture of graphic equalizer application.
163
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on November 29, 2009 at 06:41 from IEEE Xplore. Restrictions apply.
Texas Instrument THS1206 evaluation module (EVM). This analog interface provides four simultaneously sampled 12bit channels at variable sample rates ranging up to in excess of 1OOKHz.
3.3. Arbitrary Waveform Generator The arbitrary waveform generator application is capable of generating sine, triangle, or square waveforms, or noise, to the limits of the analog interface (amplitude and frequency). The user can also download a series of values from an ASCII text file on the host computer for arbitrary waveform generation with one-shot or continuous playback. On multichannel codecs, each channel is independently controllable. This application is useful as a no-additional-cost function generator for experimentation when test equipment may not be available. ..
.
I Figure 4 Screen capture of oscilloscope controls. For spectral analysis, a number of different data window types can be selected and the resulting effect observed in real time. A very useful demonstration is obtained with a variable frequency source at the input, and sweeping across the frequency range while observing the spectrum using different windows. (How would your students explain the periodic changes in the shape of the ‘spike’ as it moves across the frequency axis when using a rectangular window?) The actual spectral analysis computations are performed on the DSK, with the host computer serving as a display device. The display itself is a separate, resizable window, capable of operating as a conventional oscilloscope or as a waterfall display using one of several color maps. Figure 5 shows a waterfall display acquired from a commercial radio broadcast using a stereo analog interface.
Figure 3 Screen capture of arbitrary waveform generator.
3.4. OscilloscopeI Spectrum Analyzer The oscilloscope and spectrum analyzer application uses the DSK to acquire and process the input data. The analog output can either pass through the input signal, or function as a noise generator. By connecting the noise output to the scope input through a given circuit, students can investigate the response of a system. Standard oscilloscope controls, operational modes, and triggering are implemented, in addition to operation as a spectrum analyzer. The scope display can be copied to the Windows clipboard for documenting an experiment. In addition to a number of audio codecs, this application also supports the
164
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on November 29, 2009 at 06:41 from IEEE Xplore. Restrictions apply.
valid range. Fixed’point values are displayed in both their fractional equivalent representations and the actual integer value.
Figure 5 Screen capture of spectrogram display. Figure 7 Screen capture of FJR Nter application.
3.5. Audio Effects
3.7. W Filter (SOS) The audio effects application implements a variety r f effects often used in music production. These include echo, chorus, tremolo, and flanging. The parameters governing the effects can be varied beyond the customary values to create unusual effects. This application has been used often as a motivational demonstration, sparking student interest in wanting to know how the effects are implemented.
The IIR filter (SOS) application operates similarly to the FIR filter described above, but implements 20 cascaded second order sections. It also operates in both floatingpoint and fixed-point modes, with similar import features for acquiring coefficients from ASCII text and C language files. One additional import capability is the ability to paste in a series of coefficients from the Windows clipboard. The format required is the same as that which is obtained by displaying the coefficient matrix obtained from the Mathworks’ MATLAB tf2sos function. This is intended to provide an easy cut-and-paste method of testing filter coefficients generated in the MATLAB environment.
Figure 6 Screen capture of audio effects application.
3.6. FIR Filter The FIR filter application permits real-time experimentation with filter coefficients, using either floating-point or fixedpoint computations. A 512-tap finite impulse response filter is implemented on all codec channels. Fixed-point integer coefficients are supported in both Q15 and 412 formats. If the ‘Saturate’ mode is selected, all entries will be automatically saturated to within the bounds of the Q format in use. Coefficients may be imported from ASCII text files, or from C language files. If out of range values are encountered when importing, the user is pompted to accept the setting of saturation mode to limit values to the
Figure 8 Screen capture o f W filter application.
165
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on November 29, 2009 at 06:41 from IEEE Xplore. Restrictions apply.
3.8. THS1206 Aliasing The THS1206 Aliasing application provides a means to both demonstrate aliasing and show how it can be used in under-sampling. This application requires the Texas Instruments THS1206 4channel simultaneous sampling ADC for the analog input, with the onboard codec used for analog output. The sampling frequency used is the fixed 8KHz rate of the onboard codec, and any combination of the THS1206 channels can be summed together. The input to the 7HS1206 is unfiltered and the converter itself is a pipelined converter, so aliasing is easily demonstrated without the inherent issues of sigmadelta converters. Since the input bandwidth of the THS1206 is rated at SOMHz, this application can also be used to demonstrate the under-sampling of a radio frequency signal direct to an audio baseband signal, and to investigate the issues involved.
I.
. . . . . . . . .
1
Figure 10 Screen capture of HPI Test application.
3.10. DSK Confidence Test The DSK Confidence Test application provides a graphical interface to a number of DSK functionality tests. Based on the DOS based confidence test software that is shipped with the DSK, this application provides a easy to use method for determining if the DSK is operating correctly. In addition, it tests the bandwidth of the parallel port interface and reports the results to the user. The tests may be run individually, or in an automatic sequence.
. . . .
,
Figure 9 Screen capture of THS1206 aliasing application.
3.9. IIPI Interface Test
. . . . ..
.e , .
The HPI Test application is designed to provide a graphical debugger to control and debug the shared memory interface between the host computer and the DSK application. This tool supports DSK program loading, and the inspection and modification of DSK memory. It is invaluable for use when developing graphical interfaces for DSK applications based on the winDSK6 kernel, a topic discussed further in paragraph (4) below. In addition to a number of individually controllable memory locations, it provides a block viewer that is automatically set to the shared memory block area when a program is loaded. Memory locations can be viewed as floating point or integer values, and addresses can be entered directly or by look-up of known program symbols.
.- -
.......... .-
LED B e Tea(
,
-
.. ... .. .. ... . . . . . .
9';.
.a+:. I
. .~ . ._ .... .... .......
WDEC Tak.Thoughlert
.
__
__
-
:_".....-. . - . . . . ... . . . .. ....... .- ._ C@@ECOulpw ToncTsl
Figure 11 Screen capture of confidence test application.
166
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on November 29, 2009 at 06:41 from IEEE Xplore. Restrictions apply.
4. SUPPORTING STUDENTPROJECTS
As educators, we need to provide informative and provocative demonstrations in our classrooms and labs, to stimulate student interest and encourage learning. winDSE6 is a tool that helps us to accomplish all these things and more. The authors have found its capabilities to he invaluable in a wide variety of situations, including the expected use in DSP and communications courses, but also very effective in computer engineering courses and in high-school outreach programs. Paired with the significant hardware capabilities of the TMS320C6711 DSK, winDSK6 is an excellent demonstration platform in the classroom and in the laboratory. Although the authors have not conducted a scientifically valid study of the effects of using winDSE6 specifically, observation and anecdotal evidence indicate that it can play a significant role in both motivating students and providing them with a pathway to experimentation and self-learning. Many students have remarked about the lasting impression that these real-time demonstrations made on them. The authors freely distribute this software for educational, non-profit use, and it may be downloaded hm:
One consequence of using winDSK6 has been a corresponding desire by students to create a simil& interface for the DSP applications that they have written. However, the development and debugging of a complete interface of this nature is not possible for most students, given that they usually lack any significant experience in writing software applications for the Microsoft Windows API, the relative complexity of the DSK’s hardware interface, the generally poor availability of good documentation for the purpose, and simply having enough time to put it all together. (The authors’ experience in this same endeavor has provided the opportunity for an indepth verification of these issues.) Recognizing this, the authors packaged the winDSE6 DSK interface kernel with a complete and functional project to give students a realistic opportunity to pursue development of a graphical user interface for their applications. This package includes all source code for both a complete Microsoft Visual C++ application for the host PC and a complete Code Composer Studio application for the DSK. This sample application actually. implements most of the functionality of the Talk-Through application. By using this framework as a starting point, students are able to create a Windows interface to control their DSP application in a reasonable amount of time. This framework is available for download as described below.
http://eeeservO.ece.wise.edu/-morrowlsoff Source code for DSK applications is also available to educators. Interested parties are invited to contact the authors via email (
[email protected],
[email protected],
[email protected]).
&REFERENCES
5. CONCLUSIONS
To provide positive, motivating experiences to students early in their DSP education, we must provide them with software tools that are intuitive, attention getting, robust, and easily installed. We must encourage experimental learning, and provide vehicles for students who are not yet ready for the complexities of real-time DSP programming. These tools must also be intuitive, graphical, feature-rich, robust, and, of course, affordable.
[ I J M. G. Morrow, T. B. Welch, and C. H. G. Wright, “An inexpensive software tool for teaching real-time DSP,” in Proceedings of the 1st IEEE DSP in Education Workshop, (Hunt, TX), IEEE Signal Processing Society, Oct. 2000.
[2] C. H. Wright, T. B. Welch, D. M. Etter, and M. G. Morrow, “Teaching DSP: Bridging the Gap from Theory to Real-Time Hardware,” in Proceedings of the 2002 ASEE Annual Conference, (Montreal, Quebec, Canada), June 2002. Session 3220.
167
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on November 29, 2009 at 06:41 from IEEE Xplore. Restrictions apply.