I read on the internet about how discrete Fourier transform works. Based on that, I made up these formulas. A discrete function $g(t)$ takes $N$ values at equally spaced intervals between $t=a$ and $t=b$. $g(a)=g(b)$. Now, the values of the function at $a, a+\frac{b-a}{N}, a+\frac{2(b-a)}{N},......a+\frac{(N-1)(b-a)}{N}$ can be described by the sum of cosine functions of frequencies $k=0,1,2,...,N-1$. The "component function" of frequency $k$ is given by:
$$f_{k}(z)=\frac{1}{N}\sum_{n=0}^{N-1}g\left( a+\frac{n(b-a)}{N}\right) \cos{\left( \frac{2k\pi}{N}(z-n)\right)}\; \; \; \; ....(1)$$
I prefer it in this form because I can't get my head around Euler's formula.
so, $$f\left(a+\frac{z(b-a)}{N}\right)=\sum_{k=0}^{N-1}f_{k}(z)\; \; \; \; ....(2)$$
This $f\left(a+\frac{z(b-a)}{N}\right)$ function matches the values of the $g(t)$ function at $z=0, 1, 2....N-1$
What if $g(t)$ was a continuous function? Should I just let $N\rightarrow \infty$?
I substituted $\frac{z}{N}=x$, $\frac{n}{N}=l$ and $\frac{1}{N}=dl$ to get these equations:
$$f_{k}(x)=\int_{0}^{\infty}g\left(a+l(b-a)\right)\cos\left(2k\pi(x-l)\right)dl\; \; \; \; ....(3)$$
$$f(a+x(b-a))=\sum_{k=0}^{\infty}f_{k}(x)\; \; \; \; ....(4)$$
By varying $x$ from $0$ to $1$, we get values of the function $f$ from $a$ to $b$. Have I done it right? Do these values match the values of the continuous function $g(t)$ in the interval $(a,b)$. Also, how do i get from here to representing a continuous function $g(t)$ on the entire real line, i.e. from $a=-\infty$ to $b=\infty$? In my equation $(4)$, the frequency varies form $0$ to $\infty$ in jumps of $1$ while in the Wikipedia article on Fourier transform, frequency varies continuously from $-\infty$ to $\infty$ in the formula.