Find the start and end position of a data frame in a pulsed signal

2 Ansichten (letzte 30 Tage)
Hello everyone,
I have a signal like this:
and would like a good way to find the start and end of each frame. Note that the size of each frame can be variable and sometimes the flat part in between could have an offset.
Thanks for your time and effort,
Paul

Akzeptierte Antwort

Joseph Cheng
Joseph Cheng am 27 Aug. 2014
so what one would do first is threshold a signal and perform an edge detection on it. something like this:
close all;
figure(1)
x = 0:.001:10;
y = 10*sin(50*pi*x);
bduration = [996 830 449 898 680 200];
bpoints = [1 3275 4582 5758 8211 9800];
for ind = 1:length(bduration)
y(bpoints(ind):bpoints(ind)+bduration(ind)) = 0;
end
y = y+(2*rand(1,length(x))-1);
minL = 160; %minimum samples for signal burst.
Ty = zeros(size(y));
Ty(abs(y)>5) = y(abs(y)>5);
edgefilt = [ones(1,minL) -ones(1,minL )];
Edges = [zeros(1,minL-1) conv(abs(Ty),edgefilt/160,'valid') zeros(1,minL)];
plot(x,y,x,Edges,'r');
and as you can see from the final plot just find the locations of the peaks.
  1 Kommentar
Paul Vicioso
Paul Vicioso am 16 Sep. 2014
Hi Joseph, thanks for your answer, and now it is partially working, but I have a problem detecting the edges of small signals, for example, in the next graph:
I can detect the edges of the first few frames but not (consistently) the smaller ones (to the right), can you give me a hint of how to do it or even how to tweak your function to detect these signals?
Thanks for your help,
Paul Vicioso

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by