MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > How do I calculate THD in MATLAB? 

Subject: How do I calculate THD in MATLAB? From: chikha said Date: 2 Feb, 2011 06:58:03 Message: 1 of 9 
How can I calculate THD (Total Harmonic Distortion) in a MATLAB file? Please note, I know I can do this in Simulink, I am looking for a way to do this from MATLAB directly. 
Subject: How do I calculate THD in MATLAB? From: Wayne King Date: 2 Feb, 2011 11:27:05 Message: 2 of 9 
"chikha said" <chikhasaid@gmail.fr> wrote in message <iiav9r$461$1@fred.mathworks.com>... 
Subject: How do I calculate THD in MATLAB? From: chikha said Date: 2 Feb, 2011 14:36:03 Message: 3 of 9 
"Wayne King" <wmkingty@gmail.com> wrote in message <iibf29$6fq$1@fred.mathworks.com>... 
Subject: How do I calculate THD in MATLAB? From: Wayne King Date: 2 Feb, 2011 17:09:04 Message: 4 of 9 
"chikha said" <chikhasaid@gmail.fr> wrote in message <iibq4j$8pl$1@fred.mathworks.com>... 
Subject: How do I calculate THD in MATLAB? From: chikha said Date: 2 Feb, 2011 19:11:21 Message: 5 of 9 
"Wayne King" <wmkingty@gmail.com> wrote in message <iic33g$483$1@fred.mathworks.com>... 
"Wayne King" <wmkingty@gmail.com> wrote in message <iic33g$483$1@fred.mathworks.com>... 
Subject: How do I calculate THD in MATLAB? From: Wayne King Date: 28 Feb, 2011 11:48:28 Message: 7 of 9 
"Alex " <specialedster@gmail.com> wrote in message <ikfems$ksk$1@fred.mathworks.com>... 
Dear sir, 
Subject: How do I calculate THD in MATLAB? From: Stephane Date: 10 Oct, 2013 13:02:08 Message: 9 of 9 
%Following the proposed solution by Wayne, I will explain a method in order to %compute THD using the FFT. 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.