Digital signal processing design using virtual instruments
2026-04-06 05:11:10··#1
What can engineering design gain from virtual instruments? Even if you're unfamiliar with virtual instruments, it's natural to understand how instruments influence engineering design. Traditional instruments like oscilloscopes are widely used in different stages of test and measurement applications, as well as in the design, verification, and testing of electronic systems. However, virtual instruments can usher in a new era for engineering design with their rapid development tools, interactive design capabilities, and natural correlation with real-world signals. For example, consider digital signal processing (DSP) and its relationship to instruments. A digital signal processor, or DSP for short, is a microprocessor that performs real-time mathematical operations on digital signals. To process analog signals using a DSP, the analog signal is first digitized using an anti-aliasing filter and an analog-to-digital converter (ADC), and then fed into the data stream entering the DSP. The DSP then modifies the data stream in some way and converts the signal back to analog through a digital-to-analog converter (DAC) and an anti-speculiarity filter. Typically, traditional standalone instruments like oscilloscopes use custom-built, fixed embedded DSP systems. In addition, oscilloscopes can also be implemented on a personal computer (PC) using virtual instrument technology. Leveraging the powerful performance of PCs, actual input signals are digitized using PCI data acquisition devices, and then processed by the PC. This virtual instrument approach allows users to customize instrument functions using self-developed software programs 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. Conversely, traditional engineering design required developers to use unrelated development tools and possess 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 barriers between design and final system implementation. We will further discuss this issue by studying the design and deployment of digital signal processing as an engineering example. 1. Digital Signal Processing and Virtual Instruments First, let's discuss the concept of virtual instruments, which emerged to address the limitations of traditional standalone instruments. In the past, test and measurement tools typically consisted of standalone instruments such as oscilloscopes and waveform generators, which provided a limited set of functions for limited measurement applications. Traditional instruments have three fundamental limitations: 1) limited accuracy and speed in signal acquisition provided by the hardware; 2) limited manufacturer-defined measurement and analysis functions built into the instrument; and 3) limitations in the user interface. If any of these limitations fails to meet project specifications, a new standalone instrument is required, significantly increasing the final system cost. Since 1976, NI has introduced a new concept to instruments by dividing traditional standalone instruments into two basic parts: the hardware required to digitize signals and the software required to analyze and display the results. This allows end-users to build the final instrument for their applications using user-defined software, thus overcoming the limitations of traditional instruments and giving rise to the concept of virtual instruments. By treating software as an instrument, instruments can be extended to testing, control, and design. The advantages of virtual instruments compared to traditional standalone instruments are similar to the advantages of digital signal processing compared to analog signal processing. For example, analog filters are typically implemented using analog electronic components such as operational amplifiers, capacitors, and resistors, offering limited flexibility compared to digital filters implemented using floating-point or fixed-point machines. While analog filters are cheaper and easier to build, they are difficult to calibrate and maintain. Modifying the design is also very challenging. For example, if a higher-order filter is later needed, the hardware must be modified to implement a new design. Since digital filters are built in software, this is not a problem, providing a flexible platform on a single hardware device capable of implementing multiple applications. Besides virtual instrumentation and digital signal processing leveraging the advantages of software-based platforms, virtual instrumentation further enhances ease of use through the graphical programming development environment NI LabVIEW, allowing more people to participate in software development and instrument design. LabVIEW not only provides a graphical programming method completely different from traditional text-based programming languages, making the programming process more intuitive and convenient, but also, through its built-in Mathscript, is compatible with text-based programming languages, allowing users to use existing algorithms or choose the appropriate programming method based on the actual application. This greatly saves the significant time required to familiarize oneself with the programming environment and syntax. Is this also an impact of the lack of sufficient design tools on digital signal processing? For DSP engineers, implementing software-based solutions using traditional tools is extremely painful. A typical development process begins with algorithm design, which requires the use of various mathematical modeling environments, demanding sufficient familiarity with text-based commands and syntax. After completing the algorithm, the implementation of the embedded system presents new challenges. Embedded system design requires in-depth knowledge of real-time processing concepts, onboard memory availability, and the text-based programming languages and syntax required in software development. Debugging is particularly difficult with traditional text-based design tools. If an embedded system doesn't function as expected, how can errors in the mathematical design be traced back to the specific embedded system code? Issues related to fixed-point design, such as quantization, underflow, and overflow, are difficult to track down because they often occur in the first few loops of real-time execution. Common, simple debugging tools such as breakpoints, single-stepping, and monitoring available registers and variables are insufficient because they require the user to abandon real-time execution, making it impossible to reproduce the problem. Over the past 20 years, engineers, scientists, and technicians from thousands of companies have accelerated and simplified the development process using LabVIEW, which is more powerful and easier to use than traditional design tools. LabVIEW possesses the breadth and depth of a general-purpose programming language, and its ease of use improves user efficiency and reduces the time required to develop applications. 2. Simplifying Parameter Selection in DSP Design For example, digital filter design is developed and implemented using NI LabVIEW and the Digital Filter Design Toolkit. One advantage of the virtual instrumentation approach in this and other applications is its interactivity—the results of modifying design parameters can be directly observed. Digital filter design begins by defining filter specifications for the filter type (low-pass, band-pass, band-stop, and high-pass), determining whether it's a finite impulse response (FIR) or infinite impulse response (IIR), and specifying the sampling rate and the required filter response on the floating-point machine. Figure 1 shows interactive interfaces for designing typical filters, such as Butterworth, Chebyshev, inverse Chebyshev, elliptic, Kaiser window, Dolph-Chebyshev window, and equiripple FIR design methods. The design shown in Figure 1 is a low-pass digital filter with an 8 kHz sampling rate, a 1 kHz bandpass, a 2 kHz bandstop, and a 60 dB bandstop attenuation. When designing these parameters, the amplitude response and pole-zero plot of the current design, as well as the resulting filter order, can be immediately seen. In Figure 1, an inverse Chebyshev filter was chosen because of its good transition band characteristics and relatively low filter order. [align=center]Figure 1: Typical Filter Design Express VI provides an interface for interactive design exploration, allowing the use of textbook Butterworth, Chebyshev, and equiripple FIR filters.[/align] Another advantage of signal processing design based on virtual instruments is the graphical programming approach. The flowchart-like graphical programming makes the program more intuitive. Furthermore, trying a new algorithm simply requires replacing the function icon with the desired one. For example, an inverse Chebyshev filter design can be easily replaced with a Remitz filter design method or a minimum P-order specification design method. In fact, all the programming design options listed in Table 1 can be used in the design. The Remitz design method generates FIR filters that minimize the maximum error between the desired frequency response and the actual designed filter frequency response. Filters generated by this design specification exhibit "equiripple" characteristics, i.e., "Chebyshev" error behavior. Filter designs generated by the Remitz tool are suitable for Type I-IV linear phase, arbitrary-shaped FIR, optimal amplitude approximation (maximum or minimum phase), single-point band specification (valley or peak), and precise gain control. The minimum P-order canonicalization 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 canonicalization method develops solutions using Newton's method or Iterative Reweighted Least Squares (IRLS). [align=center] Table 1: The Digital Filter Design Toolkit provides a suite of procedural filter design tools needed for both traditional and modern applications. [/align] In the design and deployment of fixed-point filters, the importance of one characteristic is self-evident: the ability to directly and interactively view the design results. Traditional methods using text-based software for fixed-point implementation are often efficient and low-cost, but their design process is more complex due to lower algorithm accuracy. 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 significantly alters the filter's characteristics and performance. Implementing parameters such as the integer length of the specified fixed-length register and the filter topology is crucial for ensuring the filter functions as expected. Proper simulation and analysis of fixed-point designs can prevent the need for debugging and searching through thousands of lines of embedded system code during later design debugging. Fixed-point modeling, simulation, and analysis tools integrated into the VI design environment simplify the transition from floating-point to fixed-point design. Another reason why fixed-point digital filter design is so difficult is that parameter quantization, intermediate operations, and results introduce noise into the system. Furthermore, overflow can occur if there is insufficient space in the data storage. The fixed-point modeling, simulation, and analysis capabilities in the LabVIEW Digital Filter Design Toolkit can identify the source of implementation errors during the design phase. For example, a fixed-point implementation of the low-pass filter designed in Figure 1 can be performed. Using the fixed-point modeling VI, users can select from multiple design options, specifying the fixed-point system, word length, integer length, and rounding and overflow modes at critical locations in the design. For further control over the final implementation, more than 23 different filter topologies are provided, ranging from FIR direct form 1 to IIR cascaded second-order parts (form I or II, transpose), up to mesh ARMA (basic, a multiplier, or a normalized part). Figure 2 illustrates an example VI that includes selecting filter topology, fixed-point design tools, and simulation and analysis for both fixed-point and floating-point designs. This VI provides an interface for interactively modifying implementation parameters as the simulation runs. First, keeping the fixed-point modeling parameters constant, using the default filter topology, and employing normally distributed white noise as the filter input, the filter's response at all frequencies can be tested. Figure 3 shows the simulation results. Clearly, the fixed-point filter does not produce the same results as the floating-point simulation, even though the designed filter has almost identical amplitude, phase, and pole-zero plots. The filter analysis report indicates that the results are not ideal due to overflow and underflow in multiplication, addition, and delay. Using the information provided in the VI environment, users can make runtime modifications to the fixed-point implementation, such as increasing the integer length in the problem region, trying different filter topologies, or modifying other properties of the fixed-point modeling. For this design, increasing the integer lengths of multiplication, addition, and delay yields the desired fixed-point design results, as shown in Figure 4. [align=center] Figure 2: The flowchart shows the filter design, allowing modification of the filter topology, integer digital length, fixed-point and floating-point design simulations for normally distributed white noise, and simulation analysis. [/align] [align=center] Figure 3: The front panel displays the amplitude, phase, and pole-zero plot characteristics of the fixed-point and floating-point filter designs, along with simulation results and analysis of the first test. [/align] [align=center] Figure 4: Based on the information provided in the filter analysis report, the integer digital lengths for addition, multiplication, and delay have been increased, and the simulation results for both fixed-point and floating-point designs now match. [/align] 3. Design Verification and Release Virtual instruments improve engineering design by naturally integrating with the hardware required in test and measurement applications. In the digital filter design described above, the PCI data acquisition device can obtain the actual signal, which, when compared with the simulated signal, further ensures the correctness of the filter design. This is another important advantage in engineering design due to the tight integration of LabVIEW with data acquisition hardware from NI and many third-party manufacturers. Many test and measurement applications require portability across multiple platforms, including real-time and embedded systems. This is also related to engineering design, where the VI needs to be usable on various 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 Kit (DPSK) is an add-in to LabVIEW that provides fixed-point modeling tools and LabVIEW FPGA and ANSI-C code generation. DSP engineers can now leverage the power of LabVIEW for complete digital filter development, from design to verification and ultimately to embedded system deployment. The DPSK offers deployment options for both academic and industrial applications. One method is to save the filter parameters to a file, which is the simplest deployment method, saving all implementation details to a file for later use. Using the LabVIEW DSP module, the previously saved filter parameters can be read and implemented 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, and C6416 DSKs, for DSP design, rapid prototyping, and deployment. It provides excellent support for Express VIs, accelerating development speed, enabling direct access to analog and digital I/O on the board, and supporting debugging in a graphical programming environment. Another option is FPGA deployment. The Digital Filter Design Toolkit can generate LabVIEW FPGA code from fixed-point digital filter designs and use the generated code in the LabVIEW FPGA module. It utilizes the Xilinx compiler to directly synchronize the FPGA located on NI's reconfigurable I/O (RIO) hardware. Devices with RIO technology are available in various form factors, including PCI, PXI, and CompactRIO programmable automation controllers. LabVIEW FPGA provides direct access to digital and analog I/O lines in digital filter applications. ANSI-C code generation is another option for deploying digital filter designs. The LabVIEW Embedded Development Module utilizes third-party embedded toolchains and operating systems to compile, link, and download the C code generated by LabVIEW to any 32-bit microprocessor target. Using LabVIEW Embedded Modules, you can interactively debug programs in the front panel and block diagram, access the board's peripheral I/O, and use any of the 1000 built-in digital processing and signal processing VIs for embedded applications. [align=center] Figure 5: LabVIEW DSP, LabVIEW FPGA, and LabVIEW Embedded Modules bring the power of graphical programming to an unlimited hardware platform. [/align] Virtual instruments are a viable approach for the design and implementation of test and measurement systems. The unique approach employed by the virtual instrument concept can be applied to engineering design applications and signal processing development, enabling the use of the same tools in theoretical design, analysis testing, and deployment implementation.