How to unwrap the phase of a complex electrical impedance signal
52 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone,
I have a problem with unwrapping a phase. The real and imaginary parts of the phase are named as 'real_part' and 'imaginary_part, respectively, and attached to this question. When I plot the phase using atan2 function, I see a big jump in phase data. I tried to unwrap it using Matlab's unwrap function but it also did not work. The results are as shown:
Here is the code that I used:
phase = atan2(imaginary_part, real_part) * 180/pi;
phase_unwrapped = unwrap(atan2(imaginary_part, real_part)) * 180/pi;
fig_Phase = figure('Visible', true, 'Units', 'inches', 'Position', [0 0 20 20]);
subplot(1,2,1);semilogx(Frequency,phase,'b','LineWidth',2, 'DisplayName', 'Wrapped Phase');hold on
axis square; legend();
xlabel('Frequency (Hz)');
ylabel('Phase (degree)');
set(gca,'fontsize',28);box on;
xticks([1e0 1e1 1e2 1e3 1e4 1e5 1e6]);
subplot(1,2,2);semilogx(Frequency,phase_unwrapped,'r','LineWidth',2, 'DisplayName', 'Unwrapped Phase');
axis square; legend();
xlabel('Frequency (Hz)');
ylabel('Phase (degree)');
set(gca,'fontsize',28);box on;
xticks([1e0 1e1 1e2 1e3 1e4 1e5 1e6]);
hold off;
Could anyone help me fix this problem? The phase cannot be less than -90 degrees since this is a measuremental data. The phase jump occurs due to some simple operations.
5 Kommentare
Mathieu NOE
am 10 Okt. 2023
hello again
maybe the error is somewhere in the intermediate computations - have you somehow checked each individual measurement vs theory ?
Antworten (1)
Sayan
am 12 Dez. 2023
Hi Easa AliAbbasi,
I understand from your issue that the "Phase" plot of your readings are not as expected.
I do not think there is any issue with the code.However,you mentioned in the comments that the "real_part" of the reading is of the resistance and the "imaginary_part" is of the capacitance reactance value, which implies that the "real_part" should always be positive and the "imaginary_part" should always be negative. I have these two observations about the data.
- From the 29th row of "real_part.mat" the value becomes negetive, but the resistance value cannot be negetive.
- From the 45th row of the "imaginary_part.mat" the value becomes positive, but the capacitive reactance value cannot be positive.
Those are the reasons that I think the issue is with the measured data. Whenever there is a change of sign in the data, the "atan2" and "unwrap" functions provide unexpected results.
You can find more information on "atan2" and "unwrap" in the following documentations.
- "atan2" : https://www.mathworks.com/help/releases/R2021b/matlab/ref/atan2.html#buct8h0-4
- "unwrap" : https://www.mathworks.com/help/releases/R2021b/matlab/ref/unwrap.html#mw_1884ee59-182e-4ef6-a323-ee5a45b76693
Hope this helps in resolving the issue.
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!