DSP lab4q1 in python
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import numpy as np
|
||||
import scipy as sp
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
def main():
|
||||
N = 8 # Number of points
|
||||
n = np.arange(0, N) # Range of inputs
|
||||
|
||||
x = (-1)**n # Definition of signal
|
||||
X_N = sp.fft.fft(x) # DFT of signal
|
||||
|
||||
plt.stem(n, X_N)
|
||||
plt.show()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,11 @@
|
||||
import numpy as np
|
||||
import scipy as sp
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user