Nama: Monalisa BP:1701051017 Kelas: Ib-Tc Praktikum 1 Pengamatan Sinyal Secara Matematis Dan Grafis

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

NAMA : MONALISA

BP :1701051017
KELAS : IB-TC
PRAKTIKUM 1
PENGAMATAN SINYAL SECARA MATEMATIS DAN GRAFIS

-1
0 1 2 3 4 5 6 7 8 9 10
1

-1
0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55
1

-1
2 2.02 2.04 2.06 2.08 2.1 2.12 2.14 2.16 2.18 2.2

0.9

0.8

0.7

0.6
amplitudo

0.5

0.4

0.3

0.2

0.1

0
0 500 1000 1500 2000 2500 3000 3500 4000
frekuensi

clear clear all;


clc;

fs=8000;
t=(1:80000)/fs;
Ts=1/fs;
N=80000;
x=audioread('s2.wav');
figure(1)
subplot(3,1,1),plot(t,x),axis([0 10 -1 1])
subplot(3,1,2),plot(t,x),axis([0.2 0.6 -1 1])
subplot(3,1,3),plot(t,x),axis([2 2.2 -1 1])
X=fft(x);%complex signal

Xmag=abs(X);
norm=max(Xmag);%magnitude
Xmag=Xmag/norm;
f=(1:N)*fs/N;%frequency points

figure(3)
plot(f,Xmag),xlim([0 fs/2])

ylabel('amplitudo')
xlabel('frekuensi')
sound(x,fs)

1.1. PARAMETER SINYAL


X(t) = sin (2πft)
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

1. PARAMETER FREKUENSI
 f = 100
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=100;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 200
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=200;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);
figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 300
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=300;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 400
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=400;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 500
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=500;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 600
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=600;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 700
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=700;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 800
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=800;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 900
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=900;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 f = 1000
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=1000;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

2. PARAMETER AMPLITUDO (f=1, teta=0)


 A = 0.1
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.1;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 A = 0.2
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.2;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 A = 0.4
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.4;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)
 A = 0.6
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.6;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 A = 0.8
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.8;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)
 A = 1
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=1;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

3. PARAMETER TETA (f=1, A=0.1)


 TETA = 0
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.1;
f=1;
teta=0;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)
 TETA = 30
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;
t=0:1/8000:1;
A=0.1;
f=1;
teta=30;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 TETA = 60
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.1;
f=1;
teta=60;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)
 TETA = 90
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.1;
f=1;
teta=90;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)

 TETA = 180
1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

clear all;
clc;

t=0:1/8000:1;
A=0.1;
f=1;
teta=180;
xt=A*sin(2*pi*f*t+teta*pi/180);

figure(1)
plot(t,xt),axis([0 1 -1 1])
sound(xt,8000)
1.2. SINYAL DOMAIN WAKTU DAN DOMAIN FREKUENSI

TUGAS 2

x(t) = sin (2π100t)

-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01

-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
Sinyal Domain Waktu
2

-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01

0.5

0
0 100 200 300 400 500 600 700 800 900 1000

0.5

0
0 100 200 300 400 500 600 700 800 900 1000
Sinyal Domain Frekuensi

0.5

0
0 100 200 300 400 500 600 700 800 900 1000

clear all;
clc;

fs = 8000; t=(1:10000)/fs ;N=length(t);A=1;f = 100;


x1 = A*sin(2*pi*f*t);
f=(1:N)*fs/N; %frequency points

figure(1)
plot(t,x1),axis([0 0.01 -2 2])
X1 = fft(x1);
Xmag1=abs(X1);Xmag1=Xmag1/max(Xmag1)*A;
title('Sinyal Domain Waktu')

figure (3)
plot(f,Xmag1),axis([0 fs/8 0 1.5])
title('Sinyal Domain Frekuensi')

fs = 8000; t=(1:10000)/fs ;N=length(t); A1=1; A2=0.5; f1 = 100; f2 = 600;


x1 = A1*sin(2*pi*f1*t);
x2 = A2*sin(2*pi*f2*t);
x3 = x1+ x2;
f=(1:N)*fs/N; %frequency points

figure(1)
subplot(3,1,1),plot(t,x1),axis([0 0.01 -2 2])
subplot(3,1,2),plot(t,x2),axis([0 0.01 -2 2])
subplot(3,1,3),plot(t,x3),axis([0 0.01 -2 2])
X1 = fft(x1);
X2 = fft(x2);
X3 = fft(x3);

Xmag1=abs(X1);Xmag1=Xmag1/max(Xmag1)*A1;
Xmag2=abs(X2);Xmag2=Xmag2/max(Xmag2)*A2;
Xmag3=Xmag1+Xmag2;
title('Sinyal Domain Waktu')

figure (3)
subplot(3,1,1),plot(f,Xmag1),axis([0 fs/8 0 1.25])
subplot(3,1,2),plot(f,Xmag2),axis([0 fs/8 0 1.25])
subplot(3,1,3),plot(f,Xmag3),axis([0 fs/8 0 1.25])
title('Sinyal Domain Frekuensi')

TUGAS 3

TUGAS 5

1.5

0.5

-0.5

-1

-1.5
0 0.005 0.01 0.015 0.02 0.025 0.03
Sinyal Domain Frekuensi
0.25

0.2

0.15

0.1

0.05

0
0 100 200 300 400 500 600 700 800 900 1000

clear all;
clc;

fs=8000;t=(1:10000)/fs;N=length(t);A=0.6;f=100;
w=2*pi*f;
x1=2/pi+4/(3*pi)*cos(w*t)-4/(15*pi)*cos(2*w*t);

f=(1:N)*fs/N; %frequency points


figure(1)
plot(t,x1),axis([0 0.03 -1.5 1.5])

X1=fft(x1);
Xmag1=abs(X1);Xmag1=Xmag1/max(Xmag1)*A;
figure(2)
plot(f,Xmag1),axis([0 fs/8 0 0.25])
title('Sinyal Domain Frekuensi')

TUGAS 6
1.5

0.5

-0.5

-1

-1.5
0 0.005 0.01 0.015 0.02 0.025 0.03
Sinyal Domain Frekuensi

0.8

0.6

0.4

0.2

0
0 100 200 300 400 500 600 700 800 900 1000

clear all;
clc;

fs=8000;t=(1:10000)/fs; N=length (t); A=1.5;f=100;


w=2*pi*f;
x1=4/pi*sin(w*t)+4/(3*pi)*sin(3*w*t);

f=(1:N)*fs/N;%frequency points
figure(1)
plot(t,x1),axis([0 0.03 -1.5 1.5])

X1=fft(x1);
Xmag1=abs(X1);Xmag1=Xmag1/max(Xmag1)*A;
figure(2)
plot(f,Xmag1),axis([0 fs/8 0 1.2])
title('Sinyal Domain Frekuensi')

TUGAS 7

1.5

0.5

-0.5

-1

-1.5
0 0.005 0.01 0.015 0.02 0.025 0.03
Sinyal Domain Frekuensi

0.8

0.6

0.4

0.2

0
0 100 200 300 400 500 600 700 800 900 1000

clear all;
clc;

fs=8000;t=(1:10000)/fs; N=length (t); A=1.2;f=100;


w=2*pi*f;
x1=4/pi*cos(w*t)-4/(3*pi)*cos(3*w*t)+4/(5*pi)*cos(5*w*t);

f=(1:N)*fs/N;%frequency points
figure(1)
plot(t,x1),axis([0 0.03 -1.5 1.5])

X1=fft(x1);
Xmag1=abs(X1);Xmag1=Xmag1/max(Xmag1)*A;
figure(2)
plot(f,Xmag1),axis([0 fs/8 0 1.2])
title('Sinyal Domain Frekuensi')

TUGAS 8

1.5

0.5

-0.5

-1

-1.5
0 0.005 0.01 0.015 0.02 0.025 0.03
Sinyal Domain Frekuensi

0.8

0.6

0.4

0.2

0
0 100 200 300 400 500 600 700 800 900 1000

clear all;
clc;

fs=8000;t=(1:10000)/fs; N=length (t); A=1.2;f=100;


w=2*pi*f;
x1=8/pi^2*cos(w*t)+8/(3*pi)^2*cos(3*w*t)+8/(5*pi)^2*cos(5*w*t);

f=(1:N)*fs/N;%frequency points
figure(1)
plot(t,x1),axis([0 0.03 -1.5 1.5])

X1=fft(x1);
Xmag1=abs(X1);Xmag1=Xmag1/max(Xmag1)*A;
figure(2)
plot(f,Xmag1),axis([0 fs/8 0 1.2])
title('Sinyal Domain Frekuensi')

You might also like