Systems and signals square wave

Case I: Square-wave x1(t), 50% duty cycle

f0=500 Hz

To=1/500=0.002s=2 ms

Mathematically, the square-wave can be expressed for a single period as

systems and signals square wave image 1

Therefore the trigonometric Fourier series coefficients of x1(t) are

systems and signals square wave image 2

Case II: Square-wave x2 (t), 25% duty cycle

Mathematically, the square-wave x2 (t) can be expressed for a single period as

systems and signals square wave image 3

Sinusoids from -8 to -1;

systems and signals square wave image 4
    clear
clc
f_0= 500; % fundamental frequency 
t= -0.001:0.00001:0.006; %time axis 
Z_50= zeros(1,length(t)); % container for 50% duty cycle waveform 
Z_25= zeros(1,length(t)); % container for 25% duty cycle waveform 
n=1:16; 
n1=sin(pi.*n./2);
d1=(pi.*n./2);
n2=sin(pi.*n./4); 
d2=((pi).*n./4); 
a_50=[n1./d1]; %fourier coefficients for 50% duty cycle
a_25=[0.5*(n2./d2)]; %fourier coefficients for % duty cycle
for k=1:length(n) 
    wa=1*cos(2*pi*(k)*f_0*t); 
    Z_50=Z_50+ a_50(k)*wa;
    Z_25=Z_25+ a_25(k)*wa; 
end
soundsc(Z_50)
figure (1)
plot(t,Z_50) 
hold on 
grid on
axis tight 
xlabel('time') 
ylabel('Amplitude') 
title('Square-wave with 50% duty cycle');

figure(2) 
plot(t,Z_25)
grid on 
axis tight
xlabel('time') 
ylabel('Amplitude'); 
title('Square-wave with 25% duty cycle');
Want latest solution of this assignment
AssignmentHippo Features
  • On Time Delivery

    Our motto is deliver assignment on Time. Our Expert writers deliver quality assignments to the students.

  • Plagiarism Free Work

    Get reliable and unique assignments by using our 100% plagiarism-free services.

  • 24 X 7 Live Help

    The experienced team of AssignmentHippo has got your back 24*7. Get connected with our Live Chat support executives to receive instant solutions for your assignment problems.

  • Services For All Subjects

    We can build quality assignments in the subjects you're passionate about. Be it Programming, Engineering, Accounting, Finance and Literature or Law and Marketing we have an expert writer for all.

  • Best Price Guarantee

    Get premium service at a pocket-friendly rate. At AssignmentHippo, we understand the tight budget of students and thus offer our services at highly affordable prices.