Anda di halaman 1dari 24

MODUL 1 PROSES PEREKAMAN DAN PENGEDITAN SINYAL WICARA

4.2 Perekaman dengan Matlab 2. Program recording dengan Matlab


clear all; Fs = 8000; y = wavrecord(5.0*Fs, Fs, 'double'); wavwrite(y,Fs,'aiueo.wav')

3. Program tambahan untuk membaca file aiueo.wav


y2=y1(1:40000); plot(y2)

4. Program tambahan untuk memainkan file aiueo.wav


y=wavread('aiueo.wav') wavplay(y,Fs)

4.3. Proses Pengeditan untuk Pemisah Vokal 2. Program menampilkan sebagian/seluruh sinyal
y1=wavread('aiueo.wav'); t=length(y1); y2=y1(1:10000); plot(y2)

Gambar : Sebagian

Keseluruhan

3. Tampilan vocal a

Program :
y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y2=y1(1:9000); plot(y2) wavwrite(y1,Fs,'a.wav'); sound (y2,Fs)

Gambar :

4. Program penyimpanan ke dalam file a.wav


wavwrite(y1,Fs,a.wav);

Full Program :
y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y2=y1(1:9000); plot(y2) wavwrite(y1,Fs,'a.wav'); sound (y2,Fs)

5. untuk i.wav, u.wav, e.wav, o.wav Program

( i.wav )
y1=wavread('aiueo.wav');

( u.wav )
y1=wavread('aiueo.wav');

t=length(y1); Fs = 8000; y2=y1(9000:13000); plot(y2) wavwrite(y1,Fs,'i.wav'); sound (y2,Fs)

t=length(y1); Fs = 8000; y2=y1(13000:18000); plot(y2) wavwrite(y1,Fs,'u.wav'); sound (y2,Fs)

( e.wav)
y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y2=y1(18000:23000); plot(y2) wavwrite(y1,Fs,'e.wav'); sound (y2,Fs)

( o.wav )
y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y2=y1(23000:28000); plot(y2) wavwrite(y1,Fs,'o.wav'); sound (y2,Fs)

4.4. Perubahan Nilai Sampling 1. Pemanggilan file hasil perekaman


clear all; Fs = 8000; y=wavread('aiueo.wav') wavplay(y,Fs)

2. Perubahan nilai frekuensi sampling - Fs = 10000 , 14000 , 16000 , 24000 , 44000 Analisis : semakin tinggi rekuensi sampling maka nada semakin tinggi , hal ini dikarenakan frekuensi sampling yang semakin besar menjadi cepat 3. Perubahan nilai frekuensi sampling - Fs = 7000 , 6000 , 5000 Analisis : semakin rendah Frekuensi sampling maka nada akan semakin rendah , hal ini dikarenakan frekuensi sampling yang semakin rendah dan melambat 5. ANALISA DATA DAN TUGAS

1. Catatan waktu vocal : a. Vocal aiueo.wav b. Vocal a.wav c. Vocal i.wav d. Vocal u.wav

= 2,5 detik = 0,2 detik = 0,3 detik = 0,2 detik

e. Vocal e.wav f. Vocal o.wav

= 0,3 detik = 0,2 detik

2. 3. Analisis dari perubahan perubahan sampling yang dilakukan bahwa apabila frekuensi samplinya dinaikkan maka yang akan terjadi adalah suara / nada semakin tinggi dan menjadi cepat, sedangkan apabila terjadi sebaliknya frekuensi samplingnya rendah suara / nada akan rendah dan melambat

REPRESENTASI SINYAL SUARA DALAM DOMAIN WAKTU DAN FREKUENSI MATLAB

4.2. Sinyal Sinus dalam Domain Waktu dan Frekuensi 1. Program membangkitkan sinyal sinus dan perekaman suara %File Name:sinus_0.m clear all; fs=16000; t=1/fs:1/fs:1; y=sin(2*pi*800*t); sound(y,fs); wavwrite(y,fs,'sinus_0.wav')

2. Program untuk melihat bentuk sinyal sinus Y_f=20*log10(abs(fft(y))); plot(Y_f) axis([0 1000 -100 100]);

4.3. Sinyal Wicara dalam Domain Waktu dan Frekuensi 1. Perintah memanggil sinyal a.wav y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y2=y1(1:9000); plot(y2) wavwrite(y1,Fs,'a.wav'); sound (y2,Fs);

2. Perintah dasar pengamatan Power Spektral Density(PSD) dan menampilkan sinyal wicara sebagai fungsi waktu dan PSD sinyal wicara tersebut Sinyal Wicara sebagai fungsi waktu t=0:1/fs:(length(y2)-1)/fs; plot (t,y2);

PSD sinyal wicara wavefft=abs(fft(y2)); n=length(y2)-1; f=0:fs/n:fs; plot (f,wavefft);

3. Program menampilkan spectrum a.wav

4. Hasil yang terjadi apabila soal diatas dijalankan pada vokal I,u,e,o i.wav

memanggil sinyal 1.wav y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y3=y1(1:9000); plot(y3) wavwrite(y1,Fs,'i.wav'); sound (y3,Fs);

Sinyal Wicara sebagai fungsi waktu t=0:1/fs:(length(y3)-1)/fs; plot (t,y3);

PSD sinyal wicara wavefft=abs(fft(y3)); n=length(y3)-1; f=0:fs/n:fs; plot (f,wavefft);

Spectogram i.wav x=specgram (y3); plot (x);

u.wav memanggil sinyal u.wav y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; y4=y1(13000:18000); plot(y4) wavwrite(y1,Fs,'u.wav'); sound (y4,Fs);

Sinyal Wicara sebagai fungsi waktu t=0:1/fs:(length(y4)-1)/fs; plot (t,y4);

PSD sinyal wicara wavefft=abs(fft(y4)); n=length(y4)-1; f=0:fs/n:fs;

plot (f,wavefft) Spectogram u.wav x=specgram (y4); plot (x);

e.wav memanggil sinyal e.wav y1=wavread('aiueo.wav'); t=length(y1); Fs = 8000; Y5=y1(13000:18000); plot(y5) wavwrite(y1,Fs,'u.wav'); sound (y5,Fs);

Sinyal Wicara sebagai fungsi waktu t=0:1/fs:(length(y5)-1)/fs; plot (t,y5);

PSD sinyal wicara wavefft=abs(fft(y5)); n=length(y5)-1; f=0:fs/n:fs;

plot (f,wavefft);

Spectogram e.wav x=specgram (y5); plot (x);

o.wav memanggil sinyal o.wav y1=wavread('aiueo.wav');

t=length(y1); Fs = 8000; Y6=y1(13000:18000); plot(y6) wavwrite(y1,Fs,'u.wav'); sound (y6,Fs);

Sinyal Wicara sebagai fungsi waktu t=0:1/fs:(length(y6)-1)/fs; plot (t,y6);

PSD sinyal wicara wavefft=abs(fft(y6)); n=length(y6)-1; f=0:fs/n:fs; plot (f,wavefft);

Spectogram e.wav x=specgram (y6); plot (x);

PEMFILTERAN PADA SINYAL WICARA

4.2. Pemfilteran Sinyal Wicara dengan IIR 1. low pass filter IIR dengan spesifikasi fc= 4000 Hz, frekuensi sampling fs=10000 Hz Program : R=0.4; N=16; Wn=0.4; figure(1); [B,A] = butter(N,Wn); [H,w]=freqz(B,A,N); len_f=length(H); f=1/len_f:1/len_f:1; plot(f,20*log10(abs(H)),'linewidth',2);

[s,fs]=wavread('a.wav'); >> sound (s); >> plot (s)

so=filter(B,A,s); plot (s0);

Sebelum Filter x=specgram(s); plot(x);

Sesudah Filter
so=filter(B,A,s); x=specgram(so); plot(x); so=filter(B,A,s); x=specgram(so); plot(x);

4.3. Pemfilteran Sinyal Wicara dengan FIR 1. Rancang sebuahlow pass filter FIR dengan spesifikasi seperti berikut:

fc= 4000 Hz, frekuensi sampling fs=10000 Hz, Program :


fs=10000; [x,fs]=wavread('a.wav'); Wn = .40; N = 32; LP = fir1(N,Wn); [H_x,w]=freqz(LP); len_f=length(H_x); f=1/len_f:1/len_f:1; plot(f,20*log10(abs(H_x))) grid;

[s,fs]=wavread('a.wav'); y1 = conv(LP,x); plot(y1);

Sebelum Difilter
[s,fs]=wavread('a.wav'); x=specgram(s); plot(x);

Sesudah Difilter

Anda mungkin juga menyukai