Find the start and end position of a data frame in a pulsed signal
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Paul Vicioso
am 26 Aug. 2014
Kommentiert: Paul Vicioso
am 16 Sep. 2014
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
0 Kommentare
Akzeptierte Antwort
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!