How to calculate total harmonic distortion for a given signal?

조회 수: 13 (최근 30일)
Millo Dacha
Millo Dacha 2020년 11월 15일
답변: Joel Van Sickel 2020년 11월 17일
How to calculate total harmonic distortion for a given signal?
I have used 'spectrum analyzer block' in Simulink and it gives me about 13 percent THD, whereas when I use thd() function in MATLAB script I get around 3.3492e-06 percent.
(Signal is output of a LCL filter which has been fed with output of a sine-PWM inverter.)
  댓글 수: 3
Millo Dacha
Millo Dacha 2020년 11월 16일
How to get THD of signal using codes in script?
Millo Dacha
Millo Dacha 2020년 11월 16일
Following is the signal:
thd() function gives me 3.3422e-06 % THD whereas SIMULINK's 'spectrum analyzer' block gives me about 13% THD.
I require a function to get THD in MATLAB code.

댓글을 달려면 로그인하십시오.

채택된 답변

Joel Van Sickel
Joel Van Sickel 2020년 11월 17일
Hello Millo,
when you used the function, did you only provide the signal data, or did you provide attitional parameters? It is likely you should specificy additonal parameters to get the THD that you want. Please look at the doc page carefully to see what else you can specify: Also, please take into account, that the spectrum analyzer is doing a lot of extra work behind the scenes. This matlab function does not return the value in percent, but in dbc, so you need to convert to percent.
However, I find that using fft, while a bit more work, is also more intuitive to understand what is going on. There are numerous examples of calculating THD in the file exchange. Here is one of them.
Regards,
Joel

추가 답변 (1개)

Rahul Kumar
Rahul Kumar 2020년 11월 15일
click on powergui block then select FTT analysis after that you find your THD spectra for perticular signal.

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by