From: Ravi Rastogi on
Hi guys,

In my 1D data for my application i need to determine the start and stop time of the bursts. currently i am using using 'ginput' to manually select the points of changes.
Here is what i am doing:

%Loading the Data
load DX.mat
load DY.mat
%Determining the starting and stopping points of Bursts,
figure;
plot(Dx20);
title('1D plot of the data');
%Input how many bursts are there, looking at the data.
nobst=input('Please enter the no of bursts in the signal: ');
%Use Ginput to get the values of the start and stop: first is always start and next is %stop point.
[rxx,~]=ginput(nobst*2);
%Read the burst points:
tmp=1;
for h=1:2:nobst*2,
startx(tmp)=round(rxx(h));
stopx(tmp)=round(rxx(h+1));
tmp=tmp+1;
end;
clear nobst rxx h tmp;
%%Repeat the same for DY20:

PS:: is there a way to attach the data file in the post??

Can someone suggest a better way to do this automatically rather than me selecting the start and stop points manually as i am doing right now??
I looked at determining the threshold based on the amplitude of the signal, but in the data (sinusoidal) there are many times the signal crosses that threshold before coming to the resting amplitude and the code keeps picking those times also when it crosses. I am interested in detecting the point in time just before the burst starts from the resting amplitude and when it ends in time before coming to resting amplitude again, nothing between these two values.
If you can think of any way please suggest!!

Ravi