find pulsed trigger events

版本 1.0.0.0 (2.2 KB) 作者: Deborah
The function finds the start of pulsed events in a signal via a trigger limit.
346.0 次下载
更新 2013/6/14

查看许可证

I had the problem of needing to find an unknown number of pulses in a signal, but I knew the pulse rate and the approximate length of the pulses (but there could be some missing). This function has a trigger with downtime functionality and will find all events with a given trigger level.

% Example 1
% generate signal with two pulses of random noise:
sig = [zeros(1,200) .5-rand(1,20) zeros(1,200) .5-rand(1,20)];
fs = 440;
level = .02;
prate = 2;
triggerindex = get_trigger(sig, level, fs, prate, 'r');
% make it visible:
figure;
plot(sig); hold on
plot(triggerindex, sig(triggerindex), 'or')

I wrote this some time ago and I know it could be made more efficient, but for the signal lengths I'm dealing with it works okay. But feel free to post some improvements.

引用格式

Deborah (2026). find pulsed trigger events (https://ww2.mathworks.cn/matlabcentral/fileexchange/42227-find-pulsed-trigger-events), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2010b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Descriptive Statistics 的更多信息
版本 已发布 发行说明
1.0.0.0