Computes the Total Harmonic Distortion (THD) of a signal

バージョン 1.0.0.0 (2.72 KB) 作成者: yoash levron
Useful in power systems and audio systems
ダウンロード: 3.6K
更新 2013/2/22

ライセンスの表示

function [ THD, ph, amp ] = compute_THD( t,x, freq )

Written by Dr. Yoash Levron
February 2013.

Computes the Total-Harmonic-Distortion (THD)
of a signal x(t). The amplitude and phase of the basic harmonic are also computed. These values are typically useful in power systems, audio signal processing, and other related fields.

The function computes the basic harmonic
of the signal, in the form:
x(t) = amp*cos(w*t - ph) + (higher Harmonics)
where : w = 2*pi*freq
so 'amp' and 'ph' are the phase and amplitude
of the basic harmonic.
DC offset does not affect THD.

inputs:
t - [sec] time vector. (should be periodical with basic harmonic 'freq')
x - signal vector.
freq - [Hz] frequency of the basic harmonic.

outputs:
THD - total harmonic distortion (the scale is 1 = 100%).
ph - [rad] phase of the basic harmonic.
amp - Amplitude of the basic harmonic.

引用

yoash levron (2024). Computes the Total Harmonic Distortion (THD) of a signal (https://www.mathworks.com/matlabcentral/fileexchange/40455-computes-the-total-harmonic-distortion-thd-of-a-signal), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2006a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersSpectral Measurements についてさらに検索
コミュニティ

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0