Design and Implementation of Virtual Spectrum Analyzer Based on LabVIEW

Publisher:考古专家Latest update time:2009-12-05 Source: 太原理工大学计算机与软件学院Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

O Introduction

LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming language that integrates all the functions of hardware and data acquisition card communication that meet GPIB, VXI, RS-232 and RS-485 protocols, and also has built-in library functions that facilitate the application of software standards such as TCP/IP and ActiveX. LabVIEW can be used to easily create various virtual instruments.

Spectrum analyzer is an essential means to measure radio signals. It is a common tool for electronic product development, production and inspection. It is widely used and is called the engineer's RF multimeter. The front-end circuit of the traditional spectrum analyzer is a tunable receiver within a certain bandwidth. The input signal is converted by the frequency converter and then output by the low-pass filter. The filtered output signal is used as the vertical component and the frequency is used as the horizontal component. The coordinate diagram is drawn on the oscilloscope screen, which is the spectrum diagram of the input signal. Since the frequency converter can reach a very wide frequency, such as 30Hz-30GHz, and can be expanded to more than 100GHz in conjunction with an external mixer, the frequency potential analyzer is one of the measuring instruments with the widest frequency coverage. Whether measuring continuous signals or modulated signals, the spectrum analyzer is an ideal measuring tool. However, the traditional spectrum analyzer can only measure the amplitude of the frequency and lacks phase information. Therefore, it is a scalar instrument and is bulky. By using the powerful virtual instrument development function of LabVIEW, the function of a modern spectrum analyzer based on fast Fourier transform (FFT) can be realized. The analog /digital converter ( ADC ) is used to directly sample the input signal using a digital method, and then the spectrum is obtained after FFT processing. This can solve the shortcomings of traditional spectrum analyzers such as high price and inconvenience in carrying.

1 Overall Design of Virtual Spectrum Analyzer

The virtual spectrum analyzer consists of a data acquisition card, a computer, and application software developed with LabVIEW running on it, as shown in Figure 1.

Virtual Spectrum Analyzer

The virtual spectrum analyzer uses the analog input and analog output functions of the data acquisition card. The analog output function generates the required excitation signal and adds it to the network under test. The two analog input channels are then used to simultaneously collect the excitation signal and the response signal at the network output end into the computer. After processing, the amplitude-frequency and phase-frequency characteristic curves are formed and displayed on the computer screen. Finally, the simulated signal is analyzed and the amplitude-frequency/phase-frequency characteristics of the analog signal are output on the computer screen.

2 Composition and Function of Virtual Spectrum Analyzer

2.1 Composition of Virtual Instruments and Spectrum Analyzer

The virtual spectrum analyzer designed in this paper consists of three submodules: periodic signal generator, filter, amplitude-frequency/phase-frequency characteristics, and spectrum analysis results. The signal generator submodule generates two analog input signals, one is a sine signal with adjustable frequency, phase and amplitude, and the other is a cosine signal with adjustable frequency, phase and amplitude. Finally, the two signals are mixed by the signal synthesizer as the generated two analog signals; the spectrum analysis and filter submodules use the powerful digital signal processing function of LabVIEW to filter, add windows, and perform FFT operations on this set of data to obtain the real spectrum and imaginary spectrum of the signal. The most important thing is to obtain the amplitude-frequency characteristic curve and phase-frequency characteristic curve of the signal; in the spectrum analysis result submodule, the spectrum of the generated signal is analyzed, and the root mean square value, the signal mean value within a cycle and other parameters are saved to a text file when the system exits. Among them, the filter setting can control the filter passing mode and cutoff frequency, and finally the spectrum analysis results are displayed. When the system exits, it prompts to save the current data to a text file.

The front panel of the virtual spectrum analyzer is divided into three parts: periodic signal generator, periodic signal filter and amplitude-frequency/phase-frequency characteristics and periodic signal spectrum analysis results, as shown in Figure 2. The figure shows the interface of the periodic signal generator. The sine wave and cosine wave signals in the figure can be changed by dragging the mouse and rotating the button to change the frequency, amplitude and phase of the signal. When dragging, you can find that the "2-way original analog signal waveform" below will change, and the maximum value of the horizontal axis will also change. This function can be achieved by calling the "XScaleControl.VI" introduced later in the program; the interfaces of the two functional modules "periodic signal filter and amplitude-frequency/phase-frequency characteristics" and "periodic signal spectrum analysis results" are limited in space and will not be repeated.

Virtual Spectrum Analyzer Rear Panel

The rear panel of the virtual spectrum analyzer consists of five sub-modules: waveform generation module, waveform analysis module, control of X-axis range, filter, and amplitude-frequency/phase-frequency characteristics and data storage module, as shown in Figure 3.

Virtual Spectrum Analyzer Panel [page]

2.2 Design of Virtual Spectrum Analyzer Submodule

(1) Waveform generation submodule

To perform spectrum analysis, we must first generate analog signals. This article uses two submodules of the system: Triangle waveform.VI and Sinewaveform.VI to generate two analog input signals. In order to adjust the frequency, phase and amplitude of the analog signal, several control inputs are added, as shown in pin diagrams 4 and 5.

Pin Diagram

In Figure 4 and Figure 5, the input pins and output pins are exactly the same, "offset" refers to the offset of the waveform and is generally not set; "resetsignal" is a Boolean input control. If it is loaded as True, the waveform can be reset, and if it is False, the waveform will not be reset; "frequency" refers to the frequency of the generated signal; "amplitude" refers to the amplitude of the signal to be generated; "phase" refers to the phase of the generated signal; "error in" and "error out" refer to the input and output when an exception occurs in the program; "sampling info" refers to the sampling rate of the signal to be generated, the default setting is 1000, that is, 1000 points are sampled per second; "Duty Cycle" is the duty cycle, which refers to the ratio of the duration of a positive pulse to the total pulse period in an ideal pulse sequence (such as a square wave).

(2) Control the X-axis range submodule

The submodule XscaleControl.VI is used to dynamically control the X-axis range of the waveform. It has 4 input pins, 3 of which are reference inputs and one is a constant input pin. As the frequency of the input signal increases, if the X-axis range of the output waveform is fixed to 1, the waveform display will be too dense, resulting in a unclear graph. Therefore, when the frequency increases, the X-axis range of the waveform needs to be relatively reduced to make the waveform display clearer. The three reference input pins refer to the property nodes (propertynode) of the three original controls, namely, the sine wave frequency, the triangle wave frequency, and the waveform control WaveformGraph. The internal working principle is that when either the sine wave frequency or the triangle wave frequency is greater than 10HZ, the reciprocal value of the larger frequency of the two frequencies is used as the maximum value of the horizontal axis of the waveform control WaveformGraph, realizing the function that the waveform is still clear when the analog signal frequency increases, thereby realizing the dynamic control of the range of the x-axis of the waveform control.

XscaleControl

(3) Waveform analysis submodule

LabVIEW provides a variety of waveform spectrum analysis tools, the most typical of which is Amplitude and Level Measurement.VI. Its storage path is Functions->Signal Analysis in the back panel. The parameter dialog box is divided into four areas, namely the items for amplitude characteristic value calculation (Amplitude Measurements), the results of the current signal amplitude calculation (Results), the input signal preview window (Input Signal) and the windowed signal preview window (Result Signal). The most important of these is the setting of the amplitude characteristic value calculation item. If you need to calculate a characteristic value, just tick it in front of it, and Amplitude and Level Measurement.VI will automatically add this output port in its icon. The functional pins of spectrum analysis Amplitudeand Level Measurement.VI are shown in Figure 7.

Spectrum Analysis Amplitude and Level Measurement.VI Function Pin

This module has 3 input pins and 8 output pins. The 3 input pins are as follows: "Restart Averaging" pin indicates whether to restart the selected averaging process, the default is False; "Signals" pin is the input signal to be analyzed; "error in (no error)" pin is a description of the error condition if it occurs before executing this VI; 8 output pins are as follows: "RMS" pin refers to the root mean square value of the signal; "Positive Peak" pin refers to the positive peak value; "error out" pin refers to the output information when the subVI executes an error; "Cycle Average" pin refers to the average value of one cycle; "Cycle RMS" pin refers to the root mean square value of one cycle; "Mean (DC)" pin refers to the signal mean; "Negative Peak" pin refers to the negative peak value; "Peak to Peak" pin refers to the peak-to-peak value, that is, the maximum positive and negative amplitude values ​​of the input signal waveform.

By using the two signals generated by simulation as the input pin "Signals" of this VI, the generated signals can be analyzed to output some parameter information of the signal, such as the signal mean, peak value and RMS value of a cycle.

Another typical signal analysis VI is FFTSpectrum(Real-Im).VI, which can calculate the fast Fourier transform spectrum of the input time domain signal and return the real spectrum and imaginary spectrum of the waveform respectively. In practical applications, it is also very meaningful to analyze the real spectrum and imaginary spectrum. The functional pins of Fourier spectrum transform FFT Spectrum.VI are shown in Figure 8.

VI function pin

This module has 10 pins. The "restart averaging (F)" pin has the same function as mentioned above, and is used to indicate whether to restart the selected averaging process; the "time signals" pin identifies the input time domain signal; the "window" pin refers to the windowing setting, and the windowing method includes many different methods, such as Uniform, Hanning, Hamming and Blackman; the "error in (noerror)" pin and the "error out" pin identify the input and output information when an error occurs when executing this VI; the "averaging parameters" pin refers to the averaging parameters of the input waveform signal; the "real parts" pin identifies the real spectrum of the waveform, and the output can be an intuitive description of the graph image or a description of a bunch of parameters; the "imaginary parts" pin refers to the imaginary spectrum of the input waveform, and the description method is the same as the real spectrum; the other two pins, the "averaging done" pin and the "averages completed" pin, are generally not used, and are descriptions of some uncommon parameters of the input waveform. [page]

(4) Filter and amplitude-frequency/phase-frequency characteristic submodule

The filter submodule is in the Functions->Signal Analysis sub-template. Its settings are divided into four areas, namely filter parameter settings (Filtering Type), two preview windows and preview mode settings area (VIew Mode). There are four types of filters, namely high-pass, low-pass, band-pass and smoothing filters. The first three are easy to understand, while smoothing filters are mainly used to perform local averaging of signals and eliminate periodic noise or white noise. The function pins of the low-pass filter submodule Filter.VI are shown in Figure 9.

Low-pass filter submodule Filter

The functional pins of the bandpass filter submodule BandFilter.VI are shown in Figure 10. As the name implies, a bandpass filter means that waveforms with frequencies within a certain range can pass through. It has one more pin, Upper Cut-Off, than the low-pass filter in Figure 9.

BandFilter submodule

(5) Data storage submodule

The data saving submodule is SaveData.VI function pins as shown in Figure 11. It processes the data to be saved into a unified format and saves it to a text file when the system exits.

The data saving submodule is SaveData

Among them, only two pins are output terminals, namely "string" and "system date and time", which represent the formatted output string and the current system date and time respectively. The format of a record of the output terminal "string" in the system automatic storage file is as follows:

"Cycle average value: -0.258667 Positive peak value: 2.845332 Signal RMS value: 2.845332 3dB bandwidth: 392.968235.

August 21, 2007 12:21:32". Among them, "cycle average value" means the signal average value of the waveform signal in one cycle; "positive peak value" means the maximum amplitude value reached by the waveform signal; "signal root mean square value" means the value of the waveform signal calculated by the root mean square formula; "3dB bandwidth" means the bandwidth amplitude value calculated by the subVI; the last one represents the date and time when the record is stored. The Format function provided by LabVIEW is mainly used. By formatting multiple Chinese strings and a number into the same string "string" through the Fromat function, it prepares for saving data when the system exits. If the saved data is put into the while loop, the program will be looped due to constant prompts to save data.

In Figure 11, there are six input pins, among which the "RMS" pin represents the cycle average value of the signal, the "Positive Peak" pin represents the maximum positive peak value, the "CycleAverage" pin represents the RMS value of the signal, the "detected frequencies" pin refers to the detected frequency, and the "3db bandwidth" pin and the "upper bandwidth" pin are calculated by a nested sub-VI, namely Compute 3db bandwidth.VI.

3 Conclusion

The virtual spectrum analyzer based on the LabVIEW programming environment mainly realizes two functions: time domain analysis and frequency domain analysis. The time domain analysis of the signal mainly measures the characteristic values ​​of the test signal after filtering. These characteristic values ​​represent certain time domain characteristics of the signal with a numerical value, which is the simplest and most intuitive time domain description of the test signal. After the test signal is collected on the computer, the signal characteristic value is processed in the test VI, and the characteristic value of the signal is intuitively displayed on the front panel of the test VI, which can provide the user of the test VI with a quick way to understand the changes of the test signal. The characteristic values ​​of the signal are divided into amplitude characteristic values, time characteristic values ​​and phase characteristic values. This paper designs the analysis of amplitude characteristic values.

Frequency domain analysis of signals is to estimate and analyze the composition and characteristic quantities of signals based on the frequency domain description of signals. In other words, it is to study the frequency structure of signals, that is, to find the distribution law of the amplitude and phase of its components according to the frequency, and to establish various spectra with frequency as the horizontal axis. For periodic signals, they can be expanded into Fourier coefficients, and their spectrum has discreteness, harmonicity and convergence; for non-periodic signals, the frequency density function can be used to analyze their frequency composition, and their spectrum has continuity.

Frequency domain analysis includes spectrum analysis, power spectrum analysis, coherence function analysis and frequency response function analysis. This paper implements spectrum analysis, that is, the amplitude-frequency characteristic and phase-frequency characteristic of the signal.

Keywords:LabVIEW Reference address:Design and Implementation of Virtual Spectrum Analyzer Based on LabVIEW

Previous article:Design of esophageal motility detection system based on LabVIEW
Next article:Design of Virtual Oscilloscope Based on LabWindows/CVI

Recommended ReadingLatest update time:2024-11-17 02:27

Labview video acquisition IMAdx
grab (continuous acquisition) After the camera is turned on, it will continue to collect images and store them in the temporary space opened by IMAQ. As long as the while loop keeps reading the temporary space, the current image can be displayed (grab calls the image handle)
[Test Measurement]
Labview video acquisition IMAdx
Labview editing and debugging virtual instruments
Editing Technology At the end of the previous chapter, we wrote a simple Labview program. Now we will discuss the various editing techniques in the front panel and flowchart. 1. Create: In the previous chapter, we introduced the most commonly used creation method, which is to select with the mouse and then place i
[Test Measurement]
Labview editing and debugging virtual instruments
Research on the realization method of database establishment and management function in LabVIEW
  In LabVIEW, we use the ActiveX function to call the Microsoft ADO control, and then use the SQL language to access the database through the underlying ODBC interface function and ODBC database driver. The structural hierarchy is shown in Figure 1.     The goal of ADO is to access, edit, and update data sources
[Test Measurement]
Research on the realization method of database establishment and management function in LabVIEW
Virtual Instrument for Pulse and Transition Process Measurement Based on LabVIEW Platform
1 Introduction Virtual instrument VI (Visual Instrument) is a kind of instrument system that uses powerful computer hardware and software resources as the support of the instrument, and uses high-performance modular hardware combined with efficient and flexible software to complete various test, measurement and autom
[Test Measurement]
Virtual Instrument for Pulse and Transition Process Measurement Based on LabVIEW Platform
Humidity Sensitive Component Performance Test and Analysis System Based on LabVIEW
0 Introduction Humidity sensors are used for humidity monitoring and automatic control of local environments. In recent years, with the emergence of new materials (such as rare earth doping) and the production of nano-level components, people have increasingly studied their electrical characteristics, humidity s
[Test Measurement]
Humidity Sensitive Component Performance Test and Analysis System Based on LabVIEW
LabVIEW Programming Patterns (V) - Producer/Consumer Pattern (2)_VI Reentrancy
Before introducing the dynamic calling of VI, it is necessary to have a general understanding of the rules of LabVIEW in the process of executing VI. As we all know, LabVIEW represents independent VIs by the file name (VI Name) of the VI, not the path of the VI. Therefore, LabVIEW does not allow VIs with the same name
[Test Measurement]
LabVIEW Programming Patterns (V) - Producer/Consumer Pattern (2)_VI Reentrancy
Rapidly build medical equipment based on LabVIEW
The 21st century is the century of life and health. The rapid progress of life sciences has continuously promoted human understanding of their own health and diseases. How to develop innovative medical electronic equipment has also become one of the research hotspots. The research content of medical equipment involve
[Test Measurement]
Rapidly build medical equipment based on LabVIEW
Bit Error Rate Testing Using R Series Intelligent Data Acquisition
Author(s): Stephen Kulakowski - Harris RF Communications Division Industry: Aerospace/Avionics, Telecommunications, RF/Communications, Government/Defense Products: Data Acquisition, Digital I/O, LabVIEW, PXI/CompactPCI, FPGA Module The Challenge: Replace traditional box-based instru
[Test Measurement]
Bit Error Rate Testing Using R Series Intelligent Data Acquisition
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号