Algorithm required to detect different phases of a real time data/signal.
2 次查看(过去 30 天)
显示 更早的评论
Hi, In the attached file we have ploted (red color), the performance of an processor vs number of ticks. The plot shows different behavior or phases during different ticks/execution. We want to mark these different phases as shown in the last figure (clipboard02) with black lines. All we need to do, is to write a CODE that we can automatically mark the change in the behavior as a phase, as shown in Figure (Clipboard) manually. Help from relevant experts would be appreciated. Thanks
0 个评论
采纳的回答
Elizabeth Reese
2017-8-21
First, you will need to establish some criteria for what a "phase change" should be. After doing this, you can use logical indexing to determine where the phase changes occur and then plot the thick black lines.
One way to determine a phase change is based on the "diff" function which calculates the difference between adjacent values in a vector. I have attached an example demonstrating this technique. Using the pure differences will be sensitive to noise in the data.
Another way to determine a phase change is based on deviation from the moving mean. For example, if you calculate the moving mean using the "movmean" function, you can compare the mean of the previous 10 ticks against the next tick. When the discrepancy between these values reaches a certain threshold, you have hit a new phase.
Once you have formalized what conditions indicate a phase change, you can follow the for-loop in the example and plot the horizontal and vertical lines.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!