Find the start and end position of a data frame in a pulsed signal
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Paul Vicioso
el 26 de Ag. de 2014
Comentada: Paul Vicioso
el 16 de Sept. de 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 comentarios
Respuesta aceptada
Joseph Cheng
el 27 de Ag. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!