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

1 回表示 (過去 30 日間)
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?

採用された回答

Gurudatha Pai
Gurudatha Pai 2013 年 5 月 1 日
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 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by