2
$\begingroup$

I am trying to compute the MTF (modulation transfer function - Fourier Transform) of the following filter: $ [1, 1, 1] $. Here are my steps:

$$ X_k = \frac{1}{N} \sum_{n=0}^{2} e^{-\frac{2 \pi i kn}{3}} = \frac{1}{3} \left( 1 + 2\cos{\left(\pi k \right)} \cos{\left(\frac{\pi k}{3} \right)} - 2i \sin{\left(\pi k \right)} \sin{\left(\frac{\pi k}{3}\right)} \right). $$

However, the formula provided in my lecture notes is:

$$ \frac{1}{3} \left( 1+2\cos{\left(2 \pi k \right)} \right).$$

What is wrong with my approach?

$\endgroup$

1 Answer 1

3
$\begingroup$

I have limited experience with optics and imaging, so was unfamiliar with the term Modulation Transfer Function. This is what I have learned from this article on Wikipedia combined with my experience with Fourier Transforms which is hopefully sufficient to provided a helpful answer. This is an interesting application demonstrating navigating all the Fourier Transform options and which to apply and how, especially when working in other domains other than time and frequency (here space and frequency).

The more generalized Optical Transfer Function (OTF) is the Fourier Transform of the Point Spread Function (PSF) for an optical system. The PSF is the system's impulse response. The OTF will be complex with magnitude and phase, consistent with any causal linear time invariant system. Thus the complex result can be represented in magnitude and phase form, specifically $A(f)e^{j\phi(f)}$, with $A(f)$ and $\phi(f)$ both real functions where $A(f)$ is the Magnitude Transfer Function and $\phi(f)$ is the Phase Transfer Function.

The frequency units are spatial frequency in cycles/mm, and the resulting transform can be in multiple dimensions such as 1D, 2D, or 3D depending on the dimension of the Point Spread Function. Here the OP has given a 1D point spread function as 3 impulses. For purposes of providing units in this answer I will assume each of those impulses are separated by 1 mm. This would physically be realized by a point source going through a lens that converges to three points each separated by 1 mm on the image plane due to lens distortions.

Which Transform to use??

More generally the Point Spread Function would be a continuous function in space (such as a 2D ellipse for example, consistent with "point spread"), so for that the Continuous Space Fourier Transform would be used (CSFT). Given the Point Spread Function in this case by the OP is discrete, we can use here the Discrete Space Fourier Transform (DSFT). I provide the equations for both forms below along with that for the Discrete Fourier Transform (DFT), since samples of the DSFT can be computed from the DFT. This is an important point since the Fast Fourier Transform (FFT) is a very efficient algorithm for computing the DFT. The CSFT and DSFT are continuous functions in frequency, while the DFT is discrete in frequency. By zero padding the spatial domain waveform prior to computing the DFT, we can interpolate more samples of the desired DSFT thus providing an efficient algorithmic solution for general applications.

CSFT:

$$Y(f) = \int_{x=-\infty}^{\infty}y(x)e^{-j2\pi f x}dx \tag{1}\label{1}$$

Where

$f$ is frequency in cycles/mm as a continuous function

$x$ is distance in mm as a continuous function

$y(x)$ is a spatial domain function as a function of x

$Y(f)$ is a frequency domain function as a function of f

DSFT:

$$Y(f) =\sum_{n=-\infty}^{\infty} y[n]e^{-j 2 \pi f n} \tag{2}\label{2}$$

Where

$f$ is frequency in cycles/mm as a continuous function

$n$ is distance in mm as a discrete function

DFT:

$$Y(k) =\sum_{n=0}^{N-1} y[n]e^{-j 2 \pi n k/N} \tag{3}\label{3}$$

Where

$k$ is a frequency index from $0$ to $N-1$

$n$ is a spatial index from $0$ to $N-1$

$N$ is the total number of samples in space and frequency

Solution

Given that the Point Spread Function (PSF) is discrete, as $y[n] = [1,1,1]$ we would use the DSFT (Equation \ref{2}).

We can reasonably assume the spatial center is in the middle of the PSF (the PSF as given extends from $n=-1$ to $n=1$), the DSFT result would be:

$$Y(f) =\sum_{n=-\infty}^{\infty} y[n]e^{-j2 \pi f n} = e^{-j2 \pi f} + 1 + e^{j2 \pi f}$$

Using this relationship from our friend Euler:

$$2\cos(\omega) = e^{j \omega} + e^{-j \omega}$$

The above simplifies to the solution provided by the OP as:

$$Y(f) = 1 + 2\cos(2\pi f)$$

This is the OTF, but since the result is completely real and always positive, it happens to be the MTF as well, but that wouldn't necessarily always be the case. Whenever the PSF is symmetric, the result will be real, but if it is signed, the MTF would be the magnitude of that result.

I prefer using the units $f$ in the result and not $k$ since the resulting response in frequency is not discrete, and $k$ is very commonly used as the discrete frequency index in the DFT. We note if the units in the Point Spread Function (PSF) are mm, the units of frequency $f$ in the solution is cycles/mm.

Also to comment if the PSF was not centered on $n=0$ as I applied here, this would have no effect on the MTF since any such shift would effect the phase only. For example if the PSF started at the $n=0$, the resulting OTF would be:

$$Y(f) =\sum_{n=-\infty}^{\infty} y[n]e^{-j2 \pi f n} = 1 + e^{-j2 \pi f} + + e^{-j4 \pi f}$$

$$ = e^{-j2 \pi f}(e^{-j2 \pi f} + 1 + e^{j2 \pi f}) =e^{-j2 \pi f}( 1 + 2\cos(2\pi f)) $$

Thus giving us the same MTF and we see the PTF would be $\phi(f) = 2 \pi f$.

$\endgroup$
9
  • 1
    $\begingroup$ I was able to obtain the results of the lecture notes using $$X_n = \sum _{n=-1}^{n=1} x_n e^{-iwn} = e^{iw} + 1+ e^{-iw} = 1 + 2cosw = 1 + 2cos(2 \pi k)$$ for $$ w=2 \pi k $$. $\endgroup$
    – John
    Mar 9 at 19:04
  • $\begingroup$ Thanks for your effort. In my lecture notes the Modulation transfer function is just defined as the Fourier Transform of a filter. $\endgroup$
    – John
    Mar 11 at 8:53
  • 1
    $\begingroup$ @DanBoschen "Here the OP has given a 1D point spread function as 3 impulses." - Could you briefly explain how this is the case? Are you referring to the "filter", i.e. the sequence (?) $[1, 1, 1]$? How does this correspond to three impulses? Also, shouldn't a 1-D impulse not rather be something like $[0, ..., 0, 1, 0, ..., 0]$ (or $[1]$ without the zero-padding)? $\endgroup$
    – srhslvmn
    Mar 13 at 7:53
  • $\begingroup$ @DanBoschen ... Also, why 3 impulses, are you referring to X, Y, and Z components, i.e. an ideal 3-D impulse response (PSF), corresponding to a delta distribution in the continuous case? $\endgroup$
    – srhslvmn
    Mar 13 at 7:56
  • 1
    $\begingroup$ @DanBoschen Ok, thanks. One more thing: could you please add the sum indices explicitly for the $X(f)$ and $X(k)$? I know one should be summing over either frequencies or positions, but the expressions aren't 100% clear $\endgroup$
    – srhslvmn
    Mar 13 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.