Virtual Instrumentation Empowers Digital Signal Processing Design

Publish Date: Dec 19, 2011 | 18 Ratings | 3.67 out of 5 |  PDF

Overview

This article investigates features in National Instruments LabVIEW that make it an effective tool for digital signal processing design. The article explores this topic by considering how you can design and deploy a digital filter with NI LabVIEW.

Table of Contents

  1. Introduction
  2. Facilitating Parametric Exploration
  3. LabVIEW for Design
  4. Fixed-Point Design
  5. Design Validation and Implementation
  6. Authors

1. Introduction

Digital signal processing design involves definition and implementation of software that modifies and processes or analyzes signals. While the desired end result is embedded software that runs on a dedicated processor, the design process often involves working with design software on a general-purpose computer. Although it finds widespread use for computer-based measurement and automation applications, LabVIEW also is an effective tool for digital signal processing design. Indeed, many of the same features that make LabVIEW so useful for computer-based measurement and automation make it equally useful for digital signal processing design.

Back to Top

2. Facilitating Parametric Exploration


This article explores what makes LabVIEW an effective digital signal processing design tool by considering a digital filter design example developed and implemented using LabVIEW and the LabVIEW Digital Filter Design Toolkit, add-on software for use with LabVIEW. In this application and others, a key benefit of working with LabVIEW is interactivity. You immediately can see the results of varying design parameters as you iterate on the specifications of your design.

You begin digital filter design by defining the filter specifications for the filter type (lowpass, bandpass, bandstop and highpass), finite impulse response (FIR) or infinite impulse response (IIR), the sampling rate and the desired filter response on a floating-point machine. Figure 1 shows the interactive interface for designing classical filters, such as Butterworth, Chebyshev, inverse Chebyshev, elliptic, Kaiser window, Dolph-Chebyshev window and equiripple FIR design methods. The design in Figure 1 is a lowpass digital filter with an 8-kHz sampling rate, a 1-kHz passband and a 2-kHz stopband with 60 dB of stopband attenuation. When you specify your design with these parameters, you immediately get design feedback in the form of the magnitude response and pole-zero plots of the current design, along with the filter order generated. The filter order is important during filter design because it is an indicator of the number of calculations in the final implementation. Figure 1 specifies an inverse Chebyshev filter because of its transition band characteristics and the relatively low filter order requirements.

Configure Classical Filter Design Express VI
Figure 1. The Classical Filter Design Express VI provides an interface for interactive design exploration using textbook class filters, such as Butterworth, Chebyshev , and equiripple FIR.


Another benefit of working with LabVIEW for digital signal processing design is the graphical icon-based dataflow programming approach with which you easily can specify trial design configurations. With this approach, trying a new design algorithm is as simple as replacing an icon that represents one design algorithm with another. For example, you easily can try out different design methods, swapping out the inverse Chebyshev method with alternatives such as the Remez exchange or Least Pth Norm. In fact, a suite of programmatic design options, listed in Table 1, are available as possible alternatives. The Remez exchange design method generates FIR filters that minimize the maximum error between the target frequency response and the designed filter frequency response. This design specification yields filters with equiripple (Chebyshev) error behavior. Remez tools can generate filter designs for type I-IV linear-phase, arbitrary-shaped FIR, optimal-magnitude approximation (maximum or minimum phase), single-point band specification (notch or peak), and exact-gain control. You can use the Least Pth Norm method to design FIR and IIR filters with arbitrary magnitude and phase constraints. With the LabVIEW Digital Filter Design Toolkit, you can use the Least Pth Norm method to develop the solution with either the Newton method or the iterative reweighted least squares (IRLS) method.


IIR
FIR
Special Designs
Butterworth
Kaiser
IIR Notch Peak
Chebyshev
Dolph-Chebyshev
IIR Comb
Inverse Chebyshev
Windowed
Maxflat
Elliptic
Remez
Narrowband
Bessel
Least Pth Norm
Arbitrary Group Delay
Least Pth Norm
 
Group Delay Compensator
Table 1. The LabVIEW Digital Filter Design Toolkit provides a suite of programmatic filter design tools for classical to modern applications.
See Also:
NI LabVIEW
NI LabVIEW Digital Filter Design Toolkit
Measurement Encyclopedia: Digital Filter

Back to Top

3. LabVIEW for Design

When you work with LabVIEW, you build customVIs. Analogous to a text file that contains source code for a text-based programming language, VIs contain two main elements -- a front panel and a block diagram. The front panel of a VI specifies the function parameters (inputs and outputs) through a customizable user interface with numerical, graphical, textual, and other types of controls and indicators. The block diagram of a VI contains graphical code that you can design, compile, and execute with LabVIEW. When you work with LabVIEW for design, you apply a virtual instrumentation approach to the problem by creating VIs that are design configurations.

By working with a VI-based design configuration, you can create experiments that provide run-time access to design parameters. You can make these variable design parameters accessible from the front panel in the form of controls, or inputs, to the VI. The complete system design and simulation can coexist in a single VI with graphs and other useful analysis indicators, or outputs, on the front panel as well. This way, you can change design parameters and see immediate feedback. While this design environment is a proven way to interactively design a test and measurement system, it is equally as valuable in the engineering design world to interactively see design results.

Back to Top

4. Fixed-Point Design


The value of immediate, interactive design feedback is also apparent when you consider the process of designing and deploying a fixed-point filter. Fixed-point implementations can be power-efficient and inexpensive, but the design process is more involved because of reduced arithmetic precision.
With LabVIEW and the LabVIEW Digital Filter Design Toolkit, the fixed-point digital filter design process starts with a floating-point filter design prototype that you convert to a fixed-point design. Converting to fixed-point can significantly alter the characteristics and performance of the digital filter. Implementation specifics such as selection of the integer word length of the fixed-size registers, the filter topology, and other parameters are critical to ensure that the filter operates as intended. Proper simulation and analysis of the fixed-point design prevents sorting through embedded system code at a later time in an effort to debug the design. Fixed-point modeling, simulation, and analysis tools integrated in the VI design environment smooth the transition from floating-point to fixed-point.

The quantization of coefficients, intermediate operands, and results introduces noise into the system, which complicates fixed-point implementation. Additionally, overflows can occur when there is insufficient headroom in the datapath. The fixed-point modeling, simulation, and analysis functionality in the LabVIEW Digital Filter Design Toolkit determines sources for implementation errors at design time. For example, consider the fixed-point implementation of the lowpass filter designed in Figure 1. With the Fixed-Point Modeling VI available in the LabVIEW Digital Filter Design Toolkit, you can select among several design options for the fixed-point system, specifying the word length, integer word length, and rounding and overflow modes for the critical places in the design. More than 23 different filter topologies, from FIR direct form I to IIR cascaded second-order sections (form I or II, transposed) to lattice ARMA (basic, one multiplier, or normalized sections), are also available for more control over the final implementation.

Figure 2 shows an example LabVIEW VI that includes the choice of filter topology, the fixed-point modeling tool, and the simulation and analysis of the fixed- and floating-point designs. This VI provides an interface to interactively modify implementation parameters as the simulation runs. Initially, it might be natural to leave the fixed-point modeling parameters and the filter topology as default and then test the filter response over all frequencies with a uniform white-noise input signal.


Figure 2. The block diagram of the example VI shows the filter design, the control over the filter topology and integer word lengths, the simulation of the fixed- and floating-point designs to uniform white noise, and the analysis of the simulation.


Figure 3 shows the simulation results. The fixed-point filter clearly does not give the same simulation results as the floating-point simulation, despite the fact that the magnitude, phase, and pole-zero plots of the designed filters are nearly identical. The filter analysis report shows that the poor results occurred because of overflows and underflows in the multiplicand, sum, and delay.


Figure 3. The front panel of the example VI shows the fixed- and floating-point filter design characteristics with the magnitude, phase, and pole-zero plots as well as the simulation results and analysis for the first test.


With this information you can make run-time modifications to the fixed-point implementation, such as increasing the integer word length in the problem areas, experimenting with other filter topologies, or modifying other properties of the fixed-point modeling. For this design, increasing the integer word length for the multiplicand, sum, and delay yields the desired results from the fixed-point design, as shown in Figure 4.


Figure 4. Based on the information provided in the Filter Analysis Report, the integer word length for the multiplicand, product, sum, and delay were increased and the simulations for the fixed- and floating-point designs now match.

Back to Top

5. Design Validation and Implementation

Working with LabVIEW further improves the digital signal processing design process by offering natural integration with hardware required for validation. In the above example, you can use a plug-in PCI data acquisition device to acquire the real-world signals, in lieu of the simulated signal, to gain further confidence in the filter design. Because LabVIEW has an extensive feature set for test and measurement, it naturally has a tight integration with a variety of data acquisition hardware, which, again, has great value in engineering design.

Many test and measurement applications require portability to multiple platforms including real-time and embedded systems. This also lends itself to engineering design in which you can use your LabVIEW VIs for applications on general-purpose OSs, such as Windows, Mac, and Linux, and embedded systems built on FPGAs, DSPs and any 32-bit microprocessor. The LabVIEW Digital Filter Design Toolkit provides fixed-point modeling tools and LabVIEW FPGA and ANSI C code generation. You now can use the power of LabVIEW for digital filter development, from design to verification to embedded-system deployment.

The LabVIEW Digital Filter Design Toolkit provides deployment paths for both academic and industrial applications. Perhaps the simplest form of deployment is immediately using your filter within your LabVIEW code. Another straightforward deployment option is saving the filter coefficients and implementation details to a file.

There also are a variety of deployment alternatives for embedded targets. For instance, with the LabVIEW DSP Module, you target LabVIEW graphical code to an embedded digital signal processor for design, rapid prototyping, and deployment of DSP applications. With this module, filter parameters previously saved to file are read and implemented in real time on a DSP found on any of several hardware platforms that are widely used in academia, including the National Instruments SPEEDY-33 and Texas Instruments C6711 and C6713 DSKs. The LabVIEW DSP Module supports configuration-based Express VIs to speed application development, direct access to the digital and analog I/O on the board, and debugging from the graphical programming environment.

For FPGA deployment, the LabVIEW Digital Filter Design Toolkit can generate LabVIEW FPGA code from a fixed-point digital filter design. You can use the generated code with the LabVIEW FPGA Module, which applies the Xilinx compiler to directly synthesize the FPGA on National Instruments reconfigurable I/O (RIO) hardware. Devices with RIO technology come in several form factors, including PCI, PXI, and National Instruments CompactRIO programmable automation controllers. LabVIEW FPGA provides direct access to digital and analog I/O lines for digital filtering applications.

ANSI C code generation is yet another option for digital filter design deployment. The recently introduced LabVIEW Embedded Development Module uses a third-party embedded toolchain and OS to compile, link, and download C code generated by LabVIEW onto any 32-bit microprocessor target. With the LabVIEW Embedded Development Module, you can debug programs interactively from the front panel and block diagram, access peripheral I/O on the board, and use any of the 400 built-in numerical and signal processing VIs for embedded applications.

The virtual instrumentation approach embodied by LabVIEW is a proven method for computer-based measurement and automation system design and implementation. You can use the unique virtual instrumentation paradigm approach for digital signal processing design applications that now can use a single tool for design, test, and deployment.

Back to Top

6. Authors


This article first ran in the November 21, 2005, issue of NI News.

  • Kristi Hummel, Senior Applications Engineer, Control and DSP, National Instruments
  • Sam Shearman, Senior Product Manager, Signal Processing & Analysis, National Instruments

Related Links:
NI LabVIEW
NI LabVIEW Digital Filter Design Toolkit
NI LabVIEW FPGA Development Module
NI LabVIEW Embedded Development Module

Back to Top

Bookmark & Share

Ratings

Rate this document

Answered Your Question?
Yes No

Submit