This feels like a homework assignment, and I hate just solving homework assignments outright. Perhaps this will help though.
You mention bits, so I'll guess the "signals" are intended to be some kind of modulated data. I'll just guess at QPSK from the example data. The P in QPSK means phase. Supose I had two functions that were of the form
x1=exp(j*m1(t))
and
x2=exp(j*m2(t)),
where m1(t) and m2(t) represent a message encoded in the phase of the complex signal. Do I really just want to get to m1(t)-m2(t)?
Although you could take the angle of them individually, you run into troubles with the 0's that don't have a defined angle.
I offer two axioms to point you in the direction I would go.
conj(e(ja)) = e(-ja)
a^b * a^c = a^(b+c)
If you are new to matlab help on "ops" and help on "find" are probably the best spots to start. Many new folks don't grasp the difference between *
and .*
, though that tends to be based on how much linear algebra background they have. Later be ready for matlab and others to tell you you did something with find that you could do more efficiently other ways, but conceptually I think find is an easier starting point.
idx=find(abs(a-b)<.001)
idx=find(abs(a-zero)<.001) | abs(b-zero)<.001 )
returns vectors of indexes where the expression of the find is true.
apuntured=a; apuntured[idx]=[]; bpunctured=b; bpunctured[idx]=[];
delete the values at the given indexes and pack the resulting vectors.
For complex values the functions real()
, imag()
, abs()
, and angle()
extract rectangular and polar components.