Design of Digital Signal Processing Using Virtual Instruments

Publisher:和谐共融Latest update time:2012-01-18 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

What can engineering design gain from virtual instruments? Even if you are not familiar with virtual instruments, it is natural to understand how instruments affect engineering design. Traditional instruments such as oscilloscopes are widely used in different stages of test and measurement applications and in the design, verification and test stages of electronic systems. However, with rapid development tools, interactive design functions and natural correlation with real signals, virtual instruments can bring engineering design into a new era.

For example, digital signal processing (DSP) and its relationship with instruments. A digital signal processor (DSP) is a microprocessor that performs real-time mathematical operations on digital signals. To process analog signals using DSP, the analog signal is first digitized using anti-aliasing filters and analog-to-digital converters (ADCs) and fed into a data stream that is passed to the DSP. The DSP then modifies the data stream in some way and converts the signal back to analog through digital-to-analog converters (DACs) and anti-artifact filters. Generally speaking, traditional stand-alone instruments such as oscilloscopes use custom fixed embedded DSP systems. In addition, oscilloscopes can actually be implemented on personal computers (PCs) through virtual instrumentation technology. Using the power of the PC, the actual input signal is digitized using a PCI data acquisition device, and then the signal is processed using the PC. This virtual instrument approach allows users to customize instrument functions by relying on self-developed software programs and on a PC or real-time operating system.

The powerful design tools provided by virtual instruments enable people with different skill levels and educational backgrounds to quickly design and develop custom test and measurement systems. In contrast, engineering design in the past required developers to use unrelated development tools and had certain engineering expertise in both domain design and implementation. This article describes how to apply virtual instrument design tools to signal processing engineering design, thereby eliminating the barriers between design and final system implementation. We will further discuss this issue by studying the design and release of digital signal processing as an engineering example.

Digital Signal Processing and Virtual Instruments

First, let's discuss the concept of virtual instruments, which emerged to address the limitations of traditional stand-alone instruments. In the past, test and measurement tools were usually composed of stand-alone instruments such as oscilloscopes and waveform generators, which provided a limited set of functions for limited measurement applications. This traditional instrumentation has three basic limitations: 1) the limited accuracy and speed of signal acquisition provided by the hardware; 2) the limited manufacturer-defined measurement and analysis functions built into the instrument; and 3) the limitations of the user interface. If any of these limitations cannot meet the requirements of the project specifications, then a new stand-alone instrument is required, which will greatly increase the final system cost.

Since 1976, NI has brought a new concept to instrumentation by splitting the traditional stand-alone instrument into two basic parts: the hardware required to digitize the signal and the software required to analyze and display the results. By allowing the end user to use user-defined software to build the final instrument for their application, the limitations of the instrument were solved, and the concept of virtual instrumentation was born. With software as an instrument, the instrument can be extended to test, control, and design.

The advantages of virtual instruments over traditional stand-alone instruments are similar to the advantages of digital signal processing over analog signal processing. For example, analog filters are usually implemented using analog electronic components such as operational amplifiers, capacitors, and resistors, which have limited flexibility compared to digital filters implemented using floating-point or fixed-point machines. Although analog filters are relatively cheap and easy to build, analog filters are difficult to calibrate and maintain. Modifications to the design are also difficult to achieve. For example, if it is later discovered that a higher-order filter is needed, the hardware must be changed to implement a new design. Since digital filters are built with software, this problem does not exist, providing a flexible platform that can implement multiple applications on a single hardware.

In addition to the advantages of both virtual instruments and digital signal processing based on software platforms, virtual instruments have further developed the advantages of ease of use by using the graphical programming development environment NI LabVIEW, which can allow more people to participate in software development and instrument design. LabVIEW not only provides a graphical programming method that is completely different from traditional text-based programming languages, making the programming process more intuitive and convenient, but also is compatible with text programming languages ​​through its own Mathscript, allowing users to be compatible with existing algorithms, or choose the appropriate programming method according to actual applications. This greatly saves a lot of time needed to be familiar with the programming environment and syntax.

This is also the impact of the lack of sufficient design tools on digital signal processing? For DSP engineers, using traditional tools to implement software-based solutions is very painful. The typical development process starts with algorithm design, which requires the use of multiple mathematical modeling environments, which requires sufficient familiarity with text-based commands and syntax. After completing the algorithm, the implementation of the embedded system brings new difficulties. Embedded system design requires in-depth knowledge of real-time processing concepts, onboard memory availability, and text-based programming languages ​​and syntax required for software development.

Debugging is difficult with traditional text-based design tools. If an embedded system does not work as expected, how can you find out how mathematical design errors translate to specific embedded system code? Fixed-point design problems such as quantization, underflow, and overflow are difficult to track down because they often appear in the first few cycles of real-time execution. Common simple debugging tools such as breakpoints, single-stepping, and monitoring available registers and variables are not enough because they require the user to abandon real-time execution, which makes it impossible to reproduce the problem. In the past 20 years,

engineers, scientists, and technicians from thousands of companies have accelerated and simplified the development process by using LabVIEW, which is more powerful and easier to use than traditional design tools. LabVIEW has all the breadth and depth of a general-purpose programming language, and its ease of use increases user efficiency and reduces the time required to develop applications.


Simplifying parameter selection for DSP design

Take digital filter design as an example, which is developed and implemented using NI LabVIEW and the Digital Filter Design Toolkit. In this and other applications, one advantage of the virtual instrumentation approach is that it provides interactivity—you can directly see the results of making changes to the design parameters.

Digital filter design begins by defining the filter specifications for the filter type (lowpass, bandpass, bandstop, and highpass), whether it is a 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 an interactive interface for designing typical filters, such as Butterworth, Chebyshev, inverse Chebyshev, elliptical, Kaiser, Dolph-Chebyshev, and equiripple FIR design methods. The design shown in Figure 1 is a low-pass digital filter with an 8 kHz sampling rate, 1 kHz bandpass, 2 kHz bandstop, and 60 dB bandstop attenuation. As you design these parameters, you can immediately see the magnitude response and pole-zero plot of the current design, as well as the resulting filter order. In Figure 1, the inverse Chebyshev filter was chosen because it has a good transition band characteristic and a relatively low filter order.

Figure 1 Typical filter design Express VI provides an interface for interactive design exploration. Textbook filters such as Butterworth, Chebyshev, and equiripple FIR can be used.

Another advantage of signal processing design based on virtual instruments is the graphical programming method. The flowchart-like graphical programming method makes the program more intuitive. At the same time, to try a new algorithm, you only need to replace the required function icon. For example, the inverse Chebyshev filter design can be easily replaced by the Remitz filter design method or the minimum P-order specification design method. In fact, a series of programming design options listed in Table 1 can be used in the design. The Remitz design method generates an FIR filter that minimizes the maximum error between the desired frequency response and the actual design filter frequency response. The filter generated by this design specification has an "equiripple" characteristic, that is, a "Chebyshev" error behavior. The filter design generated by the Remitz tool is suitable for type I-IV linear phase, arbitrary shape FIR, optimal amplitude approximation (maximum or minimum phase), single-point band specification (valley or peak), and precise gain control. The minimum P-order specification method can be used to design FIR and IIR filters with arbitrary amplitude and phase constraints. Using the Digital Filter Design Toolkit, the minimum P-order specification method develops solutions using either Newton's method or iteratively reweighted least squares (IRLS) methods.

Table 1 The Digital Filter Design Toolkit provides a programmatic filter design toolkit for traditional applications to modern applications

Group Delay Compensator

In the process of designing and publishing fixed-point filters, one feature is self-evidently important, that is, the need to be able to directly and interactively view the design results. The traditional method of fixed-point implementation through text software is often efficient and low-cost, but the design process is more complicated due to the low accuracy of the algorithm.

Using LabVIEW and the Digital Filter Design Toolkit, the fixed-point digital filter design process begins with prototyping the floating-point filter and converting it to a fixed-point design. Converting to a fixed-point design will greatly change the characteristics and performance of the filter. The integer word length of the specified fixed-length register, the filter topology and other parameters are implemented, which are critical to ensure that the filter works as expected. Proper simulation and analysis of the fixed-point design can avoid debugging and searching in tens of millions of lines of embedded system code when debugging the design later. Fixed-point modeling, simulation and analysis tools integrated in the VI design environment simplify the transition from floating-point design to fixed-point design.

Another reason that makes fixed-point digital filter design very difficult is that parameter quantization, intermediate operations and results introduce noise into the system. Additionally, if there is not enough space in the data store, overflows can occur. The fixed-point modeling, simulation, and analysis capabilities in the LabVIEW Digital Filter Design Toolkit can help identify sources of implementation errors during the design phase. For example, consider a fixed-point implementation of the low-pass filter designed in Figure 1. Using the fixed-point modeling VIs, users can select a fixed-point system from multiple design options, specify word length, integer word length, and rounding and overflow modes at key locations in the design. For further control over the final implementation, more than 23 different filter topologies are available, ranging from FIR direct form 1 to IIR cascaded second-order sections (form I or II, transposed), to grid ARMA (basic, one multiplier, or normalized sections).

Figure 2 shows an example VI that includes a selection of filter topologies, fixed-point design tools, and simulation and analysis for fixed-point and floating-point designs. This VI provides an interface for interactively modifying implementation parameters as the simulation runs. First, you can keep the fixed-point modeling parameters unchanged, use the default filter topology, and test the filter response at all frequencies using a normally distributed white noise signal as the filter input. Figure 3 shows the simulation results. It is obvious that the fixed-point filter does not give the same results as the floating-point simulation, even though the designed filter has almost the same magnitude, phase, and zero-pole plots. The filter analysis report indicates that the results are not ideal due to overflows and underflows in multiplications, additions, and delays. Using the information given in the VI environment, the user can make runtime modifications to the fixed-point implementation, such as increasing the integer word length in the problem area, trying other filter topologies, or modifying other properties of fixed-point modeling. For this design, increasing the integer word length of multiplications, additions, and delays can achieve the desired fixed-point design results, as shown in Figure 4.

Figure 2. The flowchart shows the design of the filter. You can modify the filter topology, integer word length, and perform fixed-point and floating-point design simulations and simulation analysis on normal step-wise white noise.

Figure 3. The front panel shows the magnitude, phase, and pole-zero plot characteristics of the fixed-point and floating-point filter designs, along with the simulation results and analysis of the first test.

Figure 4 Based on the information provided in the filter analysis report, the integer word lengths for addition, multiplication, and delay are increased, and the simulation results for fixed-point and floating-point designs can now match

Design Verification and Release

Virtual instruments improve engineering design by naturally integrating with the hardware required in test and measurement applications. In the above digital filter design, the PCI data acquisition device can obtain the actual signal, and comparing it with the simulated signal can further ensure the correctness of the filter design. Since LabVIEW is tightly integrated with data acquisition hardware from NI and many third-party manufacturers, this is another important advantage in engineering design.

Many test and measurement applications require portability across multiple platforms, including real-time systems and embedded systems. This is again related to engineering design, where VIs need to be used in a variety of general-purpose operating systems, including Windows, Mac, Linux, and embedded systems such as FPGAs, DSPs, and any 32-bit microprocessors that support LabVIEW. The Digital Filter Design Toolkit is an add-on to LabVIEW that provides fixed-point modeling tools and LabVIEW FPGA and ANSI-C code generation. DSP engineers can now use the power of LabVIEW for complete digital filter development, from design to verification to embedded system release.

The Digital Filter Design Toolkit provides distribution options for both academic and industrial applications. One option is to save the filter parameters to a file, which is also the simplest distribution method. It saves all the implementation details to a file for later use. Using the LabVIEW DSP Module, you can read the filter parameters that were previously saved in a file and implement them in real time on the DSP. LabVIEW DSP brings graphical programming to multiple hardware platforms and can be widely used in academia, including NI SPEEDY-33 and Texas Instruments C6711, C6713, C6416 DSK for DSP design, rapid prototyping, and distribution. It has good support for Express VIs, which can speed up development, provide direct access to analog and digital IO on the board, and support debugging in a graphical programming environment.

Another option is FPGA distribution. The Digital Filter Design Toolkit can generate LabVIEW FPGA code based on fixed-point digital filter designs and use the generated code in the LabVIEW FPGA Module, which uses the Xilinx compiler to directly synchronize the FPGA located on the NI reconfigurable I/O (RIO) hardware. Devices with RIO technology come in a variety of form factors, including PCI, PXI, and CompactRIO programmable automation controllers. LabVIEW FPGA provides direct access to digital and analog I/O lines for digital filter applications.

ANSI-C code generation is another option for publishing digital filter designs. The LabVIEW Embedded Development Module compiles, links, and downloads LabVIEW-generated C code to any 32-bit microprocessor target using third-party embedded tool chains and operating systems. With the LabVIEW Embedded Module, you can interactively debug programs from the front panel and block diagram, access the board's peripheral I/O, and use any of the 1,000 built-in digital processing and signal processing VIs for embedded applications.

Figure 5 LabVIEW DSP, LabVIEW FPGA, and LabVIEW Embedded modules bring the power of graphical programming to unlimited hardware platforms

Virtual instruments are a viable approach to test and measurement system design and implementation. The unique approach adopted by virtual instrument thinking can be applied to engineering design applications and signal processing development, and the same tool can be used in theoretical design, analysis and testing, and release implementation.

Reference address:Design of Digital Signal Processing Using Virtual Instruments

Previous article:Design of Power Grid Comprehensive Parameters Measurement and Control System Based on LabVIEW
Next article:Serial communication between PC and inverter based on LabVIEW

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号