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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:05:41+00:00 2026-06-15T04:05:41+00:00

I have a sample graph like one below.., which I plotted with set of

  • 0

I have a sample graph like one below.., which I plotted with set of (x,y) values in an array X.

http://bubblebird.com/images/t.png

As you can see the image has dense peak values between 4000 to 5100

My exact question is can I programmatically find this range where the graph is most dense?

ie.. with Array X how can I find range within which this graph is dense?
for this array it would be 4000 – 5100.

Assume that the array has only one dense region for simplicity.

Thankful if you can suggest a pseudocode/code.

  • 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-15T04:05:43+00:00Added an answer on June 15, 2026 at 4:05 am

    You can use the variance of the signal on a moving window.
    Here is an example (see the graph attached where the test signal is red, the windowed variance is green and the filtered signal is blue) :

    simple example :

    test signal generation :

    import numpy as np
    X = np.arange(200) - 100.  
    Y = (np.exp(-(X/10)**2) + np.exp(-((np.abs(X)-50.)/2)**2)/3.) * np.cos(X * 10.)
    

    compute moving window variance :

    window_length = 30 # number of point for the window
    variance = np.array([np.var(Y[i-window_length / 2.: i+window_length/2.]) for i in range(200)])
    

    get the indices where the variance is high (here I choose the criterion variance superior to half of the maximum variance… you can adapt it to your case) :

    idx = np.where(variance > 0.5 * np.max(variance))
    
    X_min = np.min(X[idx])
    # -14.0
    X_max = np.max(X[idx])
    # 15.0
    

    or filter the signal (set to zero the points with low variance)

    Y_modified = np.where(variance > 0.5 * np.max(variance), Y, 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a sample application which constructs a filter graph to capture audio
For example I have a website that points to a page like this: http://www.mysite.com/folder/file
Does anyone have sample code, or a tutorial which demonstrates how to use Grappa
I'm trying to draw a simple line graph which would use values from the
Say I run a simple single-threaded process like the one below: public class SirCountALot
I have to implement a call graph for expressions like Id = Id(Param); and
I have a simple weighted graph A 1 / \\ 0.5 / \\0.5 B
I have a very simple line graph I'm trying to create in gRaphael. My
I have sample site: /index.html /appcache.manifest /style.css /test.js index.html: <!DOCTYPE HTML> <html manifest=appcache.manifest> <head>
I've started working on a little ruby project that will have sample implementations of

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.