Framing and windowing audio signal
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 14 de Feb. de 2016
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 comentarios
Ver también
Categorías
Más información sobre Simulation, Tuning, and Visualization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!