# MATHEMATICAL COMPARISON BETWEEN AVERAGE, MEDIAN AND SIGMA-CLIP

The Signal / Noise ratio represents the difference between the signal (the resolution of the image) and the noise generated during the acquisition of the images. The larger the gap, the better the image resolution. The Median and Sigma-Clip method also make it possible to eliminate light interference captured during the taking of photos such as light trails of planes, shooting stars, satellites, cosmic rays, etc. The Average method does not make it possible to eliminate these light interference. The advantage of using the Median or Sigma-Clip method instead of the Average therefore lies in this ability to eliminate these parasites. In order to compare and evaluate these three integration methods, here are the mathematical formulas for the increase in the Signal / Noise (S / N) ratio of each of them:

Average

Increase in S / N ratio = √ number of images

Median

S / N ratio increase = √ (number of images +1) / 2

Min / Max-Clip Combine (Fixed Sigma-clip)

S / N ratio increase = √ number of images -2

The Sigma-clip method offers several options for filtering out extreme pixels so that its effect cannot be precisely predicted. For this reason, no single mathematical formula can be used to describe this method. The Min / Max-clip method is very similar to the Sigma-clip method. It uses a constant setting for cleaning the extreme pixels considered as noise. This setting rejects 2 images (or 2 pixels), regardless of the number of images (one pixel is rejected at the start of the sequence and another at the end). We will therefore use the Min / Max-clip mathematical formula to simulate the Sigma-clip method which we will call here the fixed Sigma-clip.

Here is the mathematical comparison of these three compositing methods:

For users of the Median method, the comparison above justifies, in my opinion, abandoning this method in favor of the Sigma-clip and taking at least 10 images for compositing. From 5 images, the S/N ratio of the median is 77% of the Mean. The more images are integrated, the lower the percentage. The opposite effect occurs with the Sigma-clip method. The difference between the fixed Sigma-clip and the Average decreases by increasing the number of images. From 10 images, the deviation is only 11% (100%-89%). With 50 integrated images, the fixed Sigma-clip is almost equal to the average (98%). With the integration of 5 images, we see that the median and the Sigma-clip are equal. So for the Sigma-clip method to significantly outperform the Median, take at least 10 images. It should also be noted that the fixed Sigma-clip formula presented above is practically identical to the Sigma-clip with filter 3 (Sigma value 0,5) over a large number of images.

Richard Beauregard
The Sky Astro-CCD

Revised 2022/01/16

References :

Calculation of the median, Statistics Canada