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 7172453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:37:06+00:00 2026-05-28T15:37:06+00:00

I’m doing video analysis. The end result array I get is something like: signal

  • 0

I’m doing video analysis.
The end result array I get is something like:

signal =

    Columns 1 through 7

       73960       73960       73960       73960       68102       68102       68102

  Columns 8 through 14

       68102       19187       19187       19187       19187       14664       14664

  Columns 15 through 21

       14664       14664       13715       13715       13715       13715       30832

  Columns 22 through 28

       30832       30832       30832       53031       53031       53031       53031

  Columns 29 through 35

       56897       56897       56897       16104       16104       16104       16104

  Columns 36 through 42

       15188       15188       15188       15188       13973       13973       13973

Note: actual array I get is usually 600+

So when I plot this I get very bad looking graph, so I want to filter this array and only keep the ** maximal and minimal peaks** local maxima and minima so that the graph would have nicer waves

Is there a way I can do it with MATLAB?

if not then can I do it with excel?
as I usually save this array to excel sheet Like this

0.1 68102
0.15    19187
0.2 14664
0.25    13715
0.3 30832
0.35    53031
0.4 56897
0.45    16104
0.5 15188
0.55    13973
0.6 21437
0.65    66950
0.7 65356
0.75    22562
0.8 14154
0.85    13938
0.9 20692
0.95    72823
1   69975
1.05    15328
1.1 14494
1.15    13681
1.2 14205
1.25    65278
1.3 63055
1.35    16999
1.4 14050
1.45    14245

In which the 1st column is the time(y-axis) and 2nd column is the amplitude.(x-axis)

I use this formula to count local maxima (Thanks to brettdj from stackoverflow.com)

=SUMPRODUCT(--(B2:B149>B1:B148),--(B2:B149>B3:B150))

And this formula to count local minima

=SUMPRODUCT(--(B2:B149<B1:B148),--(B2:B149<B3:B150))

But what I need is to filter the array to only keep local maxima and local minima so I can get nicely drawn curve without noise.

  • 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-05-28T15:37:07+00:00Added an answer on May 28, 2026 at 3:37 pm

    If you want the maximum and minimum values just use:

    [sig_min, idx_min] = min(signal);
    [sig_max, idx_max] = max(signal);
    

    But I couldnt understand exactly what you want… since my account is new, I cant comment on your question to try to understand it better.

    — edit 1:

    Ok, now I understand what you want. I don’t know why you have this array with repetitive numbers, but supposing you don’t want them, or, at least, that is better to remove them to find local maxima and minima, you should do:

    sinal_norep = signal(find(diff(sinal)));
    

    where signal_norep will be your new array containing only values that differs from the last one:

    On the left is your signal, on the right the new one

    Now we can search for the index where occurs local maxima and minima on this array, by doing:

    minimas_idx = find(signal_norep(2:end-1)<signal_norep(1:end-2) & signal_norep(2:end-1)<signal_norep(3:end))+1;
    maximas_idx = find(signal_norep(2:end-1)>signal_norep(1:end-2) & signal_norep(2:end-1)>signal_norep(3:end))+1;
    

    And their values:

    signal_maximas = signal_norep(maximas_idx);
    signal_minimas = signal_norep(minimas_idx);
    

    Thats it x)

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.