blockframes.txt

来自「DTW+VQ实现的语音识别 UIUC提供」· 文本 代码 · 共 29 行

TXT
29
字号
function M3 = blockFrames(s, fs, m, n) 
% blockFrames: Puts the signal into frames 
% 
% Inputs: s contains the signal to analize 
% fs is the sampling rate of the signal 
% m is the distance between the beginnings of two frames 
% n is the number of samples per frame 
% 
% Output: M3 is a matrix containing all the frames 
% 
% 
%%%%%%%%%%%%%%%%%% 
% Mini-Project: An automatic speaker recognition system 
% 
% Responsible: Vladan Velisavljevic 
% Authors: Christian Cornaz 
% Urs Hunkeler 
l = length(s); 
nbFrame = floor((l - n) / m) + 1; 
for i = 1:n 
for j = 1:nbFrame 
M(i, j) = s(((j - 1) * m) + i); 
end 
end 
h = hamming(n); 
M2 = diag(h) * M; 
for i = 1:nbFrame 
M3(:, i) = fft(M2(:, i)); 
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?