Werner; Sorry for asking too many questions.
I am using mathcad 14 on my personal computer and the function localmax doesn't work here. Also Get_Extrema() routine does not detect the peak when it is at zero position. Could you please tell me what changes should be done on Get_Extrema() or how can I add localmax to Mathcad 14?