Periodogram of a square wave
Show older comments
Hi everyone, I'm doing a DSP project where I need to extract the THD and SNDR of a Sigma-Delta DPWM.
I'm using the MATLAB function "periodogram" on the output to do it, but it returns bad results because the output wave is a square wave and not a sine wave (which amplifies the error). How can I work around that and get the correct periodogram of a square wave?
Thank you very much!
6 Comments
Mathieu NOE
on 30 May 2023
it's not really a surprise that a PWM signal is a square wave, unless you apply a strong low pass filter and then you recover the input (analog) signal (like in a class D amplifier)
what is the purpose of doing the THD analysis at the PWM signal level ??
Gianmarco Lavacca
on 30 May 2023
Periodogram works but it may not be the right tool for what you want ...
example on a variable duty cycle square wave (something that can simulate a PWM signal)
n = 1:1024;
x = round(abs(sin(pi/100*n)+0.1*randn(size(n))));
figure(1)
plot(x)
nfft = length(x);
figure(2)
periodogram(x,[],nfft)
Gianmarco Lavacca
on 31 May 2023
Mathieu NOE
on 31 May 2023
I don't have accss to this publication
maybe you can take contact with the authors to further discuss that topic
Gianmarco Lavacca
on 31 May 2023
Edited: Gianmarco Lavacca
on 31 May 2023
Accepted Answer
More Answers (0)
Categories
Find more on Pulse and Transition Metrics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

