How to find the slope of phase data (between two points) which is uneven

7 visualizaciones (últimos 30 días)
I have a phase vs frequency plot. I need to find the slope between point 'a' and point 'b' in an automated way instead of looking at the points 'a' and 'b' and calculating the slope. Can anyone help me with this?

Respuesta aceptada

Image Analyst
Image Analyst el 12 de Oct. de 2018
You ask ONLY about the slope, not about finding a and b, so I assume you've found "a" and "b" already. So, assuming your "a" is index1 and "b" is index2, you can do this
coefficients = polyfit(x(index1):x(index2), signal(index1:index2), 1);
slope = coefficients(1);
  3 comentarios

Iniciar sesión para comentar.

Más respuestas (2)

jonas
jonas el 12 de Oct. de 2018
Editada: jonas el 12 de Oct. de 2018
I would suggest using either findpeaks to determine points a and b and then calculate the average slope or alternatively using findchangepts. If you want code, then I suggest you upload some data.
  3 comentarios

Iniciar sesión para comentar.


Greg Dionne
Greg Dionne el 26 de Oct. de 2018
You could try a combination of unwrap (to remove the jumps of your array) and sgolay to do the differentiation. See the second example on how to perform differentiation.

Community Treasure Hunt

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

Start Hunting!

Translated by