Index exceeds matrix dimensions at buffer function
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Here is what i'm gona trying to do :
- I read a .wav file called tes.wav stored in y
- I try performing 3-level Haar Wavelet Transform on it
- I try to framing the D3 (detail subband level 3)
So i have this following code :
f=wavread('tes.wav','native');
v=[1/sqrt(2) 1/sqrt(2)];
w=[1/sqrt(2) -1/sqrt(2)];
if mod(length(f),2)~=0
f=[f 0];
end
d=length(f);
m=1:d/2;
a1=f(2*m-1).*v(1) + f(2*m).*v(2);
d1=f(2*m-1).*w(1) + f(2*m).*w(2);
d=length(a1);
m=1:d/2;
a2=a1(2*m-1).*v(1) + a1(2*m).*v(2);
d2=d1(2*m-1).*w(1) + a1(2*m).*w(2);
d=length(a2);
m=1:d/2;
a3=a2(2*m-1).*v(1) + a2(2*m).*v(2);
d3=d2(2*m-1).*w(1) + a2(2*m).*w(2);
x=d3(1:length(d3),1);
frame=buffer(x,10);
But i Keep getting error message like this :
??? Index exceeds matrix dimensions.
Error in ==> Project at 32 x=d3(1:length(d3),1);
0 comentarios
Respuesta aceptada
per isakson
el 28 de Feb. de 2013
Editada: per isakson
el 28 de Feb. de 2013
Add the line
size( d3 )
before the line that errors. What does it show? (I guess d3 doesn't have the size you expect.)
Why do you use
x = d3( 1:length(d3), 1 );
and not
x = d3( :, 1 );
?
The error message indicates that the rows of d3 has more elements than the columns.
3 comentarios
per isakson
el 28 de Feb. de 2013
No, I'm not. However, searching the File Exchange for "haar transform" returned 18 contributions. Many of them with high ratings.
You could open a new question in Answers.
Más respuestas (1)
Shashank Prasanna
el 27 de Feb. de 2013
Editada: Shashank Prasanna
el 27 de Feb. de 2013
>> clear
and start fresh, There could be a conflict in the name of the variable vs name of the function
2 comentarios
Sean de Wolski
el 27 de Feb. de 2013
Yeah; looks like length() was shadowed.
which -all length
Ver también
Categorías
Más información sobre Discrete Multiresolution Analysis 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!