Hi,
As per my understanding, you have 2 square waves out of which one is actual square wave and the other is a Pulse wave (duty cycle not equal to 50). Generally, Fourier transform of square wave contains odd harmonics only and Fourier transform of pulse train contains even and odd harmonics. Accordingly, spectrum of your first square wave has odd harmonics only unlike that of your second wave which is a Pulse wave. For better visualization and understanding of the spectra try limiting the x-axis as follows:
plot(f, abs(x_1))
xlim([-1600 1600])
title('Square Wave 1 - Magnitude Spectra');
xlabel('f (Hz)');
ylabel('|X1(f)|');
0 Comments
Sign in to comment.