Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Help create a DTFM decode function
1 回表示 (過去 30 日間)
古いコメントを表示
Need help create a code that can decode the ringphones. When I run function lab 9. i will get the answer such as
>> lab9
s1: 123456789*0# is O.K.
s2: 123456789*0# is O.K.
s3: 123456789*0# is O.K.
s4: 123456789*0# is O.K.
s5: 123456789*0# is O.K.
s6: 123456789*0# is O.K.
complete this code:
function str=dtmfcode(s,fs)
function lab9
%
% Make sure you download all the test files s1.wav -> s8.wav
nFiles = 6;
for i = 1:nFiles
fileName = ['s' num2str(i)];
[s, fs] = audioread(fileName);
num = round(32768 * s(end-12:end));
indx = find(num);
num = num(indx(1):end);
str = char(48 + num);
out = dtmfdecode(s, fs);
fprintf(1, '%s: ', fileName)
if (~isempty(out))
if (strcmp(out(:), str(:)))
fprintf(1, '%s is O.K.\n', out);
else
fprintf(1, 'Got %s instead of %s\n', out, str);
end
else
disp('Empty');
end
end
return
0 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!