bayesiancnn-data-parsing/datafft.jl

24 lines
473 B
Julia
Executable File

include("aux_func.jl")
using Plots
using FFTW
using DSP
folder = "exp_100_epochs/"
bay_watt_1 = load_pickle("$(folder)bayes_wattdata_1.pkl")
bay_watt_1 = removewatt(bay_watt_1[:, 1])
N = length(bay_watt_1) - 1
Ts = 1 / (1.1 * N)
t0 = 0
tmax = t0 + N * Ts
t = t0:Ts:tmax
bay_watt_1_fft = fft(bay_watt_1) |> fftshift
bay_watt_1_fft_f = fftfreq(length(t), 1.0 / Ts) |> fftshift
plot(bay_watt_1)
plot(bay_watt_1_fft_f, abs.(bay_watt_1_fft), title = "Spectrum")
length(t)