**3. An numerical algorithm for Fourier transform**

Consider the Fourier transform *F* of a function *f* ∈*L*2ð Þ �∞, ∞ the form

$$F(\boldsymbol{\alpha}) = \frac{1}{\sqrt{2\pi}} \int\_{-\infty}^{\infty} f(t)e^{i t \cdot \boldsymbol{\alpha}} dt, \quad \boldsymbol{\alpha} \in (-\infty, \infty) \tag{21}$$

### **3.1 Algorithm construction scheme**

The method of the item **2** can be applied by linear change of variable to function *f* defined on any finite segment. For a fixed *h*> 0 formula (21) can be rewritten as

$$F(\alpha) = \frac{1}{\sqrt{2\pi}} \sum\_{k=-\infty}^{\infty} \int\_{k-h}^{k+h} f(t)e^{it\alpha}dt\tag{22}$$

On the other hand, our method allows one to approximate function *<sup>f</sup>* <sup>≃</sup> <sup>P</sup> *frTr* on each segment ð Þ *k* � *h*, *k* þ *h* , ∀*k*, using Algorithm A and formula (17).

Our idea is as follows. First, based on the required 1 error, you can leave a fnite number of intervals. Second, on the remaining intervals, the integrals are calculated explicitly. Really, each function *Tr*ð Þ *x* is a linear combination of functions of the form exp ð Þ *iπ λ*<sup>1</sup> *x* or its derivative with respect to *λ* of a certain order. For example, if *k* ¼ 0, then for functions exp ð Þ *iπ λ*<sup>1</sup> *x* , we have (see (12), here *k* ¼ 0)

$$\int\_{-h}^{h} \exp\left(i\pi\lambda\_1 t\right) e^{it\,\alpha} dt = 2 \, h \, \text{sinc}(h(\pi\lambda\_1 + o))$$

On the complex plane *s*∈ , this is an entire function of exponential type. It is easy to see that this is true in the general case.

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

j j *f x*ð Þ <sup>2</sup> *dx* <sup>s</sup>

.

reached approximately at point *<sup>ω</sup>* <sup>¼</sup> <sup>0</sup>*:*185 and is equal to 1*:*<sup>04</sup> � <sup>10</sup>�<sup>3</sup>

matical physics, astronomy, engineering, economics, biology, etc.

These calculations were performed using system Wolfram Mathematica 9.

Those who have mastered the technique of using Algorithm A can easily obtain a similar method of sine and cosine Fourier transforms. Despite the fact that with an increase in *n* the complexity of the corresponding algorithms increases markedly, modern computers allow you to perform the necessary actions with increased bit depth. The proposed method for finding the one-dimensional Fourier transform with a given accuracy can be useful in such different fields of activity as mathe-

There are good prerequisites for other classical (in a broad sense) Fourier tools for efficient applications based on the method of item **2** (see articles [14, 15]).

Institute of Mathematics of National Academy of Sciences of Armenia, Yerevan,

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

\*Address all correspondence to: nersesyan.anry@gmail.com

provided the original work is properly cited.

ð�<sup>2</sup> �∞

and when deleting these semi-infinite intervals, further actions should lead to an

On the other hand, we see that function *f* is infinitely differentiable everywhere except the point *x* ¼ 1*=*3, where its derivative has a jump. Therefore (see item **2**), we can consider the following partition into two intervals: *I*<sup>1</sup> ¼ �ð Þ 2, 1*=*3 ,*I*<sup>2</sup> ¼ ð Þ 1*=*3, 3*=*2 . Method of item **3.1** at *n* ¼ 3 was applied to each of these intervals. Monitoring showed (see item **<sup>4</sup>**) that *<sup>L</sup>*2- error for *<sup>I</sup>*<sup>1</sup> is 1*:* � <sup>10</sup>�<sup>3</sup>

<sup>¼</sup> <sup>4</sup>*:* � <sup>10</sup>�<sup>3</sup>

, and for *I*<sup>2</sup> is

. As for the uniform error, it is

.

j j *f x*ð Þ <sup>2</sup> *dx* <sup>þ</sup>

<sup>1</sup>*:*<sup>44</sup> � <sup>10</sup>�3. We see that this is less than allowed above. The total *<sup>L</sup>*2- error turned out to be 4*:*<sup>38</sup> � <sup>10</sup>�<sup>3</sup>

ð<sup>∞</sup> 3 2

*DOI: http://dx.doi.org/10.5772/intechopen.94186*

*A Fast Method for Numerical Realization of Fourier Tools*

error no greater than 5*:*<sup>99</sup> � <sup>10</sup>�<sup>3</sup>

**4. Conclusion**

**Author details**

Anry Nersessian

**37**

Republic of Armenia

**Remark 6.** *Depending on function f in formula (21), interval* ð Þ �∞, ∞ *can be split into a finite number of unequal intervals instead of partition (22).*

Let us turn to the main details of the algorithm for such a numerical implementation of the Fourier transform for a piecewise smooth function *f*.

### **3.2 Implementation notes**

To make our approach understandable to a wide range of specialists, when developing an applied algorithm, we will assume that (see formulas (7–19)) for a fixed *<sup>n</sup>*<sup>≥</sup> 1, *Dn* <sup>¼</sup> f g 0, 1, … , *<sup>n</sup>* � <sup>1</sup> , *<sup>D</sup>*<sup>~</sup> *<sup>n</sup>* ¼ �f g *<sup>n</sup>*, �*<sup>n</sup>* <sup>þ</sup> 1, … , �<sup>1</sup> .

Consider now the following when writing code to implement the onedimensional Fourier transform.


For example, let in the process of computer operation at the output of Algorithm A we have *λ*<sup>1</sup> ¼ 1*:*00012, *λ*<sup>2</sup> ¼ 1*:*00031. At this point, so that the calculations do not stop, it is necessary to make following correction in the code: *λ*<sup>1</sup> ¼ *λ*<sup>2</sup> ¼ 1. Of course, here we mean the permissible error 10�<sup>3</sup> when computer precision is 10�<sup>5</sup> (see above item **1**).

1.During the operation of the proposed algorithm for Fourier transform, *L*2- error can be monitored every time the adaptive algorithm is applied. In practice, it has the same order as the *L*2-error for the Fourier transform.

### **3.3 A simple example**

Let us explain the details on the following example of an approximate finding of the Fourier transform (see notation (21)).

$$f(\mathbf{x}) = e^{-4\left|\mathbf{x}-\frac{\mathbf{i}}{3}\right|} + \frac{i}{2}e^{-4\left(\mathbf{x}-\frac{\mathbf{i}}{2}\right)^2}, \ \mathbf{x} \in \left(-\infty, \infty\right) \tag{23}$$

$$F(\boldsymbol{\alpha}) = \frac{4\sqrt{\frac{2}{\pi}}e^{\frac{i\boldsymbol{w}}{3}}}{\boldsymbol{\alpha}^2 + 16} + \frac{i\boldsymbol{e}^{-\frac{1}{16}\boldsymbol{\alpha}(\boldsymbol{w} - 8\boldsymbol{i})}}{4\sqrt{2}}. \quad \boldsymbol{\alpha} \in (-\infty, \infty) \tag{24}$$

Our goal is to provide a final value of a *L*<sup>2</sup> - error that does not exceed 10�<sup>2</sup> . With the help of numerical integration (in this case, explicitly), one can make sure that

*A Fast Method for Numerical Realization of Fourier Tools DOI: http://dx.doi.org/10.5772/intechopen.94186*

$$\sqrt{\int\_{\frac{3}{2}}^{\infty} |f(\mathbf{x})|^2 d\mathbf{x} + \int\_{-\infty}^{-2} |f(\mathbf{x})|^2 d\mathbf{x}} = 4. \times 10^{-3}$$

and when deleting these semi-infinite intervals, further actions should lead to an error no greater than 5*:*<sup>99</sup> � <sup>10</sup>�<sup>3</sup> .

On the other hand, we see that function *f* is infinitely differentiable everywhere except the point *x* ¼ 1*=*3, where its derivative has a jump. Therefore (see item **2**), we can consider the following partition into two intervals: *I*<sup>1</sup> ¼ �ð Þ 2, 1*=*3 ,*I*<sup>2</sup> ¼ ð Þ 1*=*3, 3*=*2 . Method of item **3.1** at *n* ¼ 3 was applied to each of these intervals.

Monitoring showed (see item **<sup>4</sup>**) that *<sup>L</sup>*2- error for *<sup>I</sup>*<sup>1</sup> is 1*:* � <sup>10</sup>�<sup>3</sup> , and for *I*<sup>2</sup> is <sup>1</sup>*:*<sup>44</sup> � <sup>10</sup>�3. We see that this is less than allowed above.

The total *<sup>L</sup>*2- error turned out to be 4*:*<sup>38</sup> � <sup>10</sup>�<sup>3</sup> . As for the uniform error, it is reached approximately at point *<sup>ω</sup>* <sup>¼</sup> <sup>0</sup>*:*185 and is equal to 1*:*<sup>04</sup> � <sup>10</sup>�<sup>3</sup> .

These calculations were performed using system Wolfram Mathematica 9.

## **4. Conclusion**

On the complex plane *s*∈ , this is an entire function of exponential type. It is

*Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

**Remark 6.** *Depending on function f in formula (21), interval* ð Þ �∞, ∞ *can be split*

Let us turn to the main details of the algorithm for such a numerical implemen-

To make our approach understandable to a wide range of specialists, when developing an applied algorithm, we will assume that (see formulas (7–19)) for a

Consider now the following when writing code to implement the one-

1.The computer used must be installed with programs that can perform symbolic mathematical operations as well as numerical integration (for example, as system Wolfram Mathematica, see [19]). It is desirable to use the

included in the partition of interval ð Þ �∞, ∞ (see **Remark 6**).

also in the presence of integer parameters (see item 2.2).

2.The singularities of piecewise-smooth function *f* (discontinuity points of the function and the discontinuity of the derivatives of low order) must be

3.The computer errs or freezes most often due to type 0*=*0 uncertainty. The point is that in practice, due to rounding errors, when the parameters coincide, they are often not fixed (see formula (15)). This must be taken into account

For example, let in the process of computer operation at the output of Algorithm

Let us explain the details on the following example of an approximate finding of

, *x*∈ ð Þ �∞, ∞ (23)

. With

p *: ω*∈ð Þ �∞, ∞ (24)

A we have *λ*<sup>1</sup> ¼ 1*:*00012, *λ*<sup>2</sup> ¼ 1*:*00031. At this point, so that the calculations do not stop, it is necessary to make following correction in the code: *λ*<sup>1</sup> ¼ *λ*<sup>2</sup> ¼ 1. Of course, here we mean the permissible error 10�<sup>3</sup> when computer precision is

1.During the operation of the proposed algorithm for Fourier transform, *L*2- error can be monitored every time the adaptive algorithm is applied. In practice, it has the same order as the *L*2-error for the Fourier transform.

> *i* 2 *e* �<sup>4</sup> *<sup>x</sup>*�<sup>1</sup> ð Þ<sup>2</sup> 2

*ie*� <sup>1</sup> <sup>16</sup>*ω ω*ð Þ �8*i* 4 ffiffi 2

Our goal is to provide a final value of a *L*<sup>2</sup> - error that does not exceed 10�<sup>2</sup>

the help of numerical integration (in this case, explicitly), one can make sure that

easy to see that this is true in the general case.

**3.2 Implementation notes**

dimensional Fourier transform.

10�<sup>5</sup> (see above item **1**).

**3.3 A simple example**

**36**

the Fourier transform (see notation (21)).

*f x*ð Þ¼ *e*

4 ffiffi 2 *π* q *e iω* 3 *<sup>ω</sup>*<sup>2</sup> <sup>þ</sup> <sup>16</sup> <sup>þ</sup>

*F*ð Þ¼ *ω*

�<sup>4</sup> *<sup>x</sup>*�<sup>1</sup> <sup>3</sup> j j þ

*into a finite number of unequal intervals instead of partition (22).*

fixed *<sup>n</sup>*<sup>≥</sup> 1, *Dn* <sup>¼</sup> f g 0, 1, … , *<sup>n</sup>* � <sup>1</sup> , *<sup>D</sup>*<sup>~</sup> *<sup>n</sup>* ¼ �f g *<sup>n</sup>*, �*<sup>n</sup>* <sup>þ</sup> 1, … , �<sup>1</sup> .

highest possible accuracy of calculations.

tation of the Fourier transform for a piecewise smooth function *f*.

Those who have mastered the technique of using Algorithm A can easily obtain a similar method of sine and cosine Fourier transforms. Despite the fact that with an increase in *n* the complexity of the corresponding algorithms increases markedly, modern computers allow you to perform the necessary actions with increased bit depth. The proposed method for finding the one-dimensional Fourier transform with a given accuracy can be useful in such different fields of activity as mathematical physics, astronomy, engineering, economics, biology, etc.

There are good prerequisites for other classical (in a broad sense) Fourier tools for efficient applications based on the method of item **2** (see articles [14, 15]).

## **Author details**

Anry Nersessian Institute of Mathematics of National Academy of Sciences of Armenia, Yerevan, Republic of Armenia

\*Address all correspondence to: nersesyan.anry@gmail.com

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
