Try   HackMD

Radix-4 DIF FFT Algorithm

tags: writeup dsp fft

Introduction

For fast and efficient calculation of Discrete Fourier Transform (DFT), there are Fast Fourier Transforms (FFT). FFT is generally based on divide-and-conquer principle. So, we break the signal into 2 parts, then take the FFT part by part (this is a very simplistic way of explaining).

So, in FFT, if we break the signal (of length

N) into signals of length
2
, then those methods are called Radix-2. Similarly, we can have Radix-4 or any radix. But, for any Radix-
M
method to be used throughout, the signal has to be of length
Mr
. Otherwise, padding can be added to make up the length.

Further, there can be 2 ways to compute FFT:

  • Input stored row-wise and output read column-wise (DIF)
  • Input stored column-wise and output read row-wise (DIT)

DIF algorithms are preferred because input order is unchanged, which is easier to implement in hardware.

Purpose of this write-up

There are not many websites/papers explaining and proving Radix-4 DIF and its butterfly diagram in detail. Thus, this write-up aims to derive the equations of Radix-4 DIF and also explain the butterfly diagram.

Pre-requisites

  • Basic knowledge of DFT, DFT matrix and properties.
  • Knowledge of FFT divide-and-conquer principle.
  • Knowledge of derivations of Radix-2 DIT and DIF will help you understand this faster.

Proof of Radix-4 DIF

Note: It may take some time for the math equations to load.

We start with the DFT equation:

X(k)=n=0Nx(n)WNknk[0,N1]

Now, in DIF, the input is stored row-wise, so no change in input order. We split the above equation in 4 parts as follows:

X(k)=n=0N41x(n)WNkn+n=N42N41x(n)WNkn+n=2N43N41x(n)WNkn+n=3N44N41x(n)WNkn

Then, we substitute

m=ncN4 in the
cth
summation (except the first). We do this to make all the summation limits
[0,N41]
. Thus, we get:
X(k)=n=0N41x(n)WNkn+m=0N41x(m+N4)WNk(m+N4)+m=0N41x(m+2N4)WNk(m+2N4)+m=0N41x(m+3N4)WNk(m+3N4)

Now, consider each

WN term and simplify it separately before moving forward, and using the properties of
WNk
,
WNk(m+cN4)=WNkmWNckN4=WNkmW4ckc[1,3]

We can see that the

WNkm term will be common in all summations and also the limits. So, we replace
m
by
n
and we combine the summations:
X(k)=n=0N41{x(n)W40k+x(n+N4)W41k+x(n+2N4)W42k+x(n+3N4)W43k}WNkn

We can further simplify the

W4ck terms as follows:
W40k=W40=1W41k=(W41)k=(j)kW42k=(W42)k=(1)kW43k=(W43)k=(j)k

So, the equation becomes,

X(k)=n=0N41{x(n)+x(n+N4)(j)k+x(n+2N4)(1)k+x(n+3N4)jk}WNkn

The above equation is not a proper DFT relation since the limits of

n go from
0
to
N41
while the
WN
term has base
N
instead of
N4
.

Further, since output is read column-wise, we need

X(4k),X(4k+1),X(4k+2),X(4k+3) instead of
X(k)
.
X(4k)=n=0N41{x(n)+x(n+N4)(j)4k+x(n+2N4)(1)4k+x(n+3N4)j4k}WN4knX(4k+1)=n=0N41{x(n)+x(n+N4)(j)4k+1+x(n+2N4)(1)4k+1+x(n+3N4)j4k+1}WN(4k+1)nX(4k+2)=n=0N41{x(n)+x(n+N4)(j)4k+2+x(n+2N4)(1)4k+2+x(n+3N4)j4k+2}WN(4k+2)nX(4k+3)=n=0N41{x(n)+x(n+N4)(j)4k+3+x(n+2N4)(1)4k+3+x(n+3N4)j4k+3}WN(4k+3)n

Now, consider the constant terms first:

(j)4k=((j)4)k=1k=1(j)4k+1=(j)4k(j)1=j(j)4k+2=(j)4k(j)2=1(j)4k+3=(j)4k(j)3=j
Similarly, we can find the other constant terms, and the equations become:
X(4k)=n=0N41{x(n)+x(n+N4)+x(n+2N4)+x(n+3N4)}WN4knX(4k+1)=n=0N41{x(n)+x(n+N4)(j)+x(n+2N4)(1)+x(n+3N4)(j)}WN(4k+1)nX(4k+2)=n=0N41{x(n)+x(n+N4)(1)+x(n+2N4)+x(n+3N4)(1)}WN(4k+2)nX(4k+3)=n=0N41{x(n)+x(n+N4)(j)+x(n+2N4)(1)+x(n+3N4)(j)}WN(4k+3)n

We can see that the inner terms are actually the

W4 matrix. More on that later. Now, we simplify the outer terms:
WN4kn=WN4knWN(4k+1)n=WN4knWN1n=WNnWN4knWN(4k+2)n=WN4knWN2n=WN2nWN4knWN(4k+3)n=WN4knWN3n=WN3nWN4kn

So, the equations become:

X(4k)=n=0N41{x(n)+x(n+N4)+x(n+2N4)+x(n+3N4)}WN4knX(4k+1)=n=0N41{x(n)+x(n+N4)(j)+x(n+2N4)(1)+x(n+3N4)(j)}WNnWN4knX(4k+2)=n=0N41{x(n)+x(n+N4)(1)+x(n+2N4)+x(n+3N4)(1)}WN2nWN4knX(4k+3)=n=0N41{x(n)+x(n+N4)(j)+x(n+2N4)(1)+x(n+3N4)(j)}WN3nWN4kn

These 4 equations are

N4 point DFT relations since limits of
n
are from
0
to
N41
and
W
term has base
N4
. These are the generating equations for Radix-4 DIF and can be used to construct the butterfly diagram.

Note: There is no direct matrix form (as in Radix-4 DIT), but the inner part has the

W4 matrix terms.

Butterfly Diagram

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Source of image - [3]
Figure (a) shows the butterfly diagram. It can be understood from the generating equations. It just maps from input to output.
Figure (b) shows the simplified butterfly diagram. The circle at the centre represents the
W4
matrix which is
W4=[11111j1j11111j1j]

So, the 4 inputs are multiplied by the
W4
matrix and then each of the outputs is multiplied by
WNcn
where
c
is the index of the output.

Conclusion

In this write-up, I have attempted to give an in-depth derivation of Radix-4 DIF FFT generating equations and the corresponding butterfly and simplified butterfly diagrams. If there are any issues in this, you can contact me.

References

  1. TI Technical Report on Hardware Implementation of Radix-4 DIF
  2. Notes on FFT
  3. Paper on Radix-4 DIF FFT implementation