Question 5 of 6: Computing an inverse DFT with a forward FFT subroutine
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
Paper format. National Exams,
May 2016 — 07-Elec-B1 Digital Signal Processing. Three hours,
closed book; one approved calculator (Casio or Sharp) and one
two-sided aid sheet of tables and formulas are permitted. Six questions are
printed and any five constitute a complete exam; all questions
carry 12 marks, for 60 marks total. Tables of z-transform pairs and properties,
the DTFT synthesis/analysis pair, Parseval's relation and the DFT property list
are bound into the paper (pages 8–10). All six questions are solved
below, because the set is a study resource rather than a timed
attempt.
Reference texts (22-Elec-B1).
A. V. Oppenheim and R. W. Schafer, Discrete-Time Signal
Processing, 3rd ed. — the paper's notation, its bound tables and its
Kaiser-window design formulas are taken directly from this text (Ch. 2
LTI systems and the DTFT, Ch. 3 the z-transform, Ch. 4 sampling and
multirate processing, Ch. 6 filter structures, Ch. 7 filter design,
Ch. 8 the DFT and the FFT).
J. G. Proakis and D. G. Manolakis, Digital Signal Processing:
Principles, Algorithms and Applications, 4th ed. — parallel
treatment of the same material (Ch. 3 z-transform, Ch. 6 sampling,
Ch. 9 filter structures, Ch. 10 filter design).
A. V. Oppenheim and A. S. Willsky, Signals and Systems,
2nd ed. — background on Fourier representations and sampling.
Question 5: Computing an inverse DFT with a forward FFT subroutine
(12 marks)
Given. A forward $N$-point DFT subroutine
$\mathrm{DFT}\{\cdot\}$ implementing
$X[k] = \sum_{n=0}^{N-1} x[n]W_{N}^{kn}$ with
$W_{N} = e^{-j2\pi/N}$, the four-step procedure above, and the hint that
swapping real and imaginary parts of $A$ is the operation
$\mathcal{S}\{A\} = (-jA)^{*}$.
Find. Whether the four steps return
$x[n] = \frac{1}{N}\sum_{k}X[k]W_{N}^{-kn}$; a proof if they do, or the
smallest repair if they do not.
Approach. Convert the swap into algebra with the hint, push
it through the DFT sum using the fact that conjugation turns
$W_{N}^{+kn}$ into $W_{N}^{-kn}$, and compare the result with the definition of
the inverse DFT.
The proposed pipeline, with the exact quantity carried on each wire. The two swaps are what convert the forward kernel into the inverse kernel and then undo the leftover factor of j.
Put the swap into algebra. Writing $A = a + jb$, the swap
must return $b + ja$. Check the hint:
$$(-jA)^{*} = \left(-j(a+jb)\right)^{*} = (b - ja)^{*} = b + ja
\;=\; \mathcal{S}\{A\},$$
and the same operation may be written more compactly as
$$\boxed{\;\mathcal{S}\{A\} = (-jA)^{*} = j\,A^{*}\;}$$
The second form is the convenient one, because it separates a
conjugation (which will flip the DFT kernel) from a
constant factor $j$ (which will simply be carried along).
Step 1 — the swapped input. Applying
$\mathcal{S}$ to every DFT value gives the array
$$X_{1}[k] = \mathcal{S}\{X[k]\} = j\,X^{*}[k].$$
Step 2 — run the forward FFT on it. Using
linearity to pull the constant $j$ out, and then the identity
$\left(X[k]e^{+j2\pi kn/N}\right)^{*} = X^{*}[k]e^{-j2\pi kn/N}$ to fold the
kernel into the conjugate,
$$Y[n] = \sum_{k=0}^{N-1} X_{1}[k]\,W_{N}^{kn}
= j\sum_{k=0}^{N-1} X^{*}[k]\,e^{-j2\pi kn/N}
= j\left[\sum_{k=0}^{N-1} X[k]\,e^{+j2\pi kn/N}\right]^{*}.$$
The bracket is precisely $N$ times the inverse DFT of $X[k]$, i.e.
$N x[n]$. Hence
$$\boxed{\;Y[n] = j\,N\,x^{*}[n]\;}$$
This is the crux of the question: conjugating the input converts the
subroutine's forward kernel $W_{N}^{+kn}$ into the inverse kernel
$W_{N}^{-kn}$, at the cost of leaving the answer conjugated and multiplied by
$j$.
Step 3 — the second swap removes both blemishes.
Applying $\mathcal{S}\{A\} = jA^{*}$ once more,
$$Y_{2}[n] = \mathcal{S}\{Y[n]\} = j\left(j N x^{*}[n]\right)^{*}
= j\left(-j N x[n]\right) = N\,x[n].$$
The conjugation in the second swap undoes the conjugation left by step 2, and
the two factors of $j$ combine as $j\cdot(-j) = 1$.
Step 4 — scale. Dividing by $N$ gives
$$\boxed{\;\frac{1}{N}Y_{2}[n] = x[n]\;}$$
so the procedure does work exactly as claimed, for arbitrary
complex $x[n]$ and any $N$ — no modification is required.
Two remarks that the marker is looking for. First, the
result is independent of the sign convention chosen for "swap": if one
instead defines $\mathcal{S}'\{A\} = -\mathcal{S}\{A\} = -jA^{*}$, then step 2
returns $-jNx^{*}[n]$ and step 3 returns
$-j(-jNx^{*}[n])^{*} = -j(jNx[n]) = Nx[n]$ again. The two swaps always cancel
each other's sign, which is why the method is robust in practice. Second, a
single swap would not do: applying the forward DFT directly to $X[k]$
and scaling by $1/N$ gives the circular time reversal
$$\frac{1}{N}\sum_{k}X[k]W_{N}^{kn} = x\!\left[\langle -n\rangle_{N}\right],$$
not $x[n]$ — which is the well-known "DFT applied twice" identity. It is
the pair of swaps, one before and one after, that turns the reversal into a
genuine inversion.
Numerical confirmation, $N = 4$. Take
$x[n] = \{1,\,2,\,-1,\,3\}$, whose 4-point DFT is
$X[k] = \{5,\;2+j,\;-5,\;2-j\}$. Step 1 swaps to
$X_{1}[k] = \{j,\;1+2j,\;-5j,\;-1+2j\}$; step 2 returns
$Y[n] = \{4j,\;8j,\;-4j,\;12j\} = j\cdot4\cdot x^{*}[n]$ since $x$ is real;
step 3 swaps to $\{4,\,8,\,-4,\,12\}$; and step 4 divides by
$N = 4$ to recover $\{1,\,2,\,-1,\,3\} = x[n]$ exactly.
The practical value of the result is that no separate inverse-FFT routine is
needed: a single forward FFT plus $2N$ real data moves and one scaling gives
the inverse, so the arithmetic cost is the same
$O(N\log_{2}N)$ and the extra work is negligible. The same reasoning underlies
the more familiar conjugate-based recipe
$x[n] = \frac{1}{N}\left(\mathrm{DFT}\{X^{*}[k]\}\right)^{*}$, which is the
identical argument with the factors of $j$ omitted.
Question 5 — the quantity on each wire
After step
Array
Value
—
input
$X[k]$
1. swap Re/Im
$X_{1}[k]$
$j\,X^{*}[k]$
2. forward FFT
$Y[n]$
$j\,N\,x^{*}[n]$
3. swap Re/Im
$Y_{2}[n]$
$N\,x[n]$
4. scale by $1/N$
output
$x[n]$ — correct
Verdict
The procedure works as claimed; no modification needed. It also works
with the opposite swap sign, but not with only one swap (that yields
$x[\langle -n\rangle_{N}]$).