Purpose
The waveform displayed by the oscilloscope is as follows, and the phase difference between the two columns of signals needs to be obtained through MATLAB processing.
step
Insert the USB flash drive into the oscilloscope and store the signal sequence. Read this .CSV signal sequence file in MATLAB and process it to obtain the phase difference. code show as below:
clear all
close all
%Read data
t=xlsread('A2.CSV','A2','A1:A500');%Read time series
x=xlsread('A2.CSV','A2','B1:B500');%Read reference signal
x1=xlsread('A2.CSV','A2','C1:C500');%Read the signal to be measured
subplot 211;
plot(t,x,'b-');hold on;
plot(t,x1,'r--');grid;
legend('Reference','Signal');title('Origin');
%Data normalization
m1=(max(x)+min(x))/2;
m2=(max(x1)+min(x1))/2;
x=(x-m1)/max(x);
x1=(x1-m2)/max(x1);
subplot 212;
index=find(x==0);
plot(t,x,'b-');hold on;
plot(t,x1,'k--');grid;
hold on;
legend('Reference','Signal');title('Normalization');
num=500; %number of data
l=0:1:num;
x=x;
y=x1;
Ix=sum(x.^2)/num;
Iy=sum(y.^2)/num;
Ixy=sum(x.*y)/num;
c=180*acos(Ixy/(Ix*Iy)^0.5)/pi; %Calculate phase difference
%disp(['Phase difference is',num2str(c), 'degree']);
output = sprintf('Phase difference is %f degrees', c);
output
result
Previous article:Experiment - measuring phase difference with oscilloscope method (test record)
Next article:Oscilloscope calibration and Lissajous figure
- Popular Resources
- Popular amplifiers
- 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?
- In what situations are non-contact temperature sensors widely used?
- How non-contact temperature sensors measure internal temperature
- 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
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] Part 2: Preliminary understanding of hardware + Bluetooth control of light switches
- Characterization of Integrated RF Hardware in 5G Applications
- How does TTL inverter work?
- Giant microbit (giga:bit)
- Renesas CPK-RA6M4 Development Board Review + Unboxing and Building Environment
- Has anyone used the ionizing radiation sensor module? Discuss some technical issues
- RS-485 communication interface encoder
- FPGA Implementation of Fully Parallel FFT
- RT-Thread has been ported to W600
- MakeCode now supports STM103