필터 지우기
필터 지우기

Algorithm required to detect different phases of a real time data/signal.

조회 수: 4 (최근 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

채택된 답변

Elizabeth Reese
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.
  댓글 수: 1
Qazi  Arbab Ahmed
Qazi Arbab Ahmed 2017년 8월 22일
Thanks Liz. The example is quite helpful. I need to change the phases, As I want to include certain small number of fluctuation in the same phase until it appears more than twice. I will do this and will back to you. Thanks again.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by