detect the peak or valley in a 1 d signal in matlab:The following Matlab project contains the source code and Matlab examples used for detect the peak or valley in a 1 d signal. %To detect the Peak or valley in a 1 D signal % input: y signal ;n*1 % T threshold of D-value ,which is difference between the peak value % or valley value and bilateral value % d the distance of bilateral value % p_v parameter for peak or valley ;p_v=0 all;pv=1,peak only;others % valley only % example [x1 x2 x3 x4 x5] d=2; T=0.