4 base
= os
.path
.dirname(__file__
)
5 path
= os
.path
.dirname(base
)
6 path
= os
.path
.dirname(path
)
7 sys
.path
.insert(0, path
)
10 import matplotlib
.pyplot
as plt
11 except Exception as e
:
15 import liba
# type: ignore
17 x
= np
.arange(0, np
.pi
* 10, np
.pi
* 0.1)
18 x1
= np
.sin(x
) + 0.2 * (np
.random
.random(len(x
)) - 0.5)
20 lpf
= liba
.lpf(10, 0.01)
21 for i
in range(len(x2
)):
23 plt
.figure("Low Pass Filter")
24 plt
.plot(x
, x1
, "b-", x
, x2
, "g-")
25 plt
.savefig(os
.path
.join(base
, "lpf.png"))