# Lulu smoothing

In signal processing, Lulu smoothing is a nonlinear mathematical technique for removing impulsive noise from a data sequence such as a time series. It is a nonlinear equivalent to taking a moving average (or other smoothing technique) of a time series, and is similar to other nonlinear smoothing techniques, such as Tukey or median smoothing.
LULU smoothers are compared in detail to median smoothers by Jankowitz and found to be superior in some aspects, particularly in mathematical properties like idempotence.

## Properties

Lulu operators have a number of attractive mathematical properties, among them idempotence – meaning that repeated application of the operator yields the same result as a single application – and co-idempotence. An interpretation of idempotence is that: 'Idempotence means that there is no “noise” left in the smoothed data and co-idempotence means that there is no “signal” left in the residual.'
When studying smoothers there are four properties that are useful to optimize:
* Effectiveness
* Consistency
* Stability
* Efficiency
The operators can also be used to decompose a signal into various subcomponents similar to wavelet or Fourier decomposition.

## History

Lulu smoothers were discovered by C. H. Rohwer and have been studied for the last 30 years. Their exact and asymptotic distributions have been derived.

## Operation

Applying a Lulu smoother consists of repeated applications of the min and max operators over a given subinterval of the data. As with other smoothers, a width or interval must be specified. The Lulu smoothers are composed of repeated applications of the L (lower) and U (Upper) operators, which are defined as follows:

### L operator

For an L operator of width n over an infinite sequence of xs (..., x$_j$, x$_{j+1}$,...), the operation on x$_j$ is calculated as follows:
* Firstly we create (n + 1) mini-sequences of length (n + 1) each. Each of these mini-sequences contains the element x$_j$. For example, for width 1, we create 2 mini-sequences of length 2 each. For width 1 these mini sequences are (x$_{j−1}$, x$_j$) and (x$_j$, x$_{j+1}$). For width 2, the mini-sequences are (x$_{j−2}$, x$_{j−1}$, x$_j$), (x$_{j−1}$, x$_j$, x$_{j+1}$) and (x$_j$, x$_{j+1}$, x$_{j+2}$). For width 2, we refer to these mini-sequences as seq$_{−1}$, seq$_0$ and seq$_{+1}$
* Then we take the minimum of each of the mini sequences. Again for width 2 this gives: (Min(seq$_{−1}$), Min(seq$_0$), Min(seq$_{+1}$)). This gives us (n + 1) numbers for each point.
* Lastly we take the maximum of (the minimums of the mini sequences), or Max(Min(seq$_{−1}$), Min(seq$_0$), Min(seq$_{+1}$)) and this becomes L(x$_j$)
Thus for width 2, the L operator is:
    L(x$_j$) = Max(Min(seq$_{−1}$), Min(seq$_0$), Min(seq$_{+1}$))

### U Operator

This is identical to the L operator, except that the order of Min and Max is reversed, i.e. for width 2:
    U(x$_j$) = Min(Max(seq$_{−1}$), Max(seq$_0$), Max(seq$_{+1}$))

### Examples

Examples of the U and L operators, as well as combined UL and LU operators on a sample data set are shown in the following figures.
It can be seen that the results of the UL and LU operators can be different. The combined operators are very effective at removing impulsive noise, the only cases where the noise is not removed effectively is where we get multiple noise signals very close together, in which case the filter 'sees' the multiple noises as part of the signal.