Skip to content
Snippets Groups Projects
Commit e702572f authored by Max Nyberg Carlsson's avatar Max Nyberg Carlsson
Browse files

Final touches

parent 6386112c
Branches
No related tags found
No related merge requests found
......@@ -40,14 +40,14 @@ function read_data(dataname, sensor)
end
read_acc(dataname) = read_data(dataname, "acc")
normalize_data(A) = sqrt.(sum(A.^2, dims=2)) #Euclidean norm of data
norm_data(A) = sqrt.(sum(A.^2, dims=2)) #Euclidean norm of data
decimate(v) = resample(v, 0.1) #decimate data
mean(v) = sum(v)/length(v)
detrend(v) = v .- mean(v) #remove mean
xyz(data) = data[:,2:4] #extract relevant components
# Acceleration data pipieline:
acc_data(dataname) = read_acc(dataname) |> xyz |> normalize_data |> vec |> decimate
acc_data(dataname) = read_acc(dataname) |> xyz |> norm_data |> vec |> decimate
# Spectrogram calculation:
acc_frequency(dataname) = acc_data(dataname) |> detrend |> get_spectrogram
......@@ -102,3 +102,4 @@ function menuplot()
#plot!(activity,label="Activity")
end
menuplot()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment