Design And Implementation Of A Radio-Frequency Detection Algorithm For Use Within A Radio-Frequency System On Chip