![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/917519/image.png)
How to flip a signal ?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tomaszzz
el 7 de Mzo. de 2022
Respondida: Mathieu NOE
el 7 de Mzo. de 2022
Hi all,
I have an acceleration signal during human walking (walk forward, turn around, walk back).
The attached is the 24x1 cell containing arrays of dimensions 100x 1 and each of these respresent acceleration signal between certain indices in the signal. Each array is plotted over the figure below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/917489/image.jpeg)
When the subjects turns around, it seems the signal is flipped around resulting in a half of the arrays being a negative mirror image of the remaining half of the arrays.
This is more visible if a plot first 12 arrays and second 12 arrays on seperate figures:
%Load data
load('P_acc_y_cycle')
%Plot each array
figure
hold on
for i = 1:12
plot(P_acc_y_cycle{i},'r');
end
figure
hold on
for i = 13:24
plot(P_acc_y_cycle{i},'r') ;
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/917494/image.jpeg)
How can I flip the first part (first 12 arrays) so it resembles the second part?
0 comentarios
Respuesta aceptada
Mathieu NOE
el 7 de Mzo. de 2022
hello
you simply apply a negative gain = -1 to your data you want vertical flipped
%Load data
load('P_acc_y_cycle')
%Plot each array
figure
hold on
for i = 1:12
plot(-P_acc_y_cycle{i},'r'); % here negative gain = -1
end
for i = 13:24
plot(P_acc_y_cycle{i},'b') ;
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/917519/image.png)
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Annotations 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!