Framing and windowing audio signal

4 vues (au cours des 30 derniers jours)
gowthami kommineni
gowthami kommineni le 14 Fév 2016
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

Réponses (1)

Walter Roberson
Walter Roberson le 14 Fév 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.

Catégories

En savoir plus sur Simulation, Tuning, and Visualization dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by