这是我的音频文件分割代码,然后对其进行特征提取
Filename=uigetfile('*.wav','Select the MATLAB code file');
disp(Filename)
[y, fs]=wavread(Filename);
t1=[1/fs:1/fs:length(y)/fs];
fprintf('Duration orignl = %g seconds\n', length(y)/fs);
nsamples = 20 * fs;
[y2, fs] = wavread(Filename, nsamples);
t2=[1/fs:1/fs:length(y2)/fs];
fprintf('Duration splited = %g seconds\n', length(y2)/fs);
figure,ax(1)=subplot(3,1,1);plot(t1,y);title('orgnl');title(Filename);xlabel('Time (sec)');
ax(2)=subplot(3,1,2);plot(t2,y2);title('splited');title('splited');xlabel('Time (sec)');
a = miraudio(Filename);
z = mirzerocross(a)
但是在a=miraudio(Filename);
这里需要原始的wav文件没有被分割。如果我采取a = miraudio(y2);
它给了我错误的价值。谁能帮助我?
提前致谢