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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:46:38+00:00 2026-06-13T16:46:38+00:00

Not sure if this may or may not be valid here on SO, but

  • 0

Not sure if this may or may not be valid here on SO, but I was hoping someone can advise of the correct algorithm to use.

I have the following RAW data.
enter image description here

In the image you can see “steps”. Essentially I wish to get these steps, but then get a moving average of all the data between. In the following image, you can see the moving average:

enter image description here

However you will notice that at the “steps”, the moving average decreases the gradient where I wish to keep the high vertical gradient.

Is there any smoothing technique that will take into account a large vertical “offset”, but smooth the other data?

  • 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-13T16:46:39+00:00Added an answer on June 13, 2026 at 4:46 pm

    Yup, I had to do something similar with images from a spacecraft.

    Simple technique #1: use a median filter with a modest width – say about 5 samples, or 7. This provides an output value that is the median of the corresponding input value and several of its immediate neighbors on either side. It will get rid of those spikes, and do a good job preserving the step edges.

    The median filter is provided in all number-crunching toolkits that I know of such as Matlab, Python/Numpy, IDL etc., and libraries for compiled languages such as C++, Java (though specific names don’t come to mind right now…)

    Technique #2, perhaps not quite as good: Use a Savitzky-Golay smoothing filter. This works by effectively making least-square polynomial fits to the data, at each output sample, using the corresponding input sample and a neighborhood of points (much like the median filter). The SG smoother is known for being fairly good at preserving peaks and sharp transistions.

    The SG filter is usually provided by most signal processing and number crunching packages, but might not be as common as the median filter.

    Technique #3, the most work and requiring the most experience and judgement: Go ahead and use a smoother – moving box average, Gaussian, whatever – but then create an output that blends between the original with the smoothed data. The blend, controlled by a new data series you create, varies from all-original (blending in 0% of the smoothed) to all-smoothed (100%).

    To control the blending, start with an edge detector to detect the jumps. You may want to first median-filter the data to get rid of the spikes. Then broaden (dilation in image processing jargon) or smooth and renormalize the the edge detector’s output, and flip it around so it gives 0.0 at and near the jumps, and 1.0 everywhere else. Perhaps you want a smooth transition joining them. It is an art to get this right, which depends on how the data will be used – for me, it’s usually images to be viewed by Humans. An automated embedded control system might work best if tweaked differently.

    The main advantage of this technique is you can plug in whatever kind of smoothing filter you like. It won’t have any effect where the blend control value is zero. The main disadvantage is that the jumps, the small neighborhood defined by the manipulated edge detector output, will contain noise.

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

Sidebar

Related Questions

This may be for most languages in general, but I'm not sure. I'm a
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure how to best explain this, so this may be a bit
This may be a stupid question, as I'm not sure how MSBuild works with
Not sure this is possible, but looking to write a script that would return
I'm not sure this is even possible but I know if it is, the
I am not sure this can be done at all... Background: I am constructing
I have done this in the past, but I cant remember the correct way
Not sure this is a known issue. I’m using VS2012 RC (Ultimate), and Win8
Disclaimer: not sure this is WordPress related or not. I'm following a simple tutorial

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.