How to find Angle of Impedence?

조회 수: 2 (최근 30일)
Muhammad Hamza
Muhammad Hamza 2023년 3월 16일
댓글: Muhammad Hamza 2023년 4월 4일
Hello,
I am using fft to find amplitude of current and amplitude of voltage seperately.And then using angle command to determine angles of them respectively.But now I want to find Angle of Impedence as well,For that I am dividing the voltage amplitude by current amplitude and fortunately getting the correct impedence as well.But after that when i try to find the angle of Impedence I am not getting the correct angle.Could some body tell me why I am not getting the correct angle?.What is the problem or what should i need to do?. Thanks in advance.
For Example.
Impedence=(AmplitudeV/AmplitudeI);
Theta=angle(Impedence);
Is it the correct way to find Impedence using fft?
Please note that I am a new user of MATLAB,So apologies in advance if you feel that question is very basic.
  댓글 수: 7
Muhammad Hamza
Muhammad Hamza 2023년 3월 20일
No still not getting the correct angle.Tried both methods but same result,Getting the desired impedence but not the desired angle,Please see my above detailed explanation again. Thanks
Star Strider
Star Strider 2023년 3월 20일
I am not certain what you are actually doing.
Consider something like this —
Fs = 1000; % Sampling Frequency (Hz)
t = linspace(0,10*Fs-1,10*Fs).'/Fs; % Assume Column Vectors
% Check = 1/(t(2)-t(1))
Fr = 250; % Signal Frequency
I = sin(2*pi*Fr*t); % Current Signal
V = 10*cos(2*pi*Fr*t); % Voltage Signal
Fn = Fs/2; % Nyquist Frequency (Hz)
L = numel(t); % Signal Length
NFFT = 2^nextpow2(L); % For Efficiency
FT_V = fft(V.*hann(L), NFFT)/L; % Voltage Fourier Transform (Windowed)
FT_I = fft(I.*hann(L), NFFT)/L; % Current Fourier Transform (Windowed)
Fv = linspace(0, 1, NFFT/2+1)*Fn; % Frequency Vector (One-Sided Fourier Transfomr)
Iv = 1:numel(Fv); % Index Vector (For Convenience)
figure
subplot(2,1,1)
plot(Fv, abs(FT_V(Iv))*2)
grid
ylabel('Magnitude')
subplot(2,1,2)
plot(Fv, rad2deg(angle(FT_V(Iv))))
grid
ylabel('Phase (°)')
sgtitle('Voltage')
figure
subplot(2,1,1)
plot(Fv, abs(FT_I(Iv))*2)
grid
ylabel('Magnitude')
subplot(2,1,2)
plot(Fv, rad2deg(angle(FT_I(Iv))))
grid
ylabel('Phase (°)')
sgtitle('Current')
FT_Z = FT_V ./ FT_I;
figure
subplot(2,1,1)
plot(Fv, abs(FT_Z(Iv))*2)
grid
ylabel('Magnitude')
subplot(2,1,2)
plot(Fv, rad2deg(angle(FT_Z(Iv))))
grid
ylabel('Phase (°)')
sgtitle('Impedence')
Windowing the Fourier transform reduces the amplitude of the resulting peaks by ½.
.

댓글을 달려면 로그인하십시오.

채택된 답변

Muhammad Hamza
Muhammad Hamza 2023년 4월 4일
Hello Everyone,
My problem was solved sorry for informing late.
Best Regards,
Muhammad Hamza.
  댓글 수: 3
Star Strider
Star Strider 2023년 4월 4일
What was the solution?
Muhammad Hamza
Muhammad Hamza 2023년 4월 4일
There wee two things which I corrected,
1)The reference data I was working on was not accurate enough especially with floating numbers,Matlab by default showed me 4 digits after decimal so I have to change it to long g to get more precise results.
2)Another problem was solved by subtracting my angle values from 180,I guess the reason I found is that Matlab was returning me pi when I have negative real numbers and 0 when I have non negative real numbers.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Swaraj
Swaraj 2023년 4월 4일
You should take into consideration that there can be phase difference between the voltage and the current signals. One way is to use the complex Impedance Formula. It can be calculated as the ratio of the complex Voltage to Complex Current.
Z = V/I
Here V and I are Complex Numbers.
Then try using the angle function as “angle(Z)”.

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by