필터 지우기
필터 지우기

Framing and windowing audio signal

조회 수: 3 (최근 30일)
gowthami kommineni
gowthami kommineni 2016년 2월 14일
답변: Walter Roberson 2016년 2월 14일
Iam using the code
Y=waveread(' ');
w_length=128;
m=length(Y);
numFrames=floor(m/w_length);
frameData=zeros(numFrames,w_length);
for k=1:numFrames
startAtIdx=(k-1)*w_length+1;
if k~=numFrames
frameData(k,:)=Y(startAtIdx+w_length-1);
else
frameData(k,1:m-startAtIdx+1)=Y(startAtIdx:end);
end
end
I am getting error in else part. The dimensions mismatch. So can any one help. I need to frame an audio signal and allocate memory for it.
Thanks in advance

답변 (1개)

Walter Roberson
Walter Roberson 2016년 2월 14일
numFrames=floor(m/w_length); is wrong. Suppose your signal length is 160 and your frame length is 128 like you show, then floor(160/128) would be 1, but clearly there should be 2 frames.

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by