Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Index exceeds matrix dimensions.,i keep on getting this error will anybody correct it 4 me?

1 Ansicht (letzte 30 Tage)
[s Fs nb]=wavread('C:\Users\Thara\Desktop\PROJECT\DataIITKGP\speaker7\normal\7.normal.1.wav.split\000001one.wav');
y=resample(s,1,2);
Fs=Fs/2;
d=y./max(abs(y));
UvStartIdx=[127 2578 6082 7390 8848 12950 16196 ];
UvEndIdx=[1681 5205 6675 8194 12227 15301 19807];
PitchModFact=[1.03 1.01 1.02 1.03 1.01 1.05 1.03];
DurModFact=[0.78 0.7 0.75 0.84 0.71 0.9 0.82];
buf1=[];
b=[];
for i=1:7
[modres]=EpochProsodyModResidualModFn(y,Fs,PitchModFact(i),DurModFact(i));
size(modres)
buf1=[buf1;modres(UvStartIdx(i):UvEndIdx(i))'];
if i+1<=length(UvStartIdx)
buf1=[buf1;modres(UvEndIdx(i):UvStartIdx(i+1))'] ;
smtlb = sgolayfilt(modres(UvEndIdx(i):UvStartIdx(i+1))',3,41);
b=[b;smtlb];
figure;plot(smtlb);
sound(smtlb,Fs)
end
end
buf1=[buf1;modres(UvEndIdx(i):end)'];
  2 Kommentare
Walter Roberson
Walter Roberson am 1 Jul. 2013
It would help if you told us which line the problem was occurring on.
In your code, what do you expect to have happen if the file is not at least 19807 long ?
It is not clear to me that your code is taking into account the possibility that the file is multiple channels (stereo) ?
Sony
Sony am 2 Jul. 2013
Bearbeitet: Walter Roberson am 2 Jul. 2013
buf1=[buf1;modres(UvStartIdx(i):UvEndIdx(i))']; error is happening on this line
size(s)=40280
size(y)=20140
size(modres)= 1 16783

Antworten (2)

Matt J
Matt J am 1 Jul. 2013
It happens when you do things like this
>> a=1:7; a(8)
Index exceeds matrix dimensions.
Use DBSTOP to trap the error.

Walter Roberson
Walter Roberson am 2 Jul. 2013
You unconditionally try to access
modres(UvStartIdx(i):UvEndIdx(i))
for all "i" values possible for those two arrays. The maximum UvEndIdx value is 19807 so you are attempting to access up to index 19807 of modres(). However, your modres is not that long.
We have no information about your EpochProsodyModResidualModFn function, so we cannot tell you why your modres is coming out shorter than you expect.

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by