partitioning signal into windows

Hi all, am working on a system to detect fall from an elderly person..my algorithm is as follows..but i have problem in partitioning the signals in moving windows...any ideas on the code to be used?
Fall Detection Algorithm
The fall detection algorithm is implemented as follows.
The resultant acceleration signal is partitioned using a
1.5-s window segment with 50% overlap (S).
For a segment, the following values are computed: the
maximum resultant acceleration of the segmented
signal (Smax), the minimum resultant acceleration of
the segmented signal (Smin), the time when Smax occurs
(Imax), and the time when Smin occurs (Imin).
The resultant acceleration signal is classified as a fall
if (Smax MaxTh) and (Smin MinTh) and (Imin < Imax),
where MaxTh = 1.75g and MinTh = 0.75g.
Otherwise, the signal is classified as an ADL. This

Respuestas (2)

Walter Roberson
Walter Roberson el 30 de Dic. de 2011

0 votos

5 comentarios

Adetunji
Adetunji el 2 de En. de 2012
thanks i was able to see some things in there but as i am not an expert matlab user,i was able to come up with the following code which still needs modification
clear mean_a;
clear std_a;
subplot(3,1,1),plot(data(30:1045,5));
for i=1:1016
mean_a(i,1)= mean(data(i:i+29,5)); % mean of 30 samples
std_a(i,1) = std(data(i:i+29,5));
subplot(3,1,2),plot(mean_a);
subplot(3,1,3),plot(std_a);
pause(0.01);
if data(i,5)>=100
disp('fall!')
end
end
what i am trying to do is segment the data into 30 samples and take the mean or standard deviation. I am trying to extract the features of the accelerometer data given. I want to have the mean of every 30 sample and display.it is based on this that i want to determine the threshold...thanks
Walter Roberson
Walter Roberson el 2 de En. de 2012
That code uses overlapping windows of length 30. Are you sure you want the windows to be overlapping, or do you want to use non-overlapping windows?
Adetunji
Adetunji el 4 de En. de 2012
dear Walter,i actually would like non-overlapping windows.How can i display the result?
Walter Roberson
Walter Roberson el 4 de En. de 2012
For non-overlapping windows, you have a problem because your data length is not a multiple of the window size.
When the data is a multiple of the data size, usually the easiest way to proceed for non-overlapping windows is to reshape() the data to be (window size) by (number of segments); then you can mean() and std() against the first dimension (the default) and so do all the segment calculations at the same time.
Adetunji
Adetunji el 5 de En. de 2012
below is the code that i have got..could you help modify it as you have suggested up here?I would like to see the the result of both (overlapping and non-overlapping)...thanks
clear mean_a;
clear std_a;
subplot(3,1,1),plot(data(30:1045,5));
for i=1:1016
mean_a(i,1)= mean(data(i:i+29,5)); % mean of 30 samples
std_a(i,1) = std(data(i:i+29,5));
subplot(3,1,2),plot(mean_a);
subplot(3,1,3),plot(std_a);
pause(0.01);
if data(i,5)>=100
disp('fall!')
end
end

Iniciar sesión para comentar.

Abhijit Warke
Abhijit Warke el 4 de Sept. de 2012

0 votos

you can try using the function buffer.

1 comentario

Walter Roberson
Walter Roberson el 4 de Sept. de 2012
It is not clear how that differs from my earlier response?

Iniciar sesión para comentar.

Preguntada:

el 30 de Dic. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by