View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
find pulsed trigger events

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 2.19 KB File ID: #42227 Version: 1.0
image thumbnail

find pulsed trigger events



The function finds the start of pulsed events in a signal via a trigger limit.

| Watch this File

File Information

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:
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.

Required Products MATLAB
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us