CirugiaoM
CirugiaoM

Reputation: 35

Detection of zero crossing with false positives

I have this signal as shown in the figure, I have detected several zero-crossings. But some of them are false positives. In reality, the true zero crossings are the ones at 33.15,33.31 and 33.49us. Do you have any idea how I can avoid the detection of the false positives, or at least how can I get rid of them?enter image description here

Upvotes: 1

Views: 234

Answers (1)

Anthony
Anthony

Reputation: 3793

You can first gate the signal area based on prominence of local maxima or minima:

prom_threshold = 50; % adjust this value based on the amplitude of your signal.
[~,prom] = islocalmax(signal);
ind = find(prom > prom_threshold);
if numel(ind) < 2
    error('Signal not found');
end
gated_signal = signal(ind(1):ind(end));

% Do your zero crossing algorithm.

Read localmaxima and prominence.

Upvotes: 1

Related Questions