Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Help create a DTFM decode function

1 vue (au cours des 30 derniers jours)
xoxox
xoxox le 5 Août 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (0)

Cette question est clôturée.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by