필터 지우기
필터 지우기

How to use logic between two points with only a negavite slope?

조회 수: 1 (최근 30일)
Andrew
Andrew 2017년 8월 8일
댓글: Andrew 2017년 8월 10일
I have a vector that starts at ~84 decreases to ~77 and then increases to ~84 again. I am only interested in the negative slope of this vector! For example, in the image below, I am only interested in the x points between ~2100 and ~9500 as that is the decreasing slope. Using my logic selects both the negative and positive slope. I am sure there are better ways to do this. Any help would be appreciated.
wndwSize = 30;
h = ones(1,wndwSize)/wndwSize;
G = filter(h, 1,file.data.X.signals.values>78.1) & filter(h, 1,file.data.X.signals.values<82.9);
  댓글 수: 2
Jan
Jan 2017년 8월 8일
What is shown in the diagram? Where do the values 78.1 and 82.9 come from? What does "interested in the negative slope of this vector" exactly mean? What do you need as output?
Andrew
Andrew 2017년 8월 8일
편집: Andrew 2017년 8월 8일
Well, the diagram above is from the following image. It is just logic between to points. It is filtered to reduce noise. My reference to the negative slope is the decrease part of the plot below. The positive obviously would be the increasing. I need to only process data between 78.1 and 82.9 in the decreasing section. I want the output to only be "true" there. I will try your answer below.

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

채택된 답변

Jan
Jan 2017년 8월 8일
"Negative slope" sounds like:
index = (gradient(file.data.X.signals.values) < 0);
Or do you mean:
v = filter(h, 1,file.data.X.signals.values);
index = (v > 78.1) & (v < 82.9);
I'm not sure about the meaning of the question.
  댓글 수: 5
Image Analyst
Image Analyst 2017년 8월 9일
Noise is not signal. So how does filtering out noise -- that is, removing noise to get the true signal -- make the data less precise??? The noise made the data less precise (not the filtering), so by not filtering and keeping the noise, that's what will make it less precise. I've never heard anyone say that keeping noise mixed in with their signal made it more precise than the signal alone.
Andrew
Andrew 2017년 8월 10일
In short, yes, you are correct, it is my noise that is causing issues in regards to the gradient. Only significant filtering would resolve the issue. But it began to change my results file to file by up to 5%. Where I could do it by hand and get more consistent results. Note, I am only mediocre at matlab, and learn pretty much as I go.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by