Implemented detect_preamble in receiver.py