Real-time Processing with Hypersignal RIDE
Overview
Many signal processing algorithms involve working with real-world signals for such applications as digital filtering, spectral analysis, communications systems, analytical instruments, and many more. These DSP applications typically involve the conversion of a continuous analog signal into a discrete digital representation of the signal that can then be used in a number crunching algorithm to achieve some desired result. For these applications to work successfully the data processing must occur in real-time. That is, the work to be performed on the signal must extract or determine the desired results “as it happens” with no loss of signal data.
Traditional approaches to developing an algorithm to run in real-time on DSP hardware include the tedious task of writing source code to implement the design algorithm in either C or assembly language. Using an assembler/linker/Ccompiler program the source code is compiled into a form which can be implemented on a DSP device. This DSP executable file is downloaded to DSP hardware where it implements the design algorithm. This approach to developing a real-time algorithm is one which requires a great deal of programming expertise, is very time consuming and labor intensive, and detracts from the process of developing the actual design algorithm to be implemented.
This application note describes how Hypersignal RIDE can be used to quickly develop applications that require real-time processing. Using RIDE’s graphical approach to implementing a real-time DSP algorithm provides a dramatic improvement over traditional design methods, and yields many benefits such as increased productivity, greater design flexibility, and vastly reduced design schedules.
Table of Contents
Detailed Description
This application note will demonstrate how Hypersignal RIDE software can be used to perform data acquisition, implement digital filtering, and perform spectral analysis on a real-world signal. In this example a DATEL PCI-431 high speed data acquisition board with an onboard TMS320C44 DSP is used in conjunction with the Hypersignal RIDE software to create a real-time DSP algorithm. It is important to mention that Hypersignal RIDE contains hundreds of functions and that many different real-time algorithms can easily be implemented using the approach described in this application note.The example described here involves the acquisition of a real-world signal. An external signal is applied to the input channels of the DSP hardware. The hardware is programmed to acquire the signal at a specific sample rate. In addition to acquiring the signal, the data is filtered with an elliptic Infinite Impulse Response (IIR) digital filter. Both the original and the filtered signal are then transformed into the frequency domain through use of a Fast Fourier Transform algorithm. The linear magnitude of each is then calculated and the results are graphically displayed as both a 3D Waterfall and as a representation of time and frequency in a Spectrograph contour display. If desired, log scaling can be selected for both display types.
Data acquisition is a term used to describe the process of “sampling” a signal from a real-world system. In many cases, the signal captured represents the physical quantity of electric voltage transformed via the use of transducers such as microphones, thermistors, etc. In the field of digital signal processing, the transformation from a continuous analog signal to a discrete sequence is usually referred to as analog-to-digital conversion (A/D conversion).
In this Hypersignal RIDE application, as shown in Figure 1, data acquisition is represented by a single block function icon located at the left-most section of the worksheet. This block represents the A/D conversion process and actually programs the DSP/acquisition hardware to sample the incoming signal. For our example, we have setup the PCI-431 board to sample at a rate of 100 kHz, and to operate on data in frames of 512 samples.
Setting A/D-specific parameters such as analog conversion sample rate, input channel selection, and data buffer framesize is easily accomplished by using the mouse to double-click the A/D block function icon and select the desired parameters. All DSP programming is handled automatically by Hypersignal RIDE and operation is transparent to the user. Data flow for the algorithm is easily established by connecting block function icons together with the mouse. Data synchronization input/output logic flags are selected at the block level to govern subsequent data processing.
For our example we have used an external waveform function generator to apply a sine wave voltage to the PCI-431’s channel 0 input connection. Since we have programmed the PCI-431 hardware with a 100 kHz sample rate, the input signal used is band-limited to 50 kHz, and the input sine frequency is varied between DC and 50 kHz.
Digital filters are often characterized and designed on the basis of a desired frequency response for a given application or system. Once the appropriate filter coefficients that are required to implement the specific response have been created, they can be applied to a signal to achieve the desired results.
Hypersignal RIDE includes a Filter Design Utility, shown in Figure 2, which allows you to easily design your own custom digital filters for use in a real-time RIDE worksheet. The Filter Design Utility produces a filter coefficient file of secondorder cascade sections that can be used by RIDE’s dedicated real-time IIR filter block function. The filter coefficients produced by the Filter Design Utility and used by the real-time IIR block function correspond to the transfer function shown in Figure 3.
For this example a bandpass elliptic IIR filter was constructed with a passband region ranging between 20 kHz and 30 kHz. The filter’s stopband attenuation was selected to be 35 dB. The general approach taken by this algorithm is to simply attenuate the input signal’s frequency components that lie outside of the passband region as a means of demonstrating the filter’s frequency response. As can be seen in Figure 1, the data flow of the algorithm is established with line connections. Both the input signal and the filtered waveform are uploaded for display comparison. It can be seen that the signal is heavily attenuated outside of the passband region.

Figure 3: Transfer Function for IIR Coefficient Filter File
Transferring Time Data to Frequency Data
Two real-time FFT block functions are included in this example worksheet, as can be seen in Figure 1. These block functions have been setup to provide 9th-order (512 point) FFTs since the A/D input frame of data has been selected to operate with data buffers of 512 samples. The output of the FFT is complex. This is reflected in the real-time FFT’s block function icon that provides two output channels - a real component and an imaginary component. The complex output from the FFT is passed on to a real-time Magnitude block function that calculates the linear magnitude of the signal.
Symbolic Information, Profiling Capability, & DSP Memory Operations
Hypersignal RIDE contains a full DSP COFF linker and provides information such as symbolic information, target DSP memory map control, complete system statistics, code profiling capability, initialization and interrupt support, and more. Figure 4, below, shows the Symbol Table for this RIDE real-time algorithm.

Figure 4: RIDE Symbol Table Spectral Comparison
It is readily apparent from both the 3D Waterfall and Spectrograph contour displays that the signal has been attenuated outside of the passband region of 20 kHz to 30 kHz.

Figure 5: Spectral Comparison of Filtered and Original Signal
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).


