Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
AS_activity_recognition
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Max Nyberg Carlsson
AS_activity_recognition
Commits
e702572f
Commit
e702572f
authored
2 years ago
by
Max Nyberg Carlsson
Browse files
Options
Downloads
Patches
Plain Diff
Final touches
parent
6386112c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
activity.jl
+3
-2
3 additions, 2 deletions
activity.jl
with
3 additions
and
2 deletions
activity.jl
+
3
−
2
View file @
e702572f
...
...
@@ -40,14 +40,14 @@ function read_data(dataname, sensor)
end
read_acc
(
dataname
)
=
read_data
(
dataname
,
"acc"
)
norm
alize
_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
|>
norm
alize
_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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment