Lehmer mean
- 2 min read
- 3 chapters
Related on Lably
Through Tuple, Real number and Maximum and minimum
The weighted Lehmer mean with respect to a tuple of positive weights is defined as:
The Lehmer mean is an alternative to power means for interpolating between minimum and maximum via arithmetic mean and harmonic mean.
Properties
The derivative of is non-negative
thus this function is monotonic and the inequality
holds.
The derivative of the weighted Lehmer mean is:
Sign in to keep reading
2 more chapters are free with a Lably account.
Special cases
- is the minimum of the elements of .
- is the harmonic mean.
- is the geometric mean of the two values and .
- is the arithmetic mean.
- is the contraharmonic mean.
- is the maximum of the elements of . Sketch of a proof: Without loss of generality let be the values which equal the maximum. Then
Applications
Signal processing
Like a power mean, a Lehmer mean serves a non-linear moving average which is shifted towards small signal values for small and emphasizes big signal values for big . Given an efficient implementation of a moving arithmetic mean called smooth you can implement a moving Lehmer mean according to the following Haskell code.
<span id="mwVA"></span><span class="nf" id="mwVQ">lehmerSmooth</span><span class="w" id="mwVg"> </span><span class="ow" id="mwVw">::</span><span class="w" id="mwWA"> </span><span class="kt" id="mwWQ">Floating</span><span class="w" id="mwWg"> </span><span class="n" id="mwWw">a</span><span class="w" id="mwXA"> </span><span class="ow" id="mwXQ">=></span><span class="w" id="mwXg"> </span><span class="p" id="mwXw">([</span><span class="n" id="mwYA">a</span><span class="p" id="mwYQ">]</span><span class="w" id="mwYg"> </span><span class="ow" id="mwYw">-></span><span class="w" id="mwZA"> </span><span class="p" id="mwZQ">[</span><span class="n" id="mwZg">a</span><span class="p" id="mwZw">])</span><span class="w" id="mwaA"> </span><span class="ow" id="mwaQ">-></span><span class="w" id="mwag"> </span><span class="n" id="mwaw">a</span><span class="w" id="mwbA"> </span><span class="ow" id="mwbQ">-></span><span class="w" id="mwbg"> </span><span class="p" id="mwbw">[</span><span class="n" id="mwcA">a</span><span class="p" id="mwcQ">]</span><span class="w" id="mwcg"> </span><span class="ow" id="mwcw">-></span><span class="w" id="mwdA"> </span><span class="p" id="mwdQ">[</span><span class="n" id="mwdg">a</span><span class="p" id="mwdw">]</span> <span class="nf" id="mweA">lehmerSmooth</span><span class="w" id="mweQ"> </span><span class="n" id="mweg">smooth</span><span class="w" id="mwew"> </span><span class="n" id="mwfA">p</span><span class="w" id="mwfQ"> </span><span class="n" id="mwfg">xs</span><span class="w" id="mwfw"> </span><span class="ow" id="mwgA">=</span> <span class="w" id="mwgQ"> </span><span class="n" id="mwgg">zipWith</span><span class="w" id="mwgw"> </span><span class="p" id="mwhA">(</span><span class="o" id="mwhQ">/</span><span class="p" id="mwhg">)</span> <span class="w" id="mwhw"> </span><span class="p" id="mwiA">(</span><span class="n" id="mwiQ">smooth</span><span class="w" id="mwig"> </span><span class="p" id="mwiw">(</span><span class="n" id="mwjA">map</span><span class="w" id="mwjQ"> </span><span class="p" id="mwjg">(</span><span class="o" id="mwjw">**</span><span class="n" id="mwkA">p</span><span class="p" id="mwkQ">)</span><span class="w" id="mwkg"> </span><span class="n" id="mwkw">xs</span><span class="p" id="mwlA">))</span> <span class="w" id="mwlQ"> </span><span class="p" id="mwlg">(</span><span class="n" id="mwlw">smooth</span><span class="w" id="mwmA"> </span><span class="p" id="mwmQ">(</span><span class="n" id="mwmg">map</span><span class="w" id="mwmw"> </span><span class="p" id="mwnA">(</span><span class="o" id="mwnQ">**</span><span class="p" id="mwng">(</span><span class="n" id="mwnw">p</span><span class="o" id="mwoA">-</span><span class="mi" id="mwoQ">1</span><span class="p" id="mwog">))</span><span class="w" id="mwow"> </span><span class="n" id="mwpA">xs</span><span class="p" id="mwpQ">))</span>
- For big it can serve an envelope detector on a rectified signal.
- For small it can serve an baseline detector on a mass spectrum.
Gonzalez and Woods call this a "contraharmonic mean filter" described for varying values of p (however, as above, the contraharmonic mean can refer to the specific case ). Their convention is to substitute p with the order of the filter Q:
Q=0 is the arithmetic mean. Positive Q can reduce pepper noise and negative Q can reduce salt noise.

