필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
[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
Walter Roberson
Walter Roberson 2013년 7월 1일
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 2013년 7월 2일
편집: Walter Roberson 2013년 7월 2일
buf1=[buf1;modres(UvStartIdx(i):UvEndIdx(i))']; error is happening on this line
size(s)=40280
size(y)=20140
size(modres)= 1 16783

답변 (2개)

Matt J
Matt J 2013년 7월 1일
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 2013년 7월 2일
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.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by