Tugas 2 Akustik Bawah Air
-
Upload
larasati-devi -
Category
Documents
-
view
215 -
download
0
description
Transcript of Tugas 2 Akustik Bawah Air
Tugas 2 Akustik Bawah Air
NIM: 15513016, tombol yang dipilih adalah tombol 4 dengan frekuensi 770 Hz dan 1209 Hz.
Fs = 5000; % Sampling frequencyT = 1/Fs; % Sampling periodL = 5000; % Length of signalt = (0:L-1)*T; % Time vector S1 = sin(2*pi*770*t); plot(1000*t(1:50),S1(1:50))title('Signal f = 770 Hz')xlabel('t (milliseconds)')ylabel('X(t)') S2 = sin(2*pi*1209*t); plot(1000*t(1:50),S2(1:50))title('Signal f = 1209 Hz')xlabel('t (milliseconds)')ylabel('X(t)') S = sin(2*pi*770*t)+ sin(2*pi*1209*t); plot(1000*t(1:50),S(1:50))title('Signal - Sum of Two Frequencies')xlabel('t (milliseconds)')ylabel('X(t)') Y = fft(S); P2 = abs(Y/L);P1 = P2(1:L/2+1);P1(2:end-1) = 2*P1(2:end-1); f = Fs*(0:(L/2))/L; plot(f,P1)title('Single-Sided Amplitude Spectrum of X(t)')xlabel('f (Hz)')ylabel('|P1(f)|')