15 lines
229 B
Python
15 lines
229 B
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
N = 8
|
|
n = np.arange(N)
|
|
x = (-1.0)**n
|
|
DFT_8_point = np.fft.fft(x, 8)
|
|
DFT_9_point = np.fft.fft(x, 9)
|
|
|
|
plt.stem(abs(DFT_8_point))
|
|
plt.show()
|
|
|
|
plt.stem(abs(DFT_9_point))
|
|
plt.show()
|