Login Page - Create Account

# Butterworth Filter

### Description

This study calculates and displays a Butterworth Filter for the data given by the Input Data Input. This study is an ACSIL implementation of the Indicators given in Figures 13.4, 13.5, 13.6, and 13.7 of the book Cybernetic Analysis for Stocks and Futures by John Ehlers.

Let $$X$$ be a random variable denoting the Input Data, and let $$X_t$$ be the value of $$X$$ at Index $$t$$. Let the Length Input be denoted as $$n$$.

The Poles Input determines whether the 2-Pole or 3-Pole Butterworth Filter is computed. The values of these two filters are denoted respectively as $$BWF^{(2)}_t(X,n)$$ and $$BWF^{(3)}_t(X,n)$$, and they are computed as follows.

2-Pole Butterworth Filter:

$$\displaystyle{BWF^{(2)}_t(X,n) = \left\{ \begin{matrix} X_t & t < 2 \\ k^{(1)}(n)(X_t + 2X_{t - 1} + X_{t - 2})+ k^{(2)}(n)BWF^{(2)}_{t - 1}(X,n) + k^{(3)}(n)BWF^{(2)}_{t - 2}(X,n) & t \geq 2 \end{matrix}\right .},$$

where the coefficients $$k^{(1)}(n)$$, $$k^{(2)}(n)$$, and $$k^{(3)}(n)$$ are given as follows.

• $$\displaystyle{k^{(1)}(n) = \frac{1}{4}\left(1 - 2\exp\left(-\frac{\sqrt{2}\pi}{n}\right)\cos\left(\frac{\sqrt{2}\pi}{n}\right) + \mathrm{exp}\left(-\frac{2\sqrt{2}\pi}{n}\right)\right)}$$
• $$\displaystyle{k^{(2)}(n) = 2\exp\left(-\frac{\sqrt{2}\pi}{n}\right)\cos\left(\frac{\sqrt{2}\pi}{n}\right)}$$
• $$\displaystyle{k^{(3)}(n) = -\exp\left(-\frac{2\sqrt{2}\pi}{n}\right)}$$

3-Pole Butterworth Filter:

$$\displaystyle{BWF^{(3)}_t(X,n) = \left\{ \begin{matrix} X_t & t < 3 \\ k^{(1)}(n)(X_t + 3X_{t - 1} + 3X_{t - 2} + X_{t - 3})+ k^{(2)}BWF^{(3)}_{t - 1}(X,n) + k^{(3)}BWF^{(3)}_{t - 2}(X,n) + k^{(4)}BWF^{(3)}_{t - 3}(X,n) & t \geq 3 \end{matrix}\right .},$$

where the coefficients $$k^{(1)}(n)$$, $$k^{(2)}(n)$$, $$k^{(3)}(n)$$, and $$k^{(4)}(n)$$ are given as follows.

• $$\displaystyle{k^{(1)}(n) = \frac{1}{8}\left(1 - 2\exp\left(-\frac{\pi}{n}\right)\cos\left(\frac{1.738\pi}{n}\right) + \exp\left(-\frac{2\pi}{n}\right)\right)\left(1 - \exp\left(-\frac{2\pi}{n}\right)\right)}$$
• $$\displaystyle{k^{(2)}(n) = 2\exp\left(-\frac{\pi}{n}\right)\cos\left(\frac{1.738\pi}{n}\right) + \exp\left(-\frac{2\pi}{n}\right)}$$
• $$\displaystyle{k^{(3)}(n) = -\exp\left(-\frac{2\pi}{n}\right) - 2\exp\left(-\frac{3\pi}{n}\right)\cos\left(\frac{1.738\pi}{n}\right)}$$
• $$\displaystyle{k^{(4)}(n) = \exp\left(-\frac{4\pi}{n}\right)}$$

For an explanation of the Exponential Function $$\exp()$$, refer to our description here.

#### Inputs

• Input Data
• Length
• Poles: This Custom Input determines whether the 2-Pole or 3-Pole Super Smoother Filter is used.

#### Spreadsheet

The spreadsheet below contains the formulas for this study in Spreadsheet format. Save this Spreadsheet to the Data Files Folder.

Open it through File >> Open Spreadsheet.

*Last modified Wednesday, 01st February, 2023.