peak detection parameters passed as array