Normalized Least-mean-fourth (NLMF)

New in version 1.1.0.

Changed in version 1.2.0.

The normalized least-mean-fourth (NLMF) adaptive filter is an extension of the LMF adaptive filter (Least-mean-fourth (LMF)).

The NLMF filter can be created as follows

>>> import padasip as pa
>>> pa.filters.FilterNLMF(n)

where n is the size (number of taps) of the filter.

Content of this page:

See also

Adaptive Filters

Algorithm Explanation

The NLMF is extension of LMF filter. See Least-mean-fourth (LMF) for explanation of the algorithm behind.

The extension is based on normalization of learning rate. The learning rage \(\mu\) is replaced by learning rate \(\eta(k)\) normalized with every new sample according to input power as follows

\(\eta (k) = \frac{\mu}{\epsilon + || \textbf{x}(k) ||^2}\),

where \(|| \textbf{x}(k) ||^2\) is norm of input vector and \(\epsilon\) is a small positive constant (regularization term). This constant is introduced to preserve the stability in cases where the input is close to zero.

Minimal Working Examples

If you have measured data you may filter it as follows

import numpy as np
import matplotlib.pylab as plt
import padasip as pa

# creation of data
N = 500
x = np.random.normal(0, 1, (N, 4)) # input matrix
v = np.random.normal(0, 0.1, N) # noise
d = 2*x[:,0] + 0.1*x[:,1] - 0.3*x[:,2] + 0.5*x[:,3] + v # target

# identification
f = pa.filters.FilterNLMF(n=4, mu=0.1, w="random")
y, e, w = f.run(d, x)

# show results
plt.figure(figsize=(15,9))
plt.subplot(211);plt.title("Adaptation");plt.xlabel("samples - k")
plt.plot(d,"b", label="d - target")
plt.plot(y,"g", label="y - output");plt.legend()
plt.subplot(212);plt.title("Filter error");plt.xlabel("samples - k")
plt.plot(10*np.log10(e**2),"r", label="e - error [dB]");plt.legend()
plt.tight_layout()
plt.show()

Code Explanation

class padasip.filters.nlmf.FilterNLMF(n, mu=0.1, eps=0.001, **kwargs)[source]

Bases: padasip.filters.base_filter.AdaptiveFilter

Adaptive NLMF filter.

learning_rule(e, x)[source]

Override the parent class.