Alignment of 2 bits vectors and counting the number of errors
[b1,b2[,nerr,ber]] = cmp_bits(b1,b2); [b1,b2[,nerr,ber]] = cmp_bits(b1,b2,'p',k); // Try to solve phase ambiguity (2^k-PSK)
First bits vector (as output: realigned with b2)
Second bits vector (as output: realigned with b1)
Number of errors (in bits) between the 2 realigned vectors
Bit Error Rate
Try to find the best correlation between the 2 bit vectors and count the number of errors (ignoring the 2 first bits and 2 last bits).