Professional Documents
Culture Documents
Abstract:
Introduction:
Radix 3 (DIT):
The radix-3 DIT FFT algorithm works by recursively breaking down the
input sequence of N complex numbers into three smaller subsequences of
length N/3 each. This process continues until the subsequences are of
length 1, which are trivially their own DFTs.
The three smaller subsequences are then combined using a set of three
twiddle factors, which are complex numbers that depend on the position in
the sequence and the length of the DFT being computed. The resulting
sequence is the DFT of the original sequence.
One advantage of the radix-3 DIT FFT algorithm over the radix-2 DIT FFT
algorithm is that it requires fewer arithmetic operations for a given
sequence length. This can result in faster computation times for certain
lengths.
Radix 3 (DIF):
The algorithm uses a set of three twiddle factors to combine the smaller
DFTs, and these twiddle factors are complex numbers that depend on the
position in the sequence and the length of the DFT being computed.
One advantage of the radix-3 DIF FFT algorithm over the radix-2 DIF FFT
algorithm is that it can be more memory efficient, as it requires less
temporary storage for intermediate results. However, it can require more
arithmetic operations for a given sequence length, which can result in
slower computation times for certain lengths.
Procedure:
DIT:
DIF:
If the length of the input signal is not a power of 3, add zeros to the end of the
signal until its length becomes a power of three.
Divide the signal into three parts with consecutive 3rd elements.
Combine the results of the three sub-transforms using the butterfly structure.
According to the butterfly structure of the Radix 3 DIF, combine the three parts.
Results:
Discussions:
Conclusion:
References:
Appendice:
import numpy as np
from matplotlib import pyplot as plt
def W(N):
return np.exp(-2j*np.pi/N)
x0_ = []
x1_ = []
x2_ = []
for (k, (i_, j_, k_)) in enumerate(zip(x0, x1, x2)):
x0_.append(i_+j_+k_)
x1_.append((i_ + (j_*(-1-val)/2) + (k_*(-1+val)/2))*W(N)**k)
x2_.append((i_ + (j_*(-1+val)/2) + (k_*(-1-
val)/2))*W(N)**(2*k))
X0 = ganni_radix3dif(x0_, N//3)
X1 = ganni_radix3dif(x1_, N//3)
X2 = ganni_radix3dif(x2_, N//3)
Y = []
for i in range(len(X0)):
Y.append(X0[i])
Y.append(X1[i])
Y.append(X2[i])
return Y
N = 243
N = int(N)
fs = 160
ts = 1/fs
x = [np.cos(20*np.pi*i) for i in t]
x = np.array(x)
Y = np.fft.fft(x)
Y1 = ganni_radix3dif(x, N)
Y2 = ganni_radix3dif(x, N)
Ya = [np.angle(i) for i in Y]
Ym = [abs(i) for i in Y]
Y1a = [np.angle(i) for i in Y1]
Y1m = [abs(i) for i in Y1]
Y2a = [np.angle(i) for i in Y2]
Y2m = [abs(i) for i in Y2]
plt.figure()
plt.subplot(2, 1, 1)
p1m = plt.stem(f, Y1m)[0].axes
p1m.set_ylabel('|Y|')
p1m.set_title('|Y| vs f - (DIT)')
plt.subplot(2, 1, 2)
p1a = plt.stem(f, Y1a)[0].axes
p1a.set_ylabel('ang(Y)')
p1a.set_title('ang(Y) vs f - (DIT)')
plt.tight_layout()
plt.show()