Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

MATLAB Command Window Page 1

>> %File Name: SS1_5.m


>> %Pembangkitan Sekuen Pulsa
>> L=input('Panjang Gelombang(>=40)=')
Panjang Gelombang(>=40)=50

L =

50

>> P=input('Posisi Pulsa =')


Posisi Pulsa =15

P =

15

>> for n=1:L


if (n==P)
step(n)=1;
else
step(n)=0;
end
end
>> x=1:L;
>> stem(x,step)
>> axis([0 L -.1 1.2])
>> L=input('Panjang Gelombang(>=40)=')
Panjang Gelombang(>=40)=70

L =

70

>> P=input('Posisi Pulsa =')


Posisi Pulsa =17

P =

17

>> for n=1:L


if (n==P)
step(n)=1;
else
step(n)=0;
end
end
>> x=1:L;
>> stem(x,step)
>> axis([0 L -.1 1.2])
>> %sin_dikrit1.m
>> Fs=20,%frekuensi sampling

Fs =
MATLAB Command Window Page 2

20

>> t=(0:Fs-1)/Fs %Proses Normalisasi

t =

Columns 1 through 12

0 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500


0.4000 0.4500 0.5000 0.5500

Columns 13 through 20

0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500

>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=30,%frekuensi sampling

Fs =

30

>> t=(0:Fs-1)/Fs %Proses Normalisasi

t =

Columns 1 through 12

0 0.0333 0.0667 0.1000 0.1333 0.1667 0.2000 0.2333


0.2667 0.3000 0.3333 0.3667

Columns 13 through 24

0.4000 0.4333 0.4667 0.5000 0.5333 0.5667 0.6000 0.6333


0.6667 0.7000 0.7333 0.7667

Columns 25 through 30

0.8000 0.8333 0.8667 0.9000 0.9333 0.9667

>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=40,%frekuensi sampling

Fs =

40

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
MATLAB Command Window Page 3

>> Fs=50,%frekuensi sampling

Fs =

50

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=60,%frekuensi sampling

Fs =

60

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=70,%frekuensi sampling

Fs =

70

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=80,%frekuensi sampling

Fs =

80

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=18,%frekuensi sampling

Fs =

18

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=15,%frekuensi sampling

Fs =

15
MATLAB Command Window Page 4

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=12,%frekuensi sampling

Fs =

12

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=10,%frekuensi sampling

Fs =

10

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>> Fs=8,%frekuensi sampling

Fs =

>> t=(0:Fs-1)/Fs; %Proses Normalisasi


>> s1=sin(2*pi*t*2);
>> stem(t,s1)
>> axis([0 1 -1.2 1.2])
>>

You might also like