Hi! all I am reading one research paper in that I found one peak detection algorithm, I am just trying to understand how it works please anyone help me to convert algorithm to awk as I am not able to understand, here I am attaching that paper also, please help me to understand this logic (Page number 9)
X[n] be an array holds some information
X[n]={5,6,7,8,9........n}
then
How to apply this formula
S(k,i,x,T)=max{x-x[i-1],x-x[i-2]....x-x[i-k]}+max{x-x[i+1],x-x[i+2]...x-x[i+k]}/2
and how can I return resulting value in function S to called function