フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Sony
Sony 2013 年 7 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
[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