Direct-sequence spread-spectrum receiver including code acquisition and detection using an autoadaptive threshold