-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoE197P_FinalsP02_Gomez_Tavas.asv
54 lines (50 loc) · 1.58 KB
/
CoE197P_FinalsP02_Gomez_Tavas.asv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%Tavas, Romelio Jr. 2011-11218
%Gomez, Emilio Vicente 2009-22091
%HONOR CODE
%I do hereby affirm, on my honor as a student at the end of this exam, that
%I had no unlawful knowledge of the questions or answers prior to this
%exercise and that I have neither given nor received assistance in answering
%any of the questions during this exam.
clear;
clc;
% [sig,fs,regions] = doVAD('AudioFiles/vowel_i.wav');
% [sig,fs,regions] = doVAD('AudioFiles/vowel_e.wav');
% [sig,fs,regions] = doVAD('AudioFiles/vowel_a.wav');
% [sig,fs,regions] = doVAD('AudioFiles/cherry.wav');
[sig,fs,regions] = doVAD('AudioFiles/WhatSheSaid.wav');
[sig,fs,regions] = doVAD('AudioFiles/BakitMatagalAngSundoKo.wav');
[sig,fs,regions] = doVAD('AudioFiles/IAmAwesome.wav');
% %getting initial regions
% r = [];
% for i = 1 : length(vad)-1
% if vad(i+1) ~= vad(i)
% r = [r i+1];
% end
% end
% r
%smoothing out regions: removes the transitions if they are less than 10
%frames away from each other. 10 frames was chosen empirically
% r2 = [r(1)];
% for i = 1:length(r)
% if i == length(r)
% if r(i) - r(i-1) < 10
% else
% r2(length(r2)) = r(i);
% end
% else
% if r(i+1) - r2(length(r2)) < 10
% r2(length(r2)) = r(i+1);
% else
% r2 = [r2 r(i+1)];
% end
% end
% end
% r2
% %generating VAD2 with smoothed out transitions
% vad2 = [zeros(1,r2(1)-1)];
% for i = 2:2:length(r2)
% vad2 = [vad2 ones(1,r2(i)-r2(i-1)-1)];
% end
% if length(vad2) < length(vad)
% vad2 = [vad2 zeros(1,length(vad)-length(vad2))];
% end