Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PythonProjects
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Köhler, Marcel
PythonProjects
Commits
fd08bf32
Commit
fd08bf32
authored
4 months ago
by
Köhler, Marcel
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
f3fae115
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SignalProcessing/linearity_adder.py
+46
-0
46 additions, 0 deletions
SignalProcessing/linearity_adder.py
with
46 additions
and
0 deletions
SignalProcessing/linearity_adder.py
0 → 100644
+
46
−
0
View file @
fd08bf32
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: imp
"""
file
=
'
./data.npz
'
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
pwelch_solv
as
ps
# load Data
loaded
=
np
.
load
(
file
)
# sort Data
sinuses
=
loaded
[
'
sinuses
'
]
noises
=
loaded
[
'
noises
'
]
signal
=
loaded
[
'
signal
'
]
weightedSignal
=
loaded
[
'
weightedSignal
'
]
T
=
10
# 10 seconds sampling time
N_samples
=
len
(
sinuses
[
0
])
# Nr of samples
fs
=
N_samples
/
T
# sample frequency
Ts
=
1
/
fs
# sample Period time
t
=
np
.
linspace
(
0
,
T
,
N_samples
)
# create time vector
# small snippet of data
idx
=
np
.
linspace
(
0
,
(
0.1
/
Ts
),
int
(
0.1
/
Ts
)
+
1
,
dtype
=
int
)
# Signal difference between ideal and weighted
delta
=
signal
-
weightedSignal
#prepare for pwelch solver
x
=
delta
-
np
.
mean
(
delta
)
hwin
=
np
.
hanning
(
len
(
x
))
N_overl
=
len
(
hwin
)
/
2
;
S
=
ps
.
func_pwelch
(
x
,
hwin
,
N_overl
,
fs
)
plt
.
figure
()
plt
.
semilogx
(
S
[
'
vfp
'
],
S
[
'
LS
'
])
plt
.
xlabel
(
'
f in Hz
'
)
plt
.
ylabel
(
'
LS in V
'
)
plt
.
title
(
'
LS of delta
'
)
\ 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