Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:31:19+00:00 2026-06-02T16:31:19+00:00

For this type of data I want to do an interpolation like fit from

  • 0

For this type of data I want to do an interpolation like fit from one maxima to a minima and so on, so I can look for superimposed high frequencies:

I have a matrix of values such as:

a=[ 3 7 10 3 1 5 10 5  3 2 4 8 10 7 4 3 4 2 1 4 5 7 10 8 7 6 6 4 3 2];

Now I want to choose the relative and maximum and minimum values such that

a=[ 3 0 10 0 1 0 10 0  0 2 0 0 10 0 0 0 0 0 1 0 0 0 10 0 0 0 0 0 0 2];

I essentially want to fit a straight line from a(1) to a(3) and then from a(3) to a(5) and so on, and then subtract the fit from the data.

I know there is a function “detrend” that uses a breakpoint method it denotes as “bp”, and that is the closest thing I found resembling my goal.

If you know of a way MATLAB can do this I will greatly appreciate it, otherwise it seems like I have to write an m-file to do it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:31:20+00:00Added an answer on June 2, 2026 at 4:31 pm

    I think what your question is asking for is interpolation between the local minima and local maxima of a time series (what you call the “relative minimum and maximum values”.)

    See this similar question and add some code that does a linear interpolation between the local minima and maxima.

    interp1() will do this handily. There is no need for the input points or the output points to be evenly spaced.

    >> x = sort(rand(1,10));
    >> y = rand(1,10);
    >> plot (x,y,'r.');
    >> xx = 0:0.01:1;
    >> yy = interp1(x,y,xx);
    >> hold on;
    >> plot (xx,yy,'b-')
    

    enter image description here


    What I think you really want to do is decompose the signal into components based on local time scale. (that is, where the frequencies change with time). Use the empirical mode decomposition. Wavelet methods might be an alternative, but the output of the EMD is very easy to interpret visually.

    Image


    Incidentally, the plain FFT won’t work if applied to the entire length of a signal that is time varying – the FFT assumes a stationary (non-varying) signal.

    You need to apply the Short-Time Fourier Transform, which is the FFT applied over sliding windows of the data to get a picture of frequency over time. See the spectrogram() function.

    >> plot (x,y)
    >> x=0:0.001:1;
    >> y = chirp(x);
    >> plot (x,y);
    >> figure;
    >> spectrogram(y);
    

    enter image description here

    There are issues with time vs. frequency resolution of the short-time Fourier transform that limit its application when your sampling rate is low compared to the frequency of the data. It would would be unlikely to work well for the example data you posted a picture of.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to Display this type of Data using Divs and other elements like
I want to stack this type of my data set: PATIENT_ID AA BB CC
I have a recursive data type like this: template<typename T> struct SomeType { std::map<T,
Imagine I have a recursive algebraic data type like this (Haskell syntax): data Expr
Can I use dynamic data type in WF 4.0? And if this is possible
I have a data frame that looks like this: type created_at repository_name 1 IssuesEvent
Sometimes, I usually create a class with the type of data I want like
This is one function in the C++ header file I want to call from
I want to display tabular type data, but it will not be coming from
I have this type of data: entity, account, month1, month2, ..., month12 abc, 2000.02,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.