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
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.
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.
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.
[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.
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
(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.
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.
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.
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.
(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.
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.
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
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- EEWORLD University Hall----Live Replay: Future Perception is Predicted by Me-The Latest Application of Sensors in the Internet of Things
- China's vibrant printed circuit industry
- 5G system core capability indicators
- [Shanghai Hangxin ACM32F070 development board] Light up the LCD screen and touch button function operation, drive the buzzer evaluation
- JTAG debug mode exception handling
- What is EMF testing? What is the difference between EMF and EMC testing?
- Recruiting part-time k8s, devops and other consultants or lecturers
- Commonly used algorithms for drones - Kalman filter (VI)
- Serial port experiment
- IoT products have more and more functions. How can we solve the problem of insufficient MCU memory?