How to find Z (Impedance value) from FFT of Voltage and FFT of Current value ?

5 vues (au cours des 30 derniers jours)
Jaydeepkumar Patel
Jaydeepkumar Patel le 19 Sep 2018
%for voltage t=Vabc575.time; %t is simulation time v=Vabc575.signals.values; %y is the three phase voltage over simulation period L=1500000;%L is length of signal which is multiplication of total simulation time and sampling frequency m1=v(:,1); %m1 is magnitude of phase a Vmag=fft(m1); %fft of magnitude of phase a Ts=2e-06; %Ts sampling time Fs=1/Ts; %Fs sampling frequency Vmagfinal = abs(2.*Vmag./L); Vmag1 = Vmagfinal(1:L/100+1); df=Fs/length(t); %ratio of sampling frequency and no. of samples freq=0:df:Fs/100; %frequency to be displayed in plot, sample frequency is 500000,to bring in the range of 100 we are dividing by 5000 idx = (t> 2 & t <= 3); subplot(3,2,1), plot(t(idx),m1(idx)), title('output voltage waveform 5Hz harmonic'), xlabel('time'), ylabel('Voltage amplitude'); % plot of voltage waveform subplot(3,2,2), (stem(freq,Vmag1)); title('fft of voltage waveform'), xlabel('frequency'), ylabel('magnitude'); % plot of FFT of voltage wave
%for current t1=Iabc575.time; %t is simulation time i=Iabc575.signals.values; %y is the three phase voltage over simulation period L=1500000;%L is length of signal which is multiplication of total simulation time and sampling frequency m2=i(:,1); %m2 is magnitude of phase a current Imag=fft(m2); %fft of magnitude of phase a Ts=2e-06; %Ts sampling time Fs=1/Ts; %Fs sampling frequency Imagfinal = abs(2.*Imag./L); Imag1 = Imagfinal(1:L/100+1); df=Fs/length(t1); %ratio of sampling frequency and no. of samples freq=0:df:Fs/100; %frequency to be displayed in plot, sample frequency is 500000 to bring in the range of 100 we are dividing by 5000 idx1 = (t1> 2 & t1 <= 3); subplot(3,2,3), plot(t1(idx1),m2(idx1)), title('output current waveform 5Hz harmonic'), xlabel('time'), ylabel('current amplitude'); % plot of current waveform subplot(3,2,4), (stem(freq,Imag1)); title('fft of current waveform'), xlabel('frequency'), ylabel('magnitude');% plot of FFT of voltage wave
%for impedance t=Vabc575.time; %t is simulation time L=1500000;%L is length of signal which is multiplication of total simulation time and sampling frequency Vrms = sqrt(mean(m1.^2)); Irms=sqrt(mean(m2.^2)); z=(Vrms./Irms); %m3 is impedance Z=z*ones(15001,1); Ts=2e-06; %Ts sampling time Fs=1/Ts; %Fs sampling frequency df=Fs/length(t); %ratio of sampling frequency and no. of samples freq=0:df:Fs/100; %frequency to be displayed in plot, sample frequency is 500000,so to bring in the range idx = (t> 2 & t <= 3); subplot(3,2,5), (stem(freq,Z)); title('fft of impedance waveform'), xlabel('frequency'), ylabel('magnitude'); % plot of FFT of voltage wave

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by