Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AP-S 2020 - PyRaTk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DELTA
DELTA Low-Cost 5.8GHz FMCW Radar PCB
AP-S 2020 Software
AP-S 2020 - PyRaTk
Commits
1d43bd07
Commit
1d43bd07
authored
5 years ago
by
Merlo, Jason
Browse files
Options
Downloads
Patches
Plain Diff
Fixed velocity issues with Doppler response
parent
77082947
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyratk/acquisition/synth_daq.py
+20
-21
20 additions, 21 deletions
pyratk/acquisition/synth_daq.py
with
20 additions
and
21 deletions
pyratk/acquisition/synth_daq.py
+
20
−
21
View file @
1d43bd07
...
@@ -51,7 +51,8 @@ class SynthDAQ(daq.DAQ):
...
@@ -51,7 +51,8 @@ class SynthDAQ(daq.DAQ):
"""
"""
super
().
__init__
()
super
().
__init__
()
# DAQ Attributes
# DAQ Attributes
self
.
sample_rate
=
daq
[
'
sample_rate
'
]
self
.
sample_interval
=
daq
[
'
sample_interval
'
]
self
.
sample_rate
=
1.0
/
daq
[
'
sample_interval
'
]
self
.
sample_chunk_size
=
daq
[
'
sample_size
'
]
self
.
sample_chunk_size
=
daq
[
'
sample_size
'
]
self
.
daq_type
=
'
SynthDAQ
'
self
.
daq_type
=
'
SynthDAQ
'
self
.
num_channels
=
2
*
len
(
array
[
'
radar_list
'
])
self
.
num_channels
=
2
*
len
(
array
[
'
radar_list
'
])
...
@@ -422,7 +423,7 @@ class SynthDAQ(daq.DAQ):
...
@@ -422,7 +423,7 @@ class SynthDAQ(daq.DAQ):
logging
.
debug
(
'
num_samples: {:}
'
.
format
(
num_sample_chunks
))
logging
.
debug
(
'
num_samples: {:}
'
.
format
(
num_sample_chunks
))
# Allocate doppler sample array
# Allocate doppler sample array
doppler_samples_size
=
(
self
.
num_channels
//
2
,
doppler_samples_size
=
(
self
.
num_channels
//
2
,
2
,
self
.
trajectory_samples
.
shape
[
-
1
])
self
.
trajectory_samples
.
shape
[
-
1
])
doppler_samples
=
np
.
empty
(
doppler_samples_size
,
dtype
=
np
.
float64
)
doppler_samples
=
np
.
empty
(
doppler_samples_size
,
dtype
=
np
.
float64
)
...
@@ -437,18 +438,7 @@ class SynthDAQ(daq.DAQ):
...
@@ -437,18 +438,7 @@ class SynthDAQ(daq.DAQ):
radar_samples_size
=
(
self
.
num_channels
,
doppler_samples
.
shape
[
-
1
])
radar_samples_size
=
(
self
.
num_channels
,
doppler_samples
.
shape
[
-
1
])
radar_samples
=
np
.
empty
(
radar_samples_size
,
dtype
=
np
.
float64
)
radar_samples
=
np
.
empty
(
radar_samples_size
,
dtype
=
np
.
float64
)
# Compute radar responses
radar_samples
=
np
.
reshape
(
doppler_samples
,
radar_samples_size
,
order
=
'
F
'
)
start_time
=
0
end_time
=
doppler_samples
.
shape
[
-
1
]
//
self
.
sample_rate
num_samples
=
doppler_samples
.
shape
[
-
1
]
time
=
np
.
linspace
(
start_time
,
end_time
,
num_samples
)
# Not sure where 31167 comes from, but it seems to scale linearly
radar_freq_response
=
np
.
cumsum
(
doppler_samples
/
31167
,
axis
=-
1
)
# radar_freq_response = doppler_samples * time
tmp_radar_samples
=
np
.
array
([
np
.
cos
(
radar_freq_response
),
np
.
sin
(
radar_freq_response
)])
radar_samples
=
np
.
reshape
(
tmp_radar_samples
,
radar_samples_size
,
order
=
'
F
'
)
# plt.subplot(311)
# plt.subplot(311)
# plt.title('doppler_samples')
# plt.title('doppler_samples')
...
@@ -492,7 +482,7 @@ class SynthDAQ(daq.DAQ):
...
@@ -492,7 +482,7 @@ class SynthDAQ(daq.DAQ):
"""
"""
# Allocate space for samples
# Allocate space for samples
doppler_sample_chunk
=
np
.
empty
((
trajectory_sample
.
shape
[
2
],))
doppler_sample_chunk
=
np
.
empty
((
trajectory_sample
.
shape
[
-
1
],
2
))
# Get constants for conversion
# Get constants for conversion
c
=
spc
.
speed_of_light
c
=
spc
.
speed_of_light
...
@@ -507,14 +497,23 @@ class SynthDAQ(daq.DAQ):
...
@@ -507,14 +497,23 @@ class SynthDAQ(daq.DAQ):
sample_rad
=
sample
.
get_state
(
coordinate_type
=
'
spherical
'
,
sample_rad
=
sample
.
get_state
(
coordinate_type
=
'
spherical
'
,
origin
=
Point
(
*
radar_dict
[
'
location
'
]))
origin
=
Point
(
*
radar_dict
[
'
location
'
]))
# Compute doppler frequency
# Compute phase/amplitude of the signal
rho_dot
=
sample_rad
[
0
,
1
]
rho
=
sample_rad
[
0
,
0
]
wavelength
=
c
/
f0
# Time delay of signal
doppler_freq
=
rho_dot
*
2
/
wavelength
*
2
*
np
.
pi
tau
=
(
rho
/
c
)
sample_interval
=
self
.
sample_interval
output_i
=
np
.
cos
(
2
*
np
.
pi
*
f0
*
(
sample_interval
*
idx
-
tau
))
output_q
=
np
.
sin
(
2
*
np
.
pi
*
f0
*
(
sample_interval
*
idx
-
tau
))
doppler_sample_chunk
[
idx
]
=
doppler_freq
# + AWGN()
# doppler_sample_chunk[idx] = doppler_freq # + AWGN()
doppler_sample_chunk
[
idx
]
=
np
.
array
((
output_i
,
output_q
))
# if idx % 1000 == 0:
# print('rho:', rho)
# print('tau:', tau)
# print('sample:', doppler_sample_chunk[idx])
return
doppler_sample_chunk
return
doppler_sample_chunk
.
transpose
()
def
get_samples
(
self
):
def
get_samples
(
self
):
"""
"""
...
...
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