DSP examples for class 1
This commit is contained in:
parent
ee51f180d4
commit
ae7130cdfd
@ -0,0 +1,21 @@
|
|||||||
|
def letter_grade(number_grade):
|
||||||
|
if number_grade >= 90:
|
||||||
|
return 'A'
|
||||||
|
elif number_grade >= 80:
|
||||||
|
return 'B'
|
||||||
|
elif number_grade >= 70:
|
||||||
|
return 'C'
|
||||||
|
elif number_grade >= 60:
|
||||||
|
return 'D'
|
||||||
|
return 'F'
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
#print("Hello, world")
|
||||||
|
num_grade = 65
|
||||||
|
let_grade = letter_grade(num_grade)
|
||||||
|
print(let_grade)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -0,0 +1,19 @@
|
|||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
#x_axis = np.linspace(-5, 5, 100)
|
||||||
|
f_s = 3
|
||||||
|
T_s = 1/f_s
|
||||||
|
|
||||||
|
x_axis = np.arange(-5, 5, T_s)
|
||||||
|
x_axis_2 = np.linspace(-5, 5, len(x_axis))
|
||||||
|
y_axis = x_axis**2
|
||||||
|
|
||||||
|
plt.stem(x_axis, y_axis)
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user