Implemented energy and window length selection criteria.