Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
815017c9
Commit
815017c9
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
freqEstimator
parent
01d8f303
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!93
Frequency estimation
Pipeline
#6745
failed with stage
in 5 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/lib/tools.py
+9
-0
9 additions, 0 deletions
saqc/lib/tools.py
with
9 additions
and
0 deletions
saqc/lib/tools.py
+
9
−
0
View file @
815017c9
...
...
@@ -7,6 +7,7 @@ from typing import Sequence, Union, Any, Iterator
import
numpy
as
np
import
numba
as
nb
import
pandas
as
pd
import
scipy.fft
as
fft
import
dios
import
inspect
...
...
@@ -349,3 +350,11 @@ def mutateIndex(index, old_name, new_name):
index
=
index
.
drop
(
index
[
pos
])
index
=
index
.
insert
(
pos
,
new_name
)
return
index
def
estimateFrequency
(
index
,
delta_precision
=-
1
,
max_rate
=
"
30s
"
,
min_rate
=
"
1D
"
):
index_n
=
index
.
to_numpy
(
float
)
index_n
=
(
index_n
-
index_n
[
0
])
*
10
**
(
-
9
+
delta_precision
)
delta
=
np
.
zeros
(
int
(
index_n
[
-
1
])
+
1
)
delta
[
index_n
.
astype
(
int
)]
=
1
delta_f
=
fft
(
delta
)
max_rate_i
=
int
(
len
(
delta_f
)
/
(
pd
.
Timedelta
(
max_rate
).
total_seconds
()
*
(
10
**
delta_precision
)))
\ No newline at end of file
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