使用Matlab从WAV文件中分离DTMF信号 [英] Splitting a DTMF signal from a wav file using Matlab

查看:152
本文介绍了使用Matlab从WAV文件中分离DTMF信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题出在这里:我有一个wav格式的DTMF信号,我必须确定它已编码的数字序列.我必须在Matlab中使用快速傅立叶变换来执行此操作,这意味着我使用wavread读取了wav文件,并标识了每个相隔40ms或更长时间的数字.

Here is the context of the problem: I have a DTMF signal in wav format, I have to identify the number sequence it has encoded. I must do so using fast fourier transform in Matlab, implying that I read the wav file using wavread and to identify each number that is seperated by 40ms silence or more.

到目前为止,这是我的代码:

Here is my code so far:

[signal, fs] = wavread( 'C:\Temp\file.wav' );  % here, fs = 8000Hz

N = 512;                    
T = 1/fs;                   
L = length( signal )        
samples = fs / 1000 * 40    
windows = floor(L / samples) 
t = (1:L)/fs;

figure(1), plot(t, signal);

这是figure 1的样子,这就是从wav读取的信号:

Here is what the figure 1 looks like, that is the signal read from the wav:

如何有效地将信号分成几部分,以便可以分别对10个部分分别进行FFT解码,以解码相应的数字?

How can I effectively split the signal into pieces so that I can then do an FFT on each of the 10 pieces seperately to decode the corresponding numbers?

推荐答案

这对我有用:

windowSize = 256;   
nbWindows = floor(L / windowSize);

for i=1:nbWindows
    coeffs = fft(signal((i-1)*windowSize+1:i*windowSize));    
    plot(abs(coeffs(1:N)));
    waitforbuttonpress
end;

通过这种方式可以将窗口移至输入信号的结尾

This way it is possible to shift the window until the end of the input signal

这篇关于使用Matlab从WAV文件中分离DTMF信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆