I'm searching for a way to parse a signal that mixes multiple square waves of different frequencies.
The intended output is the frequency of each of the mixed square waves.
This answer provides an example of mixing signals, he uses OR gate as an example, but we could change to a more appropriate one if needed (as to highlight more details - as XOR).
Where should I find my answer? or what would be the algorithm(s) to go?
======
This is a modified MATLAB code that plots the output of OR/XOR:
N = 1024;
p1 = sin(2*pi*3.5*[0:N-1]/N) > 0 ;
p2 = sin(2*pi*15.5*[0:N-1]/N) > 0 ;
figure,subplot(4,1,1)
plot(p1);title('square wave 1');
axis([1,N,-0.5,1.5])
subplot(4,1,2)
plot(p2);title('square wave 2');
axis([1,N,-0.5,1.5])
subplot(4,1,3)
plot(p1 | p2);title('the OR summed waves');
axis([1,N,-0.5,1.5])
subplot(4,1,4)
plot(bitxor(p1, p2));title('the XOR summed waves');
axis([1,N,-0.5,1.5])
Which outputs: