finding rms of fundamental and thd using csv file
41 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
오은 권
am 15 Okt. 2020
Kommentiert: Ricky K
am 16 Okt. 2020
sampling 50us voltage frequency 60hz the file is the measurements for the input voltage. I used plot to see the graph, but I'm not sure how to find the rms of the fundamental of the input voltage and also the thd.
I'd really appreciate some help.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 15 Okt. 2020
The Fourier transform plot illustrates the harmonics, so you can use as mazzny of them as you want in the calculation (I chose the first 10 here):
D = readmatrix('data_kcube.csv');
t = D(:,1);
s = D(:,2);
Q1 = D(1:10,:);
Fs = 1/mean(diff(t));
Fn = Fs/2;
L = size(D,1);
FTs = fft(s)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
figure
plot(Fv, mag2db(abs(FTs(Iv))*2))
grid
xlabel('Frequency (Hz)')
ylabel('Power (dB)')
xlim([min(Fv) max(Fv)])
THD = thd(s,Fs,10);
RMS = rms(s);
figure
plot(t, s)
grid
xlabel('Time (s)')
ylabel('Amplitude (V)')
text(0.02, 150, sprintf('THD = %8.3f dBc\nRMS = %8.3f V', THD, RMS))
.
5 Kommentare
Ricky K
am 16 Okt. 2020
Hello
Could you help me out with this problem plz
I would really appreciate some help if possible
https://kr.mathworks.com/matlabcentral/answers/615758-finding-sampling-rate-and-real-power?s_tid=prof_contriblnk
Weitere Antworten (1)
Ameer Hamza
am 15 Okt. 2020
You can calculate the rms value of voltage using following lines of code
x = readmatrix('data_kcube.csv');
t = x(:,1);
V = x(:,2);
V_rms = sqrt(mean(V.^2));
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!