微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > detect zero crossing using matlab coding

detect zero crossing using matlab coding

时间:03-30 整理:3721RD 点击:
Hello there
I am trying to write a code to detect the zero crossing in a sine wave using matlab
i have obtained the signal from an oscilloscope in xlsx file
it contains voltage against time ( two columns and 10000 rows)
I want to detect & plot the zero crossing of the signal
Please have a look at my waveform

The only thing that comes to mind is to take the rolling average of a large number of cycles, let's say n, and compare this result with the current value to check if it is above or below. Considering that the waveform has an amplitude varying along many cycles, you have to make some experiments to determine the smaller value for n which satisfy the need.

Hi,

Usually a compare with 0... then you get a square wave...
And if you just want the edges, then simple say: "if the value before is not the actual value"

To simplify..without square wave
You could just keep an eye on the sign bit of the input signal: "if the value before is not the actual value"

Klaus

Yes, that is called Bolzano's Theorem. Keep an eye on the sign and then just make that interval as small as you can.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top