Improve signal unique algorithm