How to determine phase shift
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kabit Kishore
le 27 Oct 2021
Réponse apportée : Star Strider
le 27 Oct 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 commentaires
Réponse acceptée
Star Strider
le 27 Oct 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surrogate Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

