Why thd() function captures incorrect harmonics?

2 ビュー (過去 30 日間)
Ying Wu
Ying Wu 2022 年 10 月 4 日
コメント済み: Ying Wu 2022 年 10 月 7 日
Hi, I use thd() to calculate one time-domain singal, and I try three commands but all fails. Can anyone help me to solve this question? Thanks!
load signal.mat
% 1. time-domain signal as inputs
% error: the fundemental freq is captured, but the other five harmonics are not correctly captured)
thd(signal,100,6); xlim([0 0.3])
% 2. psd as inputs (same error)
[pxx,f] = periodogram(signal,rectwin(length(signal)),length(signal),100);
thd(pxx,f,6,'psd'); xlim([0 0.3]);
% 3. power spectural as inputs
[sxx,f] = periodogram(signal,rectwin(length(signal)),length(signal),100,'power');
rbw = enbw(rectwin(length(signal)),100);
thd(sxx,f,rbw,'power'); xlim([0 0.3]);

回答 (1 件)

Geetla Sindhu
Geetla Sindhu 2022 年 10 月 7 日
編集済み: Geetla Sindhu 2022 年 10 月 7 日
Hello Ying Wu,
I understand that you are trying to calculate THD of a signal using three approaches.
It would be helpful if you could elaborate more on how you are assuring that the results obtained through all the approaches are wrong. This is because we cannot manually calculate the THD for such a signal.
Thank you.
  1 件のコメント
Ying Wu
Ying Wu 2022 年 10 月 7 日
@Geetla Sindhu Hi Geetla, sorry about the unclear description of this question. To my knowledge, the definition of thd() in matlab is the ratio of sum of all harmonics amplitude to that of main frequency. In my case, I set the thd() to capture 6 frequencies including one main frequency (marked as "F" in blue in the figure) and 5 harmonics (marked from 2-5 in the orange in the figure). But obviously, the harmonics are not correctly captured like NO.2, 4, 6 are not harmonic peaks, while the real harmonics are not captured. So the calculated thd is also incorrect. Could you please help me to solve this problem?

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

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by