0% found this document useful (0 votes)
45 views1 page

Lab - 1 Matlab Code

The document outlines a lab exercise involving the creation and plotting of various signals, specifically focusing on the construction of a square wave signal using sine functions. It includes instructions for incrementally adding harmonics to the sine wave and analyzing the effects of removing specific harmonics. Additionally, it provides a similar exercise for constructing a triangular wave signal with a focus on harmonic adjustments.

Uploaded by

nanansnna44
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views1 page

Lab - 1 Matlab Code

The document outlines a lab exercise involving the creation and plotting of various signals, specifically focusing on the construction of a square wave signal using sine functions. It includes instructions for incrementally adding harmonics to the sine wave and analyzing the effects of removing specific harmonics. Additionally, it provides a similar exercise for constructing a triangular wave signal with a focus on harmonic adjustments.

Uploaded by

nanansnna44
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Lab nr 1:

Rindertimi i sinjalit katerkendesh:

t=0:0.1:2*pi;
y=sin(t);
plot(t,y);
y1=sin(t)+1/3*sin(3*t);
plot(t,y1);
y2=sin(t)+1/3*sin(3*t)+1/5*sin(5*t);
plot(t,y2);
y3=sin(t)+1/3*sin(3*t)+1/5*sin(5*t)+1/7*sin(7*t);
plot(t,y3);
y4=sin(t)+1/3*sin(3*t)+1/5*sin(5*t)+1/7*sin(7*t)+1/9*sin(9*t);
plot(t,y4);
y5=sin(t)+1/3*sin(3*t)+1/5*sin(5*t)+1/7*sin(7*t)+1/9*sin(9*t)+1/11*sin(11*t);
grid on
plot(t,y5);
y6=sin(t)+1/3*sin(3*t)+1/5*sin(5*t)+1/7*sin(7*t)+1/9*sin(9*t)+1/11*sin(11*t)+1/13*sin(13*t)
+1/15*sin(15*t)+1/17*sin(17*t)+1/19*sin(19*t)+1/21*sin(21*t);
plot(t,y6);
y7=sin(t)+1/3*sin(3*t)+1/5*sin(5*t)+1/7*sin(7*t)+1/9*sin(9*t)+1/11*sin(11*t)+1/13*sin(13*t)
+1/15*sin(15*t)+1/17*sin(17*t)+1/19*sin(19*t)+1/21*sin(21*t)+1/23*sin(23*t)+1/25*sin(215*t)
+1/217*sin(27*t)+1/29*sin(29*t)+1/31*sin(31*t);
plot(t,y7);
Shenim: Hiqni nga y7…harmoniken e pare …harmoniken e trete… dhe shpjegoni ndryshimet.

Sinjali trekendesh (dhembeshare)


t=0:0.1:2*pi;
y=sin(t);
plot(t,y);
y1=sin(t)-1/9*sin(3*t);
plot(t,y1);
y2=sin(t)-1/9*sin(3*t)+1/25*sin(5*t);
plot(t,y2);
y3=sin(t)-1/9*sin(3*t)+1/25*sin(5*t)-1/49*sin(7*t);
plot(t,y3);
y4=sin(t)-1/9*sin(3*t)+1/25*sin(5*t)-1/49*sin(7*t)+1/81*sin(9*t);
plot(t,y4);
y5=sin(t)-1/9*sin(3*t)+1/25*sin(5*t)-1/49*sin(7*t)+1/81*sin(9*t)-1/121*sin(11*t);
plot(t,y5);
Shenim: Hiqni nga y5…harmoniken e pare …harmoniken e trete… dhe shpjegoni ndryshimet.

You might also like