ELEC60011-DSD-CW/Python/test_script.py
Aadi Desai dc28e5c175
Initial Commit
Include Coursework PDF and basic test script for checking answer in Python
2022-01-25 16:48:03 +00:00

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)