Cut a continuous signal into frames
古いコメントを表示
Hey everyone,
I have a continuous signal with size 1x400000 (analog data that corresponds to a 20 min signal) and I would like to frames with 1 min each and do some signal processing on each. I wrote this code and tried it for a small matrix but when I increased the size of my matrix matlab was busy for a very long time. So, what is wrong and what can I do to improve it.
The code: t= [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 17 17.01 17.02 17.03 17.4 18];
for i =1:length(t)
if t(i) <= 17
T(i)= t(i);
else
break;
end
end
plot(T, D(1:length(T))) %matrix D corresponds to the amplitude of my signal
when I used t= [1*ones(1,400000) 17 17 17.01 17.02 17.03 17.4 18] with the same code the program just like hanged!!!!
Any help will be appreciated.
4 件のコメント
Luffy
2012 年 7 月 7 日
t= [1*ones(1,400000) 17 17 17.01 17.02 17.03 17.4 18];
T = t.*(t<=17) + 0*(t>17);
This generated T,but when i wanted to see it in variable editor it got hanged,however it ws able to plot plot(T,T),any other plot it showed out of memory
Image Analyst
2012 年 7 月 7 日
What does 17 have to do with anything? Is that where you detect the separation of one "frame" from the next "frame"???
Yasmin Tamimi
2012 年 7 月 11 日
Yasmin Tamimi
2012 年 7 月 11 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Signal Attributes and Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!