Digital oscilloscopes are high-performance oscilloscopes made with a series of technologies such as data acquisition, A/D conversion, and software programming. Digital oscilloscopes generally support multi-level menus, which can provide users with a variety of choices and analysis functions. Some oscilloscopes can also provide storage to save and process waveforms. At present, high-end digital oscilloscopes mainly rely on American technology. For oscilloscopes within 300MHz bandwidth, domestic brands of oscilloscopes can compete with foreign brands in performance and have obvious cost-effectiveness advantages. Digital oscilloscopes are becoming increasingly popular because of their unique advantages such as waveform triggering, storage, display, measurement, and waveform data analysis and processing. Due to the large performance difference between digital oscilloscopes and analog oscilloscopes, if used improperly, large measurement errors will occur, thus affecting the test tasks.
1 Communication Principles
MATLAB is a high-tech computing environment released by MathWorks, an American company, mainly for scientific computing, visualization and interactive programming. It integrates many powerful functions such as numerical analysis, matrix calculation, scientific data visualization, and modeling and simulation of nonlinear dynamic systems in an easy-to-use window environment, providing a comprehensive solution for scientific research, engineering design and many scientific fields that must perform effective numerical calculations. It has largely gotten rid of the editing mode of traditional non-interactive programming languages (such as C and Fortran), and represents the advanced level of international scientific computing software today. MATLAB, Mathematica and Maple are known as the three major mathematical software. It is second to none in numerical computing among mathematical science and technology application software. MATLAB can perform matrix operations, plot functions and data, implement algorithms, create user interfaces, connect programs in other programming languages, etc. It is mainly used in engineering computing, control design, signal processing and communication, image processing, signal detection, financial modeling design and analysis and other fields.
The Instrument Control Toolbox in Matlab consists of two major components: M-file functions and interface driver adapters. These two components provide the communication function between Matlab and peripherals. The communication principle with the serial communication port is shown in Figure 1.
As shown in Figure 1, the two major components of Matlab provide an interactive channel between the peripheral and Matlab, allowing users to obtain and transmit information between the peripheral. Like many high-level languages, Matlab creates a device object by calling the M file function to obtain the file handle of the device. The device driver, as a module in the operating system that directly controls the hardware, is a key module that links the operating system kernel and the I/O operations of the system's external devices. It hides the specific hardware details to achieve transparency of peripheral operations, so Matlab can implement read and write operations on peripherals like operating files. The data transmission format, input and output buffer size, and read and write overflow time during reading and writing are defined by the attribute values in Figure 1, which are based on the specific communication port, communication method, and data size. The events and states generated by the oscilloscope are saved by the oscilloscope in the standard event status register (SESR), the status byte register (SBR), and the event queue for (Matlab) callback functions to read. At the same time, users can control which events or states are saved in the status register and event queue by setting the three enable registers: device event status enable register (DESER), event status enable register (ESER), and service request enable register (SRER). Matlab's setting query command for the oscilloscope is output in the form of a string by the fprintf function. The setting and query commands are defined by the specific oscilloscope manufacturer, and their format is: Header Arguments, with multiple parameters separated by commas. When reading and writing data of the oscilloscope waveform in binary format, the conversion between the read and write data and the actual data of the oscilloscope is given by the following formula:
Xn=Xzero+Xincr·n
Yn=Yzero+Ymult(yn-Yoff) (1)
Among them, yn is the data in the input and output buffers, n is the number of data, and Xn and Yn are the actual sampling time and signal amplitude in the oscilloscope.
2 Data Transmission
In the field of communication, there are two data communication modes: parallel communication and serial communication. With the development of computer networking and hierarchical distributed application systems of microcomputers, the function of communication is becoming more and more important. Communication refers to the transmission of information between computers and the outside world, including both transmission between computers and transmission between computers and external devices such as terminals, printers and disks. Serial communication refers to the use of a data line to transmit data one bit at a time, with each bit of data occupying a fixed length of time. It only requires a few lines to exchange information between systems, and is especially used for long-distance communication between computers and computers, and between computers and peripherals. [page]
RS-232 serial communication interface is widely used in the mutual communication between computers and terminals at short distances. TDS210 oscilloscope is also equipped with RS-232 interface with DB9 plug-in. When hardware handshake is used for communication control, the oscilloscope uses three control signals CD, CTS, and RI to indicate its current state, while Matlab uses RTS signal to request data transmission. Since the asynchronous communication protocol does not require strict clock synchronization between the two communicating parties, the start bit of the data is used as the synchronization signal for the communication between the two parties. Therefore, asynchronous communication is used between Matlab and the oscilloscope. The part of the program compiled to read data from the oscilloscope is as follows:
%Create device object
g = Serial('COM1');
%Communication initialization g.InputBufferSize=10000;
g.timeout=10;
%Set the transmission baud rate to 9600b/s, the character format to: 8 data bits, 1 stop bit, terminator to LF, no parity bit, use hardware handshake.
g.BaudRate=9600;
g.Parity='none';
g.StopBits=1;
g.Terminator='LF';
g.FlowControl='hardware';
%Connect device object
fopen(g)
%data transmission
fprintf(g,'select: refa on');
fprintf(g,'data:source refa');
fprintf(g,'data:encdg srib');
fprintf(g,'data:start 1');
fprintf(g,'data:stop 2500');
fprinft(g,data:width 2');
fprintf(g,'wfmpre:xzero?');
xzero = fscanf(g,'%f');
fprintf(g,'wfmpre:xincr?');
xincr = fscanf(g,'%f');
fprintf(g,'wfmpre:yzero?');
yzero = fscanf(g,'%f');
fprintf(g,wfmpre:ymult?');
ymult = fscanf(g,'%f');
fprintf(g,'wfmpre:yoff?');
yoff = fscanf(g,'%f');
fprintf(g,'curve?');
out=fread(g,2500,'int16');
%Release device objects and ports
fclose(g);
delete(g);
freeserial('com1');
The square wave signal read by the oscilloscope using the above program is shown in Figure 2.
3 Data Analysis and Examples
The data read from the oscilloscope is converted according to formula (1) to achieve the measured waveform data value, and the corresponding sampling frequency is 1/Xincr. The signal in L1 space meets the absolute integrability condition, and the spectrum analysis can be directly performed using the fast Fourier transform algorithm. Figure 3 shows the FFT result of the read square wave. Since the interception of the sampled signal is equivalent to adding a rectangular window to the signal, it will inevitably cause spectrum leakage and aliasing. Under the conditions of satisfying the sampling theorem and ensuring the integrity of the oscilloscope waveform cycle, the spectrum analysis result is independent of the number of waveform cycles obtained by the oscilloscope. The power spectrum estimation can be performed for the noise signal, and the power spectrum estimation of the above sampled signal is shown in Figure 4.
From the above data communication process and the example of spectrum analysis and power spectrum estimation of sampled signals, it can be seen that Matlab and oscilloscope form a signal acquisition and analysis system, in which the oscilloscope plays the role of data acquisition and storage, while Matlab realizes the analysis and processing of the sampled signals.
Previous article:Briefly describe the effects of digital oscilloscope dead time and waveform capture rate on measurement results
Next article:Why is the impedance of the oscilloscope 1M and 50 ohms?
- Popular Resources
- Popular amplifiers
- 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?
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Power Supply Ripple Measurement Setup (Oscilloscope)
- c8051F060 program download problem
- 1
- Can a bandpass filter be powered from a single supply?
- Discussion on Graphical Programming Method of Single Chip Microcomputer
- Op amp problem
- MSP430 MCU Basics
- Evaluation Invitation Ticket Record Form
- Smart IoT Student Dormitory Based on RSL10
- [Voice and vision module based on ESP32S3] Software development progress - module camera initialization process