mirror of
https://github.com/supleed2/ELEC60011-DSD-CW.git
synced 2024-11-10 02:05:49 +00:00
13 lines
237 B
Python
13 lines
237 B
Python
|
from cmath import cos
|
||
|
from typing import Concatenate
|
||
|
import numpy as np
|
||
|
|
||
|
start = 0
|
||
|
stop = 255
|
||
|
step = 5
|
||
|
x = list(np.arange(start, stop, step)) + [stop]
|
||
|
acc = 0
|
||
|
for i in x:
|
||
|
acc += 0.5 * i + i * i * cos((i - 128) / 128)
|
||
|
print(acc.real)
|