Calculate the THD in percent

29 ビュー (過去 30 日間)
Meikel Vollmers
Meikel Vollmers 2021 年 6 月 16 日
回答済み: Arthi Sathyamurthi 2021 年 7 月 27 日
Hey Community,
i try to calculate the THD of a current signal in percent. This is my code
thd_db = thd(ac_current_a.data);
thd_percent = 100*(10^(thd_db/20));
The result of the attached data is 0.88%. But when i analyze the signal with the FFT analysis tool of the powergui, the THD is about 12%, which is more realistic.
I think i have to expand my code with some information, i.e. the fundamental frequency, the number of cycles and so on as it must be done in the FFT Tool.
How can i modify my code to get the correct THD?
  1 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 6 月 30 日
tried to open the zip but it failed (??)

サインインしてコメントする。

回答 (1 件)

Arthi Sathyamurthi
Arthi Sathyamurthi 2021 年 7 月 27 日
Hello Meikel,Your attached zip file looks corrupted. Try attaching it again for a more precise support. From the other information provided, thd_db = thd(ac_current_a.data) returns the total harmonic distortion (THD) in dBc of the real-valued sinusoidal signal ac_current_a.data. Hence be clear that the thd_db is in dBc and confirm that the ac_current_a.data is a real-valued sinusoidal signal. Also try the calculation of total harmonic distortion as thd(pxx,f,'psd') where the input pxx is the one-sided power spectral density (PSD) estimate othat can be obtained from the periodogram function. f is a vector of frequencies corresponding to the PSD estimates in pxx. You can look at the other ways of calculating the total harmonic distortion here.

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by