Why does findchangepts doesn't work right?
1 回表示 (過去 30 日間)
古いコメントを表示
Hey guys, For the attached data file i use the following code so i can find the areas for each of the four separate waves:
D = load('008a_100Hz.mat');
Ch9 = D.Channel_9_Data;
tv = D.Channel_1_Data; % Time Vector
[lpt,rsd] = findchangepts(Ch9, 'Statistic','rms', 'MaxNumChanges',8);
for k1 = 1:2:numel(lpt)-1
sig_seg{(k1+1)/2,1} = Ch9(lpt(k1):lpt(k1+1)); % Signal Values At Each Segment
sig_seg{(k1+1)/2,2} = lpt(k1):lpt(k1+1); % Index Range
end
vl = bsxfun(@times, ones(numel(lpt), 2), [min(Ch9) max(Ch9)]); % Create Vertical Lines For ‘figure(1)’
figure(1)
plot(tv, Ch9)
hold on
plot([tv(lpt),tv(lpt)]', vl', '-r', 'LineWidth',1.5)
hold off
grid
With the code I get sth. like this:
The second vertical line should be on the right of the first waves. Any ideas how that might work? Thanks people:)
1 件のコメント
jonas
2018 年 9 月 17 日
Related Q
https://se.mathworks.com/matlabcentral/answers/418641-how-to-create-plots-for-special-areas-of-an-array
回答 (1 件)
Greg Dionne
2018 年 9 月 17 日
編集済み: Greg Dionne
2018 年 9 月 17 日
If you have R2016b or later try:
Fs = 100;
[sst,f] = fsst(Ch9,Fs,kaiser(512,10));
fridge = tfridge(sst,f,10,'NumRidges',1);
findchangepts(fridge,'Statistic','mean','MaxNumChanges',8)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!