segmentation of a signal
Ältere Kommentare anzeigen
i have a nx3 matrix of a signal and i want to make small segments of 0.3 ms of this signal. using the following code i can make those segments but i am unable to store all the segments like frame1,frame2...last frame. i dont understand what am i missing in this code. and lastly i get the error"Warning: Integer operands are required for colon operator when used as index" when i use this code. the matrix name is prblm and it is 81920x3
fs=2048;
frame_duration=0.3;
frame_samples_length=(frame_duration*fs);
n= length(prblm);
number_of_frames=floor(n/frame_samples_length);
for k = 1:number_of_frames
frame = prblm((k-1)*frame_samples_length+1:frame_samples_length*k,:);
end
1 Kommentar
Priyanka Shanmuga Raja
am 9 Jun. 2020
frame = prblm((k-1)*frame_samples_length+1:frame_samples_length*k,:);
I guess, here you are trying to index from 1 to a decimal. May be try using floor()
Akzeptierte Antwort
Weitere Antworten (2)
KSSV
am 9 Jun. 2020
fs=2048;
frame_duration=0.3;
frame_samples_length=(frame_duration*fs);
n= length(prblm);
number_of_frames=floor(n/frame_samples_length);
frame = zeros(number_of_frames,3) ;
for k = 1:number_of_frames
frame(k,:) = prblm((k-1)*frame_samples_length+1:frame_samples_length*k,:);
end
Rida Alfonso
am 9 Jun. 2020
0 Stimmen
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!