计算信号的总谐波失真(THD)

收录时间:2013-09-28
资源分类:Matlab 工具:MATLAB 7.2 (R2006a)

谐波失真(THD)指原有频率的各种倍频的有害干扰。放大1kHZ的频率信号时会产生2kHZ的2次谐波和3kHZ及许多更高次的谐波,理论上此数值越小,失真度越低。 由于放大器不够理想,输出的信号除了包含放大了的输入成分之外,还新添了一些原信号的2倍、3倍、4倍……甚至更高倍的频率成分(谐波),致使输出波形走样。这种因谐波引起的失真叫做谐波失真。

Computes the Total Harmonic Distortion (THD) of a signal

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.

文件下载列表
附件内容(只显示3中的2个)
compute_THD.m  compute_THD_example.m  
标签: 谐波失真 
更多

目前尚无评论

用户反馈   关于我们
Copyright (©) ZHIHUISHI.COM 2013 All Rights Reserved.
京ICP备14040384号