Framing and windowing audio signal
조회 수: 4 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!