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
049b12b1
Commit
049b12b1
authored
4 years ago
by
Merlo, Jason
Browse files
Options
Downloads
Patches
Plain Diff
Added initial scene subtraction
parent
bf3e85e6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyratk/radars/radar.py
+22
-7
22 additions, 7 deletions
pyratk/radars/radar.py
pyratk/widgets/range_doppler_widget.py
+1
-1
1 addition, 1 deletion
pyratk/widgets/range_doppler_widget.py
with
23 additions
and
8 deletions
pyratk/radars/radar.py
+
22
−
7
View file @
049b12b1
...
@@ -186,7 +186,10 @@ class Receiver(object):
...
@@ -186,7 +186,10 @@ class Receiver(object):
# Calculate slow-time complex FFT
# Calculate slow-time complex FFT
dc
=
self
.
datacube
.
get_frame
(
-
1
)
if
self
.
datacube
[
-
1
].
shape
==
self
.
datacube
[
-
2
].
shape
:
dc
=
self
.
datacube
[
-
1
]
-
self
.
datacube
[
-
2
]
else
:
dc
=
self
.
datacube
[
-
1
]
# print('dc.shape',dc.shape)
# print('dc.shape',dc.shape)
self
.
fft_mat
=
self
.
compute_fft2
(
dc
,
(
self
.
slow_fft_size
,
self
.
fast_fft_size
))
self
.
fft_mat
=
self
.
compute_fft2
(
dc
,
(
self
.
slow_fft_size
,
self
.
fast_fft_size
))
# print('fft_mat.shape', self.fft_mat.shape)
# print('fft_mat.shape', self.fft_mat.shape)
...
@@ -208,23 +211,35 @@ class DataCube(object):
...
@@ -208,23 +211,35 @@ class DataCube(object):
def
__init__
(
self
,
receiver
):
def
__init__
(
self
,
receiver
):
self
.
receiver
=
receiver
self
.
receiver
=
receiver
# TODO: only supports single pulse
self
.
samples_per_pulse
=
int
(
self
.
receiver
.
daq
.
sample_rate
*
self
.
receiver
.
transmitter
.
pulses
[
0
].
delay
)
self
.
samples_per_pulse
=
int
(
self
.
receiver
.
daq
.
sample_rate
*
self
.
receiver
.
transmitter
.
pulses
[
0
].
delay
)
def
get_frame
(
self
,
idx
,
num_chirps
=
100
):
def
get_frame
(
self
,
key
):
"""
"""
Create datacube with specified number of most recent frames.
Create datacube with specified number of most recent frames.
Returns a complex datacube. Final shape will be:
Returns a complex datacube. Final shape will be:
frames x
slow_fft_len x samples_per_pulse
slow_fft_len x samples_per_pulse
"""
"""
if
idx
!=
-
1
:
raise
NotImplementedError
(
'
Currenly only last frame is supported.
'
)
start
=
self
.
receiver
.
slow_fft_len
*
key
end
=
self
.
receiver
.
slow_fft_len
*
(
key
+
1
)
idx
=
self
.
receiver
.
daq_index
idx
=
self
.
receiver
.
daq_index
datacube
=
self
.
receiver
.
daq
.
ts_buffer
[
-
self
.
receiver
.
slow_fft_len
:,
idx
[
0
]]
\
+
1.0j
*
self
.
receiver
.
daq
.
ts_buffer
[
-
self
.
receiver
.
slow_fft_len
:,
idx
[
1
]]
if
end
==
0
:
datacube
=
self
.
receiver
.
daq
.
ts_buffer
[
start
:,
idx
[
0
]]
\
+
1.0j
*
self
.
receiver
.
daq
.
ts_buffer
[
start
:,
idx
[
1
]]
else
:
datacube
=
self
.
receiver
.
daq
.
ts_buffer
[
start
:
end
,
idx
[
0
]]
\
+
1.0j
*
self
.
receiver
.
daq
.
ts_buffer
[
start
:
end
,
idx
[
1
]]
# print('datacube.shape:', datacube.shape)
# print('datacube.shape:', datacube.shape)
# Subtract mean
mean_i
=
np
.
mean
(
datacube
.
real
)
mean_q
=
np
.
mean
(
datacube
.
imag
)
datacube
-=
mean_i
+
mean_q
*
1.0j
return
datacube
return
datacube
def
__getitem__
(
self
,
key
):
def
__getitem__
(
self
,
key
):
...
...
This diff is collapsed.
Click to expand it.
pyratk/widgets/range_doppler_widget.py
+
1
−
1
View file @
049b12b1
...
@@ -50,7 +50,7 @@ class RangeDopplerWidget(pg.PlotWidget):
...
@@ -50,7 +50,7 @@ class RangeDopplerWidget(pg.PlotWidget):
# set colormap
# set colormap
self
.
img
.
setLookupTable
(
lut
)
self
.
img
.
setLookupTable
(
lut
)
self
.
img
.
setLevels
([
-
3
0
,
30
])
self
.
img
.
setLevels
([
-
6
0
,
30
])
self
.
rescale
()
self
.
rescale
()
...
...
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