필터 지우기
필터 지우기

Facing error in generalizing hamming window.

조회 수: 1 (최근 30일)
Jaya Sodhani
Jaya Sodhani 2022년 7월 7일
%Reading the audio
y=audioread('speech.wav');
%sound(y);
subplot(2,3,1);
plot(y);
xlabel('Samples');
ylabel('Magnitude');
title('Original speech signal');
%Adding noise
x=awgn(y,5);
z=y+x;
z=z / max(abs(z));
%sound(z);
subplot(2,3,2);
plot(z);
xlabel('Samples');
ylabel('Magnitude');
title('Noise added to speech signal');
% Framing
f_duration = 0.025;
fs=8000;
f_size = (f_duration.*fs);
n = length(y);
n_f = floor(n/f_size); %no. of frames
temp = 0;
for i = 1 : n_f
frames(i,:) = z(temp + 1 : temp + f_size);
window=hamming(200);
window_framing(i,:)=frames(i,:).*window;
temp = temp + f_size;
end
I am trying to generalize the code for hamming windowing for every frame. But it is giving me "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side." this error. Please resolve my query.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by