How to 'flip/reverse' the signal?

34 Ansichten (letzte 30 Tage)
Tomaszzz
Tomaszzz am 9 Mär. 2022
Bearbeitet: Voss am 11 Mär. 2022
Hi all,
I have a signal like this (attached). This is sensor orientation data in z dimension during human walking.
I am extracting parts of the signal between red vertiical lines (precisely between first 8 and last 8 pairs of the lines).
When I plot all of them over one figure I get this.
hold on
for i = 1:length(S_or_z_cycle)
plot(S_or_z_cycle{i},'r') ;
title('Shank orientation Z'); xlabel('% of movement cycle'); ylabel('degrees')
end
Is there a way to "flip/reverse" the signal below 0 so it aligns with the signal above 0, remaining its shape? When I apply "-" I get this which is not what I want as it changes the shape of the signal.
Wheareas I want something like this:
  1 Kommentar
Mathieu NOE
Mathieu NOE am 9 Mär. 2022
Bearbeitet: Mathieu NOE am 9 Mär. 2022
hello Tomaszzz
seems you want to apply a vertical shift of the negative data so they overlay with the positive ones
this shift is computed by taking the mean of the negative curves minus the mean of the positive curves

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Voss
Voss am 11 Mär. 2022
Bearbeitet: Voss am 11 Mär. 2022
load('data.mat')
hold on
for i = 1:length(S_or_z_cycle)
if mean(S_or_z_cycle{i}) > 0
plot(S_or_z_cycle{i},'r');
else
plot(S_or_z_cycle{i}+360,'r');
end
title('Shank orientation Z'); xlabel('% of movement cycle'); ylabel('degrees')
end

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by