Decision Based Median De - Noise Filter

<< Click to Display Table of Contents >>

Navigation:  Filters >

Decision Based Median De - Noise Filter

 

Description

The Decision Based Median De-Noise Filter suppresses impulsive noise (spikes) in seismic gathers by applying a 2D sliding-window median filter. For every sample in the gather, the filter examines a rectangular neighborhood spanning a number of adjacent traces and a time range. Within that neighborhood it computes the median of the absolute amplitude values. If the amplitude of the central sample exceeds the local median by more than a user-defined threshold, the sample is classified as a spike and replaced — either by zeroing it out or clipping it down to the median level. After spike replacement, each output sample is additionally constrained to lie within a user-defined number of standard deviations of the local mean, providing a secondary guard against residual outliers.

This module is most useful for removing isolated high-amplitude bursts and recording glitches from raw or lightly pre-processed pre-stack data. It is designed to operate trace-by-trace across the gather in a multi-threaded mode for efficiency. Note that this module is deprecated and may be removed in future versions of g-Platform.

Input data

Input DataItem

Connect the seismic data source to be filtered. This connector accepts a standard seismic data item (SEG-Y handle, gather index, or in-memory gather) and provides the trace header information used for gather assembly.

Input gather

The seismic gather to be de-noised. Each gather is processed independently. The filter operates on the 2D amplitude matrix of the gather (traces along the horizontal axis, time samples along the vertical axis). Both pre-stack gathers (CMP, shot, offset) and post-stack sections are supported.

Parameters

Filter type

Controls how amplitudes are transformed before the median is computed. This setting does not change the domain of the output data — the final result is always returned to the original amplitude domain. Options:

Normal (default) — spike detection is performed on the signed amplitude values directly, with the median computed from absolute values. This is the standard choice for most seismic data.

Absolute value — the filter is applied to the absolute amplitude envelope of each trace. Negative polarities are restored to the output after filtering. Use this when the noise is predominantly one-sided or rectified.

Logarithmic — amplitudes are converted to a decibel scale (10 log10(|A|)) before filtering, then back-transformed after. This compresses the dynamic range so that very large spikes have less distorting influence on the median. Note: this mode will fail if any sample value is exactly zero.

Range size (in sigmas)

Default: 3. After a spike has been replaced (either zeroed or clipped), this parameter applies a secondary amplitude constraint: each output sample is clamped to the interval [mean - N*sigma, mean + N*sigma], where the mean and standard deviation are computed over the same sliding window as the median, and N is this parameter. A value of 3 means output samples cannot deviate more than 3 standard deviations from the local mean. Increasing this value relaxes the constraint; setting it very high effectively disables it. Decrease it (e.g., to 1 or 2) only if strong residual outliers remain after the primary median test.

Horizontal sliding window

Default: 40 traces. Minimum: 5 traces. Sets the half-width of the sliding window in the trace direction. The full window spans 2 x TraceWindow + 1 traces centered on the current trace (e.g., the default of 40 gives an 81-trace window). A larger window provides a more stable median estimate and is better suited to data with long-wavelength noise, but it averages over more traces and may blur genuine lateral amplitude variations. Use a smaller value (e.g., 10–20 traces) for data with high spatial variability or narrow gather sizes.

Time window

Default: 0.5 s. Minimum: 0.01 s. Sets the half-length of the sliding window in the time direction. The full window spans 2 x TimeWindow centered on the current sample (e.g., 0.5 s gives a 1.0 s window). A longer time window averages over more samples, yielding a more robust median for low-frequency noise, but may mix amplitude levels across strong reflectors or mute boundaries. For data with rapidly changing amplitude character (e.g., near-surface versus deep), consider a shorter window (0.1–0.2 s).

Threshold

Default: 0.95. Valid range: 0 to less than 1. Controls the sensitivity of spike detection. The decision criterion is: if |sample| > median / (1 - Threshold), the sample is flagged as a spike. At the default of 0.95, a sample must be 20 times the local median before it is considered a spike. Lower values (e.g., 0.5) make the filter more aggressive, flagging samples that exceed only twice the median; higher values (e.g., 0.99) make it more conservative, targeting only extreme outliers. Adjust based on the expected contrast between genuine signal amplitudes and noise bursts in your data.

Threshold step

Default: 0.05. An incremental step value reserved for iterative threshold adjustment. In the current implementation this parameter is stored but does not affect the main processing loop. It is retained for compatibility purposes.

Bad values method

Default: Zero. Determines how a detected spike is replaced. Options:

Zero (default) — spike samples are set to zero. This is the simplest and most aggressive replacement. It is appropriate when spikes are truly impulsive (very short duration) and the surrounding signal is expected to recover quickly. It may introduce discontinuities if spikes span multiple samples.

Clip — spike samples are replaced by the local median value, preserving the sign of the original sample. This produces a smoother output than zeroing and is preferred when the spike is large but the underlying signal is still present and should be approximated rather than deleted.