I am sending a PN9 sequence from a sender to a receiver and want to compare the received bitstream (RB) to the sent one (SB). I am assuming that the transmission will get distorted and want to somehow correlate RB to SB in order to get a number which helps me to measure the distortion or the quality of the transmission or call it the bit error rate. Hope I have made it clear. If not, please ask. Any ideas or hints for me?


How would you compare both bit streams? On a PC? I could imagine to redirect the stream from the receiver to a PC via UART. If the PN9 which my sender generates is constant (that I assume as for now) the only question would be which tool to use in order to do the autocorrelation. Any other ideas? Maybe on an oscilloscope (I doubt thats easily possible).

  • \$\begingroup\$ You could use cross correlation to compare RB and SB. The maximum correlation value will be an indicator of how alike RB and SB are. \$\endgroup\$ – Peter Karlsen Feb 19 at 12:29

In order to measure BER, you need to compare the received data stream to a reference data stream that has the same data and is correctly time-aligned with it. Using a PN generator at each end tells you what the data is, but nothing about the time alignment.

In that case, you can use cross-correlation to find the most likely time alignment. With the PN9 sequence, this means trying every one of the 511 possible alignments in order to find the one that has the largest number of bits that match. Then, the number of mismatched bits in that alignment gives you the BER.

Is this the sort of hint you're looking for? If not, you need to make your question much more specific.

  • \$\begingroup\$ Yes so far I already thought, though it is good to read a kind of proof for that concept. Ill edit the question to be more specific. Thanks. \$\endgroup\$ – stowoda Feb 20 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.