# CosFourier

CosFourier or CosTransform is integral operator with kernel

$$\!\!\!\!\!\!\!\!\!\!\! (1) \displaystyle ~ ~ ~ ふ_{\mathrm C}(x,y)=\sqrt{\frac{2}{\pi}} \cos(xy)$$

defined on the set of functions $$f$$ such that the integral below converges:

$$\!\!\!\!\!\!\!\!\!\!\! (2) ~ ~ ~ \displaystyle \mathrm{CosFourier} f (x) = \int_0^\infty ~ ふ_{\mathrm C}(x,y)~ f(y)~ \mathrm d y$$

In such a way,

$$\!\!\!\!\!\!\!\!\!\!\! (3) ~ ~ ~ \displaystyle \mathrm{CosFourier} f (x) = \sqrt{\frac{2}{\pi}} \int_0^\infty ~\cos(xy)~ f(y)~ \mathrm d y$$

### Square of CosFourier

At the set of continuous functions, defined for the positive values of the argument, the second iteration of the CosFourier operator is Identity function, id est,

$$\mathrm{CosFourier}~ \mathrm{CosFourier} = \mathrm{CosFourier}^2 = \mathrm{IdentityOperator}$$

In such a way, the CosFourier operator is equal to its inverse,

$$\mathrm{CosFourier} = \mathrm{CosFourier}^{-1}$$

### Self–Fourier functions

Two self-Fourier functions (dotted lines) and their discrete representations (segmented lines). Click the image to get its generator

Some of eigenfunctions of the Fourier operator are also eigenfunctions of the CosFourier. In particular, any eigenfunction with eigenvalue unity (self-fourier) can be written as follows:

$$\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\displaystyle (14) ~ ~ ~ f(x) ~=~ \sum_{n=0}^{\infty} ~c_n~ \mathrm{HermiteH}_{4n}\!(x)~ \exp(-x^2/2)$$

where $$\mathrm{HermiteH}$$ is the Hermite polynomial [1], and $$c$$ are arbitrary complex coefficients. Such functions can be called Self-Fourier functions. The sequence $$c$$ should decay quickly enough to provide the convergence of the series [2].

In particular, the first three self-Fourier functions can be defined with

$$\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\displaystyle (15) ~ ~ ~ f_0(x)=\exp(-x^2/2)$$
$$\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\displaystyle (16) ~ ~ ~ f_1(x)=\exp(-x^2/2) (x^4-3x^2)$$
$$\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\displaystyle (17) ~ ~ ~ f_2(x)=\exp(-x^2/2) (x^8-14x^6+35x^4)$$

The self-Fourier functions are good for testing of the numerical implementations of the Fourier operator. Two of them are shown in figure at right with dotted lines.

The thick segmented lines show the discrete representation at the uniform grid with $$N\!=\!16$$ nodes with step $$d\!=\!\sqrt{\pi/N}$$.

The thin black segmented lines show the numeric CosFourier transforms at this grid with DCTI. These transforms coincide with the originals with at least 8 decimal digits. Generation of this figure is test of the discrete numerical implementation of CosFourier operator; the deviation of the calculated transforms (thin lines) from the originals (thick lines) would indicate the error in determination of step of grid if any error in the implementation or in the calling sequence; the coincidence confirms, that the implementation is correct.

The self–Fourier functions for the CosFourier operator are the same as for the Fourier operator; however, in the case of CosFourier, the only non–negative values of the argument are used, and only at this range the function is reproduced at the CosFourier transform.

## Relation to the Fourier transform

The Fourier operator can be defined as the integral transform

$$\displaystyle ふ(A)(x)= \frac{1}{\sqrt{2\pi}} \int_{- \infty}^{\infty} \exp( - \mathrm{i} x y) A(y) ~ \mathrm{d} y$$

For the symmetric function $$A$$, the only real part of the complex exponential contribute, and

$$\!\!\!\!\!\!\!\!\!\! \displaystyle ふ(A)(x)= \frac{1}{\sqrt{2\pi}} \int_{- \infty}^{\infty} \cos( x y) A(y) ~ \mathrm{d} y = \sqrt{\frac{2}{\pi}} \int_{0}^{\infty} \cos( x y) A(y) ~ \mathrm{d} y =~ \mathrm{CosFourier}(A)(x)$$

Therefore, in principle, the CosFourier could be implemented through the Fourier transform, with extension of the integrand to the negative values of the argument. However, at the numerical evaluation, this would require twice more resources than the more intelligent algorithm described in the "Numerical recipes in C".

## DiscreteCos transform

There are several discretisations of the CosFourier operator. One of them is loaded as DCTI, and namely this algorithm is used to plot the figure above. DCTI is orthogonal transform, that repalces an array $$F$$ of length $$N\!+\!1$$ with elements $$F_n$$, $$n=0 .. N$$ to the array $$G$$ with elements

$$\!\!\!\!\!\!\!\!\!\!(ま\!+\!1) ~ ~ ~ ~ \displaystyle G_k = (\mathrm{DCTI}_N F)_k = \frac{1}{2} F_0 + \frac{(-1)^k}{2} F_{N} + \sum_{n=1}^{N-1} F_n \cos\! \left(\frac{\pi}{N} n k \right)~$$ for $$~k=0, .. N$$

The DCTI can be used for the numerical implementation of CosFourier in the following way. Assume some large natural number $$N$$. Let $$x_n=\sqrt{\pi/N}~ n$$. Let function $$F$$ be smooth and quickly decay at infinity. Then, the transform of $$F$$ can be approximated as follows:

$$\!\!\!\!\!\!\!\!\!\!\! (ま\!+\!4) ~ ~ ~ \displaystyle G(x) = \mathrm{CosFourier} F(x) \approx \sqrt{\frac{2}{\pi}} \left ( \frac{1}{2} F(0) + \sum_{n=1}^{N} ~\cos(x x_n)~ F(x_n) \right)~ \sqrt{{\pi}/N}$$

For $$x=x_m$$, this can be written as follows:

$$\!\!\!\!\!\!\!\!\!\!\! (ま\!+\!5) ~ ~ ~ G_m=\displaystyle G(x_m) = \mathrm{CosFourier} F(x_m) \approx\sqrt{\frac{2}{N}} \left ( \frac{1}{2} F(0) + \frac{ (-1)^m}{2} F(x_N) + \sum_{n=1}^{N} ~\cos(x_m x_n)~ F(x_n)~\right)$$ $$\displaystyle \approx \sqrt{\frac{2}{N}} \left ( \frac{1}{2} F_0 + \frac{ (-1)^m}{2} F_N + \sum_{n=1}^{N-1} ~\cos\left(\frac{\pi}{N} mn\right)~ F_n\right)$$

At the transformation, it is assumed, that $$F(x)$$ can be neglected as $$x\ge x_N$$. In such a way,

$$\!\!\!\!\!\!\!\!\!\!\! (ま\!+\!6) ~ ~ ~ \displaystyle G_m \approx \sqrt{\frac{2}{N}} ~ (\mathrm{DCTI}_N~ F)_m= (ふ_{C1,N}~ F)_m$$

## CosFourier series

In the case of periodic symmetric function, the CosFourier transform gives generalized function, that can be interpreted as set of delta-functions with displaced argument:

## Rerefences

1. http://www.tandfonline.com/doi/abs/10.1080/09500349908231393#preview R.Ortega, C.J.Román, D.Kouznetsov. On the second order characterization of ultrashort pulses. Journal of Modern Optics, v.46, No.15, p.2069-2077 (1999).