-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdtmf_testing.m
More file actions
executable file
·52 lines (46 loc) · 1.56 KB
/
dtmf_testing.m
File metadata and controls
executable file
·52 lines (46 loc) · 1.56 KB
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
% This srcipt test DTMF-function with 12 different audio signals and writes
% "dtmf_X.log" file, where X is your teams name.
% You need dtmf_TESTI_[101,..,112].wav.
%
% Write your own dtmf_decode.m function with takes .wav-file as input and
% returns characterline of the numbers/spaces like '555 9999 434343434'
% (class(numberLine) --> 'char'; num2str(112) -> '112').
%
% Inspired by Jukka Parviainen, 2011-2015
f_h = @dtmf_decode; % Change you function name here
teamName = 'DTMF group 6'; % Change your teams name here
% Run this code ->get log-file
% You can change this code if you want to.
%% 12 äänitiedoston testaus
loki = ['loki_' teamName '.log']; % vaihda tähän lokitiedosto
fid = fopen(loki, 'w');
CorrectNumbers={...
'050581051861301520120325';
'0445330224';
'0201333328';
'0403283302';
'0444814111';
'0417729192';
'050724113556';
'0155711432';
'0947025285';
'0402221543';
'0072663526372663';
'007266352637'};
for k=1:12
tic;
result = f_h(['dtmf_TESTI_' num2str(100+k) '.wav']);
usedTime = toc;
if strcmp(result, CorrectNumbers{k})
correct = 1;
else
correct = 0;
end
disp(['File: ' num2str(100+k)]);
disp(['Time: ' num2str(usedTime) ' s']);
disp(['Your number: ' result]);
disp(['Correct number: ' CorrectNumbers{k}]);
fprintf(fid,'%s; Audio: %d; Time: %2.4f; Working?: %d; Your number: %s\n', teamName, 100+k, usedTime, correct, result);
pause;
end
fclose(fid);