Design of an Analog Modulation Experimental Instrument Based on LabVIEW
2026-04-06 09:05:45··#1
Abstract: This paper introduces the design of an analog modulation virtual experiment instrument based on LabVIEW. The instrument adopts a hierarchical and modular design scheme and can simulate waveforms of amplitude modulation, frequency modulation, and phase modulation. It features adjustable parameters and simultaneous display of the time-domain waveforms and spectrum before and after modulation in four waveform windows. Simulation results show that the characteristics of each modulation are obvious and intuitive. Keywords : LabVIEW ; virtual instrument; analog modulation Key Words: LabVIEW; Virtual Instrument; analog modulation 1 Introduction Virtual instrument technology is a product of the combination of measurement and control technology and computer technology. It consists of a computer, corresponding hardware (such as data acquisition cards, input/output cards, etc.), and corresponding software development platforms (such as LabVIEW). The functions of virtual instruments are mainly implemented by software, and they can not only perform the functions of traditional instruments, but also perform many functions that traditional instruments cannot perform. LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is one of the most influential virtual instrument development platforms developed by National Instruments, and it is a development environment based on graphical programming (G language). It is mainly used in instrument control, data acquisition, data analysis, and data display, and can be used to easily build your own virtual instruments. Its graphical interface, numerous function libraries, and advanced analysis programs make programming and use more intuitive and convenient. This paper introduces the design of an analog modulation virtual experimental instrument based on LabVIEW as the software platform and a hierarchical and modular programming method. 2 Design of Analog Modulation Virtual Experimental Instrument Modulation is generally divided into two categories: analog modulation and digital modulation. In analog modulation, the modulating signal is an analog signal, mainly classified into ordinary amplitude modulation (AM), suppressed carrier double-sideband amplitude modulation (DSB), single-sideband amplitude modulation (SSB), frequency modulation (FM), and phase modulation (PM). A LabVIEW program consists of two parts: a front panel program and a block diagram program. The LabVIEW front panel is like the control panel of an electronic instrument; the block diagram program is the functional circuitry installed inside the instrument. 2.1 Front Panel Design The front panel design of this experimental instrument is shown in Figure 1. This design fully utilizes the strengths of LabVIEW, integrating five analog modulation methods into a unified interactive interface, forming a comprehensive analog modulation experimental instrument. The front panel can be divided into two main parts: the display section and the control section. The display section houses four monitors, enabling simultaneous display of the waveforms and spectra of the modulated and modulated signals, thus providing a direct comparison of the time-domain waveforms and spectral structures of the signals before and after modulation—something that ordinary electronic instruments cannot achieve. The control section is functionally divided into type selection, frequency selection, display control, modulation index adjustment, and a stop button. By selecting the type, not only can five modulation modes be switched, but the modulation signal waveform can also be selected from sine, triangle, square, and sawtooth waves. It should be noted that in the display control section, in order to facilitate observation and make the waveform characteristics obvious, users can easily change parameters such as the number of cycles of the time domain signal display and the frequency domain display range. In addition, the front panel is decorated with a border and classified according to function, making the front panel beautiful and easy to operate. [align=center] Figure 1 Front panel of the analog modulation experimental instrument[/align] 2.2 Program flowchart design (1) Main program design The program flowchart is closely related to the front panel. The control and display components of the front panel appear in the program flowchart as control modules and output display modules, which is similar to the relationship between the panel and the internal functional circuit of the real instrument. To enable dynamic changes in parameters during experimental instrument operation and obtain real-time results, the program continuously loops until the user stops it. The entire program operates within a While Loop (Function>>Structures>>While Loop) structure, as shown in Figure 2. Inside the loop structure is a Case (Function>>Structures>>Case) structure, assigning five alternative values (AM, DSB, SSB, FM, PM) to the Enum (corresponding to the control value selected via Control>>Ring & Enum>>Enum on the front panel) based on the modulation type. This allows selection of one of these values to enter a different modulation type module. Various modulation types often share some control parameters; for example, all five modulation types have a carrier frequency control value. Setting five control values on the front panel would be inconvenient and cumbersome. This design addresses this issue by creating Local Variables. For instance, a "Carrier Frequency (kHz)" numerical control module is first set to control the carrier frequency of AM modulation. When other modulation types need to use the same control quantity, first right-click the control module and select Create>>Local Variable to get the local variable; then right-click the local variable and select Change To Read, and finally connect the local variable to the port to be controlled, so that one control quantity can control the carrier frequency of two modulation types at the same time. By analogy, the purpose of using one control quantity to control more ports at the same time can be achieved. [align=center] Figure 2 Flowchart of the analog modulation experiment instrument[/align] (2) Subroutine design In order to make the main block diagram program look clearer and neater, a modulation subroutine with similar input and output ports was written for each modulation type. This virtual instrument can realize the simulation experiment of 5 analog modulations, so 5 corresponding subroutine modules are required. Now, the design of the subroutine is briefly introduced using DSB modulation as an example. [align=center] Figure 3 Structure diagram of DSB subroutine[/align] The carrier signal in Figure 3 is generated by Sine Waveform.Vi (Function template - Signal Processing sub-template) as the core module, combined with attribute settings. The modulation signal is generated using Basic Function Generator.vi (Function template - Waveform Generator sub-template) as the core module. This module can select the modulation signal as a sine wave, triangle wave, square wave, or sawtooth wave, which enriches the waveform simulation results. The FFT transformation module is generated using Amplitude and Phase Spectrum.vi (Function template - Signal Processing sub-template) as the core module. To facilitate control of time-domain and frequency-domain displays, separate display control modules were designed to more clearly reflect the waveform characteristics of the modulation method. After the DSB subroutine (named DSB_sub_new.vi) was designed, it was encapsulated as a subroutine module. The encapsulation process involves first placing the input control or output quantities to be connected externally on the front panel; then right-clicking the icon in the upper right corner of the front panel, selecting "Show Connector," and then right-clicking the connector again to select "Remove Terminal" or "Add Terminal" to delete or add ports as needed; finally, clicking on a port on the connector and then clicking on the corresponding input or output quantity on the front panel to connect that quantity, and so on. Essentially, this process is like bringing out the input and output lines of a circuit board with a specific function. The encapsulated DSB subroutine module is shown in Figure 4. [align=center] Figure 4 DSB Subroutine Module[/align] 2.3 Simulation Example Example 1: The DSB simulation waveform is shown in Figure 5. The parameters are set as follows: modulation type is selected as DSB, modulation signal is Sine Wave; modulation signal frequency is 1kHz, carrier frequency is 40kHz; baseband spectrum range is 2kHz, the number of displayed modulation signal periods is 2, and the modulated spectrum refinement factor is 4. [align=center]Figure 5 DSB Modulation Simulation Example[/align] Example 2: FM simulation waveform is shown in Figure 6. Parameter settings are as follows: when the modulation type is selected as FM, the modulation signal is a Triangle Wave; the modulation signal frequency is 2kHz, the carrier frequency is 60kHz; the baseband spectrum range is 20kHz, the number of displayed modulation signal periods is 1, and the modulated spectrum refinement factor is 1. [align=center]Figure 6 FM Modulation Simulation Example[/align] 3 Conclusion LabVIEW, as a G language, is widely used in the development of virtual instruments in fields such as instrument control and data processing. Compared with traditional instruments, virtual instruments make full use of the powerful data processing, calling, and display capabilities of modern computer technology. The simulation modulation virtual experimental instrument developed using virtual instrument technology leverages the advantages of virtual instruments, featuring easy parameter changes, strong operability, and obvious simulation result characteristics. References: [1] Zhou Jingling, Wu Guoqing. Development of vibration acquisition system based on LabVIEW[J]. Microcomputer Information. 2004, 20(9):37-38. [2] Han Yu, Jiang Yuzhong, Yan Yuchun. Virtual implementation of DQPSK modulation and demodulation circuit based on LabVIEW[J]. Microcomputer Information, 2005, 21(12):43-45. [3] Hong Huanfeng, Lin Mingxing. Experimental teaching based on virtual instruments[J]. Laboratory Research and Exploration, 2005, 24(12):84-86. [4] Lei Zhenshan. Practical technical tutorial of LabVIEW7 Express[M]. Beijing: China Railway Publishing House, 2004. [5] LabVIEW User Guide[M]. National Instruments, Inc.