How to determine phase shift
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Kabit Kishore
il 27 Ott 2021
Risposto: Star Strider
il 27 Ott 2021
I have obtained phases (In degrees) for two different material at different frequences. How do i calculate the phase shift between the two. I have attached the data. Initially i just subtracted the two values but i think that approach is wrong. Any help will be appreciated.
Kind regards
0 Commenti
Risposta accettata
Star Strider
il 27 Ott 2021
Subtracting them is likely appropriate, however unwrapping them first will likely produce the correct result.
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/780738/DATA.xlsx', 'VariableNamingRule','preserve')
Fv = T1.('Freq(Hz)');
MAT1 = T1.('MAT1(DEG)');
MAT2 = T1.('MAT2(DEG)');
figure
plot(Fv, MAT1, Fv, MAT2)
grid
MAT1r = deg2rad(MAT1);
MAT1ru = unwrap(MAT1r);
MAT2r = deg2rad(MAT2);
MAT2ru = unwrap(MAT2r);
figure
yyaxis left
plot(Fv, MAT1ru, Fv, MAT2ru)
ylabel('Unwrapped Phase (rad)')
yyaxis right
plot(Fv, MAT1ru-MAT2ru)
ylabel('Phase Difference (rad)')
grid
legend('MAT_1','MAT_2','Difference', 'Location','best')
xlabel('Frequency (Hz)')
It is necessary to convert them to radians before unwrapping them. I kept them as radians here, so use the rad2deg fucntion to convert them back to degrees if desired.
.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surrogate Optimization in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

