필터 지우기
필터 지우기

Normalizing a set of data to zero

조회 수: 7 (최근 30일)
Hanna Armstrong
Hanna Armstrong 2022년 11월 29일
댓글: Hanna Armstrong 2022년 11월 29일
Data Attempting to clear:
Code:
%% Normalizing Step (2):IPS Direct Relationship
b_min = ( 1 ./ (quantile(peaks_b,1)))*1000;
IPS_norm_b = (1 ./ IPS_clean_b) *1000 ;
IPS_b = (IPS_norm_b - b_min) ;
IPS_data = IPS_b;
figure
plot(IPS_b)
title("IPS_normal_b")
%% Normalizing Step (3): Subtracting min values (step 2 repeat but in direct form)
x = 1: (length(IPS_b));
max2 = max(IPS_b)
max_minlimit3 = max2*.75;
[ TF3, P] = islocalmax(IPS_b, 'MinProminence', max_minlimit3);
% [ TF3, P] = islocalmin(IPS_data,'FlatSelection', 'all');
figure
plot(x,IPS_b,x(TF3),IPS_b(TF3),'r*')
title("IPS_b1")
IPS_min = mean(P(TF3))
IPS_datanorm = (IPS_b - IPS_min);
figure
plot(IPS_datanorm)
title('normal (3)')
Data After Code:
Hello,
I hope you are doing well. I am reaching out to the community to see if anyone can offer guidence with normalizing by data to zero. Essentionally I'm trying to get the vallies of my curves to bottom our at zero but this is not happening. If you have the time please help me out.
  댓글 수: 3
Walter Roberson
Walter Roberson 2022년 11월 29일
It sounds like they would like to subtract min() of the curves so that the shifted minimum becomes zero.
Hanna Armstrong
Hanna Armstrong 2022년 11월 29일
Hi Walter,
Thank you for providing this- I have changed it so I am subtracting the mean and not the max but now the minimum values are dipping to be bellow 0.

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

답변 (1개)

John D'Errico
John D'Errico 2022년 11월 29일
편집: John D'Errico 2022년 11월 29일
Do you want ALL of those minima to be zero? If so, then you will need to do something especially artful. If all you want is the global min to be zero, then just subtract the min of y.
yNorm = y - min(y);
But my guess is you are looking to somehow shift each local min to be zero. That will be difficult, because it will introduce discontinuities in the curve unless you are particularly careful about how you do it. The point is, your curve would need to be shifted by different amounts, based on how far off it is at that min.
I will not get into how you might do the latter, unless you really wanted some sort of solution there.
  댓글 수: 1
Hanna Armstrong
Hanna Armstrong 2022년 11월 29일
Hi John,
Thank you for answering my question. Unfortunatley, you are right that I am trying to adjust it so the global min is zero. I don't know if you can tell but with my current code I am subtracting everything by the third quartile valie. This is making some of the points zero but not all. I'm not sure if I would have to go to the extend of adjusting everypoint but I do need to find a way to identify the vally's of the curves and then maybe setting it equal to zero since most of the bumps in the valley is noise from my sensor.
Do you have any ideas to how I could possible do this... maybe I could derive the values?

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by