I have a plot of attenuation V frequency and I am wondering if there is a way I can fit a straight line the follows the upper trajectory of the graph, so that you would see the line increase and then level off. I have tried a few methods but getting lines through the middle etc. Many Thanks

3 Comments

Please explain "upper trajectory". Do you mean the subset of points formed by the oscillation peaks?
Also, I recommend attaching your data in a .mat file so that we can demonstrate solutions.
Thanks I will keep this in mind for future. How do I include my data as a .mat file?
Dave :)
Matt J
Matt J on 22 Apr 2022
Edited: Matt J on 22 Apr 2022
The toolbar has a a file attachment option.

Sign in to comment.

 Accepted Answer

John D'Errico
John D'Errico on 21 Apr 2022

0 votes

Easy.
  1. Use findpeaks, to locate the sequence of points that represent the successive maxima of the curve.
  2. Use an interpolating spline to then interpolate those points. A tool like interp1 will be simplest. Specify the 'pchip' option.

More Answers (0)

Categories

Products

Release

R2021b

Asked:

on 21 Apr 2022

Edited:

on 22 Apr 2022

Community Treasure Hunt

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

Start Hunting!