-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '177-ofdm-radar-new' into 'master'
Introduce OFDM Radar Closes #177 See merge request barkhauseninstitut/wicon/hermespy!158
- Loading branch information
Showing
31 changed files
with
859 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
===================== | ||
Duplex JCAS Operator | ||
===================== | ||
|
||
.. inheritance-diagram:: hermespy.jcas.jcas.DuplexJCASOperator hermespy.jcas.jcas.JCASTransmission hermespy.jcas.jcas.JCASReception | ||
:parts: 1 | ||
|
||
.. autoclass:: hermespy.jcas.jcas.DuplexJCASOperator | ||
|
||
.. autoclass:: hermespy.jcas.jcas.JCASTransmission | ||
|
||
.. autoclass:: hermespy.jcas.jcas.JCASReception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
.. automodule:: hermespy.jcas.matched_filtering | ||
================= | ||
Matched Filtering | ||
================= | ||
|
||
.. inheritance-diagram:: hermespy.jcas.matched_filtering.MatchedFilterJcas | ||
:parts: 1 | ||
|
||
.. autoclass:: hermespy.jcas.matched_filtering.MatchedFilterJcas | ||
|
||
.. footbibliography:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
========== | ||
OFDM Radar | ||
========== | ||
|
||
|
||
.. inheritance-diagram:: hermespy.jcas.ofdm_radar.OFDMRadar | ||
:parts: 1 | ||
|
||
A radar implementation estimation range-doppler maps from OFDM symbols | ||
as suggested by :footcite:p:`2009:sturm`. | ||
|
||
.. autoclass:: hermespy.jcas.ofdm_radar.OFDMRadar | ||
|
||
.. footbibliography:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import matplotlib.pyplot as plt | ||
|
||
from hermespy.channel import SingleTargetRadarChannel | ||
from hermespy.jcas import OFDMRadar | ||
from hermespy.modem import FrameResource, FrameSymbolSection, FrameElement, ElementType | ||
from hermespy.radar import MaxDetector | ||
from hermespy.simulation import SimulatedDevice | ||
|
||
|
||
carrier_frequency = 24e9 | ||
oversampling_factor = 4 | ||
subcarrier_spacing = 90.909e3 | ||
num_subcarriers = 1024 | ||
prefix_ratio = 1.375 / 12.375 | ||
modulation_order = 16 | ||
|
||
device = SimulatedDevice(carrier_frequency=carrier_frequency) | ||
resources = [FrameResource(64, prefix_ratio=prefix_ratio, elements=[FrameElement(ElementType.DATA, 15), FrameElement(ElementType.REFERENCE, 1)])] | ||
structure = [FrameSymbolSection(11, [0])] | ||
radar = OFDMRadar(oversampling_factor=oversampling_factor, modulation_order=modulation_order, subcarrier_spacing=subcarrier_spacing, resources=resources, structure=structure, device=device) | ||
radar.detector = MaxDetector() | ||
|
||
radar_channel = SingleTargetRadarChannel(.75 * radar.waveform.max_range, 1., velocity=4 * radar.velocity_resolution, attenuate=False, alpha_device=device, beta_device=device) | ||
|
||
transmission = device.transmit() | ||
propagation = radar_channel.propagate(transmission, device, device) | ||
reception = device.receive(propagation) | ||
|
||
radar.reception.cube.plot_range() | ||
radar.reception.cube.plot_range_velocity(scale='velocity') | ||
radar.reception.cloud.plot() | ||
|
||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .matched_filtering import JCASTransmission, JCASReception, MatchedFilterJcas | ||
from .ofdm_radar import OFDMRadar | ||
|
||
__author__ = "Jan Adler" | ||
__copyright__ = "Copyright 2023, Barkhausen Institut gGmbH" | ||
|
@@ -9,4 +12,4 @@ | |
__email__ = "[email protected]" | ||
__status__ = "Prototype" | ||
|
||
__all__ = ["JCASTransmission", "JCASReception", "MatchedFilterJcas"] | ||
__all__ = ["JCASTransmission", "JCASReception", "MatchedFilterJcas", "OFDMRadar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import annotations | ||
from abc import abstractmethod | ||
from typing import Generic, Type | ||
|
||
from h5py import Group | ||
|
||
from hermespy.core import Device, SNRType, Signal | ||
from hermespy.modem.modem import TransmittingModemBase, ReceivingModemBase | ||
from hermespy.modem import BaseModem, CommunicationTransmission, CommunicationReception, CWT | ||
from hermespy.radar import RadarBase, RadarTransmission, RadarReception | ||
|
||
__author__ = "Jan Adler" | ||
__copyright__ = "Copyright 2023, Barkhausen Institut gGmbH" | ||
__credits__ = ["Jan Adler"] | ||
__license__ = "Jan Adler" | ||
__version__ = "1.1.0" | ||
__maintainer__ = "Jan Adler" | ||
__email__ = "[email protected]" | ||
__status__ = "Prototype" | ||
|
||
|
||
class JCASTransmission(CommunicationTransmission, RadarTransmission): | ||
"""Information generated by transmitting over a joint communication and sensing operator.""" | ||
|
||
def __init__(self, transmission: CommunicationTransmission) -> None: | ||
CommunicationTransmission.__init__( | ||
self, signal=transmission.signal, frames=transmission.frames | ||
) | ||
RadarTransmission.__init__(self, signal=transmission.signal) | ||
|
||
@classmethod | ||
def from_HDF(cls: Type[JCASTransmission], group: Group) -> JCASTransmission: | ||
return JCASTransmission(CommunicationTransmission.from_HDF(group)) | ||
|
||
|
||
class JCASReception(CommunicationReception, RadarReception): | ||
"""Information generated by receiving over a joint communication and sensing operator.""" | ||
|
||
def __init__(self, communication: CommunicationReception, radar: RadarReception) -> None: | ||
CommunicationReception.__init__( | ||
self, signal=communication.signal, frames=communication.frames | ||
) | ||
RadarReception.__init__(self, radar.signal, radar.cube, radar.cloud) | ||
|
||
@classmethod | ||
def from_HDF(cls: Type[JCASReception], group: Group) -> JCASReception: | ||
communication_reception = CommunicationReception.from_HDF(group) | ||
radar_reception = RadarReception.from_HDF(group) | ||
|
||
return JCASReception(communication_reception, radar_reception) | ||
|
||
def to_HDF(self, group: Group) -> None: | ||
CommunicationReception.to_HDF(self, group) | ||
RadarReception.to_HDF(self, group) | ||
|
||
|
||
class DuplexJCASOperator( | ||
Generic[CWT], | ||
RadarBase[JCASTransmission, JCASReception], | ||
TransmittingModemBase[CWT], | ||
ReceivingModemBase[CWT], | ||
): | ||
"""Base class for duplex joint communication and sensing operators. | ||
Duplex joint communication and sensing operators transmit a modulated waveform while simultaneously deriving a radar | ||
cube from the received backscattered power. | ||
""" | ||
|
||
def __init__(self, device: Device | None = None, waveform: CWT | None = None, **kwargs) -> None: | ||
""" | ||
Args: | ||
device (Device, optional): | ||
Device this operator operating. | ||
Operator is considered floating by default. | ||
waveform (CWT, optional): | ||
Communication waveform emitted by this operator. | ||
""" | ||
|
||
# Initialize base classes | ||
TransmittingModemBase.__init__(self) | ||
ReceivingModemBase.__init__(self, **kwargs) | ||
RadarBase.__init__(self, device=device) | ||
|
||
# Initialize class attributes | ||
self.device = device | ||
self.waveform = waveform | ||
|
||
@property | ||
def transmitting_device(self) -> Device | None: | ||
return self.device | ||
|
||
@property | ||
def receiving_device(self) -> Device | None: | ||
return self.device | ||
|
||
@property | ||
def sampling_rate(self) -> float: | ||
if self.waveform is None: | ||
return 1.0 | ||
return self.waveform.sampling_rate | ||
|
||
@property | ||
def frame_duration(self) -> float: | ||
if self.waveform is None: | ||
return 0.0 | ||
return self.waveform.frame_duration | ||
|
||
@abstractmethod | ||
def _transmit(self, duration: float = -1.0) -> JCASTransmission: ... # pragma: no cover | ||
|
||
@abstractmethod | ||
def _receive(self, signal: Signal) -> JCASReception: ... # pragma: no cover | ||
|
||
def _recall_transmission(self, group: Group) -> JCASTransmission: | ||
return JCASTransmission.from_HDF(group) | ||
|
||
def _recall_reception(self, group: Group) -> JCASReception: | ||
return JCASReception.from_HDF(group) | ||
|
||
def _noise_power(self, strength: float, snr_type: SNRType) -> float: | ||
return BaseModem._noise_power(self, strength, snr_type) |
Oops, something went wrong.