I don't think I need to expand much, I am failing spectacularly. I've tried so many different ways ๐ฆ . Here's my code: ```py
import numpy as np
from scipy.signal import find_peaks
class DFT:
def init(self, x: list):
self.x: list = x
self.T: int = len(x)
self.a0: float | int = sum(x) / self.T
def calc(self, freqs: int, samplePoints: int):
ret = []
for freq in range(freqs):
temp = 0
for i in range(self.T):
temp += self.x[i] * np.sin(i * freq / 10000) - self.a0 * np.sin(
i * freq / 10000
)
ret.append(temp / samplePoints * 100)
peaks, prop = find_peaks(ret, prominence=100, width=3, height=100, distance=40)
prominence = prop["prominences"]
for pr in range(len(prominence)):
prominence[pr] /= 1000
return [peaks, prominence]