Relationship between the DFT and the continuous Fourier transform of a piecewise constant function

140 Views Asked by At

I am trying to see if I can relate the continuous Fourier transform of a piece wise constant function to the DFT of said function without much success. Here's what I have done so far:

Let us have a function $f:\mathbb{R}\rightarrow\mathbb{R}$, and a set of points $x_0<x_1<x_2<...<x_N$. We define $f$, such that:

$$f(x)=f_k, x\in[x_k,x_{k+1})$$ $$f(x)=0, x\in (-\infty,x_0)\cup[x_N,\infty)$$

Taking the Fourier transform of $f$ yields: $$\hat{f}(u) = \int_{-\infty}^{\infty}f(x)\exp(-2\pi i ux)\,dx = \sum_{k=0}^{N-1}f_k\int_{x_k}^{x_{k+1}}{\exp(-2\pi i ux)\,dx} = $$ $$=\sum_{k=0}^{N-1}f_k \int_{x_k}^{x_{k+1}}{\cos(-2\pi ux) + i\sin(-2\pi ux)\,dx} = $$ $$=\frac{1}{2\pi u}\sum_{k=0}^{N-1}f_k [\sin(2\pi ux_{k+1}) - \sin(2\pi ux_{k}) + i\cos(2\pi ux_{k+1}) - i\cos(2\pi ux_{k})] = $$ $$=\frac{1}{2\pi u}\sum_{k=0}^{N-1}f_k \left[\exp\left(2\pi i (\frac{1}{4}-ux_{k+1})\right) - \exp\left(2\pi i(\frac{1}{4}-ux_{k})\right)\right]$$

Is there a way I could relate this to the discrete Fourier transform? I tried but didn't find a way to simplify the above into (even if I assume equidistant points): $$\hat{f}_u = \frac{1}{\sqrt{N}}\sum_{k=0}^{N-1}f_k \exp\left(\frac{-2\pi i uk}{N}\right)$$

Edit: This is specifically in the context of transforming images with the DFT. I was trying to understand the problem in the continuous domain, in case one represents the image as a piecewise constant function. Note that I am deriving this for a 1D signal just for simplicity.

Edit 2: After some more thinking I believe I can relate the DFT to: $$\frac{1}{\sqrt{N}}\sum_{k=0}^{N-1}f_k \exp\left(\frac{-2\pi i uk}{N}\right) = \frac{1}{\sqrt{N}}\int_{-\infty}^{\infty}{\sum_{k=0}^{N-1}f_k\delta(x-x_k)\exp(-2\pi i ux)\, dx}$$ Assuming that $x_k = \frac{k}{N}$. Then $f$ becomes: $$f(x) = \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1}f_k\delta\left(x-\frac{k}{N}\right)$$
Does this mean that when performing the DFT we're actually representing the image as a collection of delta peaks in the continuous domain?

Edit 3: I guess in a sense this can be seen as sampling a continuous signal $f$ at equidistant locations and then performing the Fourier transform on the sampled function. While I get that the $\frac{1}{\sqrt{N}}$ factor is necessary for the basis vectors to be normalized, I am not sure how I should interpret this in the context of an image. Intuitively it makes sense for there to be a $\frac{1}{N}$ factor, since if we sample a function $f$, we would like to have the mean values equal: $$\frac{1}{b-a}\int_{a}^{b}{f(x) \, dx} = \frac{1}{N}\sum_{k=0}^{N-1}{f_k}$$ On the other hand we get all samples rescaled by $\sqrt{N}$ for some reason.

All in all it seems like I had the mistaken belief that the DFT of an image is equivalent to the Fourier transform of a piecewise constant version of the discrete signal. This doesn't seem to be the case, as instead the DFT is equivalent to performing the Fourier transform on the function consisting of delta peaks, induced by our discrete signal.

While I seem to have figured out a lot of aspects of the initial problem, comments and clarifications for a better and more in depth understanding are more than welcome.