I am attempting to plot a periodogram in Swift of a signal using Surge.
Code:
var fft_mat = Surge.pow(Surge.fft(signal), 2)
var const_mult = 2.0/Double(signal.count)
for var i in 0..<fft_mat.count { //multiply fft_mat by const_mult
fft_mat[i] = Float(const_mult) * fft_mat[i]
}
var pgram = fft_mat
Plotting pgram yields the following results

However, after loading and creating the exact same periodogram in Python I get a very different periodogram.
Code:
pgram = (2.0/len(signal)) * numpy.power(numpy.fft.fft(signal), 2)

Since I am using the exact same method to plot the periodogram (and the same data as well), I was wondering if there are some differences in the implementation of the Surge fft and numpy fft which might cause this issue?