how to find the phase difference between two sinus waves which are loaded from different files and when you know the no of samples and no of samples per period?
Mostra commenti meno recenti
if true
load case_1_wf1
load case_1_wf2
nb_samp = 20000;
nb_samp_per_period = 19;
nb_samp_per_period_integer = ceil(nb_samp_per_period);
n=1:20000
subplot(5,1,1);
plot(n,Sr1);
subplot(512)
plot(n,Sr2);
mphi(1) = measure_phase_shift_method_mult(Sr1,Sr2,nb_samp_per_period);
k = 1; for i=1:nb_samp_per_period_integer:nb_samp-nb_samp_per_period_integer, [Y1(k),X1(k)] = max(Sr1(i:i+nb_samp_per_period_integer)); [Y2(k),X2(k)] = max(Sr2(i:i+nb_samp_per_period_integer));
k = k+1;
end
[d,s] = size(X1);
d12 = X1 - X2;
v12 = sum(d12)/s;
o= v12 * 2 * pi / nb_samp_per_period ;
function [p] = measure_phase_shift_method_mult(s1,s2,nb_samp_per_period) global Nb_samp;
% % generation of mult array m12 = s1 .* s2;
av = (max (m12) + min(m12)) / 2;
% Phase shift expressed in radian cosa = 2*av;
p = acos(cosa); % p = acos(2*av);
end
here i have used two methods to find the phase shift but i am not getting the right answer
Risposte (1)
Gilberto Balthazar
il 25 Mag 2018
Modificato: Gilberto Balthazar
il 25 Mag 2018
Steps for the determining of the phase shift between two sinusoidal graphs having .text files coming from two any sources and distinct.
First step Normalize the two sinusoidal graphs, Yk/Ymax or Yk/abs(Ymin) , turning so every points of the graphs (samples) limited to the interval -1<= Xk <=1 ;
Second step Detect any two consecutive zero-crossings from the table of values (samples) for both the sinusoidal graphs. Keep then anyone from these two phase shifts as the wanted phase shift between the two sinusoidal graphs given.
Third step In the steps 1 and 2, we have results that are applicable to the case "same frequencies" for the two sinusoidal waves. In this step, we will show the more general case "different frequencies". - Harmonic Components To know if the two sinusoidal waves are forming a set of two harmonic components (being the fundamental component that wave with lower frequency and the other wave the n-esima harmonic component), it must be verified the following equality : FP(wn/w0) = FP(2π*fn/2π*f0) = FP(fn/f0) = 0 ,
once that the harmonic component frequency
occurs in integer multiples of the
fundamental component.
- Intervals of Phase Shifts Let's consider two intervals for Phase Shifts phi : 0°<= phi <=90° , 90°< phi <=180° (anti-phase)
- Shift Phase Keep anyone zero-crossing from the table of values (samples) for the fundamental component wave (that with the lower frequency), within a T/2 period of the table. Then, at the boundaries of this zero- crossing, look for the zero-crossing of the harmonic component (other wave, with the greater frequency). The difference between these two zeroes-crossing is the wanted Phase Shift.
Categorie
Scopri di più su Array Geometries and Analysis in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!