How to determine phase shift

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

 Risposta accettata

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')
T1 = 201×3 table
Freq(Hz) MAT1(DEG) MAT2(DEG) __________ _________ _________ 3e+05 32.728 25.08 2.2798e+07 10.427 164.8 4.5297e+07 86.034 9.4404 6.7796e+07 159.68 169.17 9.0294e+07 74.432 162.38 1.1279e+08 152 108.78 1.3529e+08 22.797 -92.03 1.5779e+08 -31.374 -170.59 1.8029e+08 -5.1939 -116 2.0279e+08 29.483 81.739 2.2528e+08 -22.492 -57.782 2.4778e+08 -67.007 113.04 2.7028e+08 -137.61 -3.1447 2.9278e+08 -46.927 53.483 3.1528e+08 -58.902 144.16 3.3778e+08 174.11 31.828
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.
.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by