Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Help create a DTFM decode function

1 visualización (últimos 30 días)
xoxox
xoxox el 5 de Ag. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by