2019.11.17
info = audioinfo('G:\IOT\作业2\res1.wav');
[y, Fs] = audioread('G:\IOT\作业2\res1.wav');
T = y;
figure;
subplot(2, 1, 1)
plot(y), title('Spectrum before filtering');
L = length(T);
N = 3; % size of the window
k = 0;
m = 0;
for i = 1:L
m = m+1;
if i+N-1 > L
break
else
for j = i:N+i-1
k = k+1;
W(k) = T(j);
end
T1(m) = mean(W);
k = 0;
end
end
subplot(2, 1, 2)
plot(T1), title('Spectrum after filtering');