MATLAB Answers

How to plot common zero crossings of 3 different signals (3 sinusoidal signals)?

6 views (last 30 days)
Hi, I am new to Matlab.
I am looking to plot the common zero crossings of three signals
Ex: I have 3 sine waves:
x = sin(2*pi*fo*t);
x1 = sin(t+sin(t.^2));
x2 = x+x1;
I need to find and plot the common zero crossing points in all the three signals.
Can anyone please help me out with this?

  0 Comments

Sign in to comment.

Accepted Answer

Gurudatha Pai
Gurudatha Pai on 1 May 2013
This may sub-optimal but definitely a start. I would find the zero crossings of each as a vector of 1's and 0's and add them. Then find the sum of them.
x_index = ZeroCrossing(x);
x1_index = ZeroCrossing(x1);
x2_index = ZeroCrossing(x2);
sum_index = x_index+x1_index+ x2_index ;
ZC_index = (sum_index == 3);
function x = ZeroCrossings(x)
x(x>0) = 1;
x(x<0) = 0;
x = abs(diff(x));
end
Hope that gives you some idea! I am certain others will have better way of doing it!
I think the above code should work, but I haven't tested it!! So, please be advised!

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.