spectre-core 0.0.14__tar.gz → 0.0.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spectre_core-0.0.14 → spectre_core-0.0.15}/PKG-INFO +1 -1
- {spectre_core-0.0.14 → spectre_core-0.0.15}/pyproject.toml +1 -1
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_pnames.py +2 -1
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_ptemplates.py +10 -2
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/__init__.py +3 -2
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/_base.py +3 -26
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/_factory.py +9 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/_spec_names.py +3 -1
- spectre_core-0.0.15/src/spectre_core/receivers/plugins/_b200mini.py +72 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/_receiver_names.py +5 -3
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/_rsp1a.py +13 -7
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/_rspduo.py +12 -8
- spectre_core-0.0.15/src/spectre_core/receivers/plugins/_sdrplay_receiver.py +174 -0
- spectre_core-0.0.15/src/spectre_core/receivers/plugins/_usrp.py +70 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/_rsp1a.py +1 -15
- spectre_core-0.0.15/src/spectre_core/receivers/plugins/gr/_usrp.py +62 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core.egg-info/PKG-INFO +1 -1
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core.egg-info/SOURCES.txt +3 -0
- spectre_core-0.0.14/src/spectre_core/receivers/plugins/_sdrplay_receiver.py +0 -190
- {spectre_core-0.0.14 → spectre_core-0.0.15}/LICENSE +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/README.md +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/setup.cfg +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/_file_io/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/_file_io/file_handlers.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/_base.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/_batches.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/_factory.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/_register.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/plugins/_batch_keys.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/plugins/_callisto.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/batches/plugins/_iq_stream.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_capture_config.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_capture_modes.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_capture_templates.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_parameters.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_pconstraints.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_pvalidators.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/config/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/config/_paths.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/config/_time_formats.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/exceptions.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/jobs/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/jobs/_jobs.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/jobs/_workers.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/logs/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/logs/_configure.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/logs/_decorators.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/logs/_logs.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/logs/_process_types.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/plotting/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/plotting/_base.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/plotting/_format.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/plotting/_panel_names.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/plotting/_panel_stack.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/plotting/_panels.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/_base.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/_factory.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/_post_processor.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/_register.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/plugins/_event_handler_keys.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/plugins/_fixed_center_frequency.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/plugins/_swept_center_frequency.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/py.typed +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/_register.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/_test.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/_base.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/_rspduo.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/_test.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/spectrograms/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/spectrograms/_analytical.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/spectrograms/_array_operations.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/spectrograms/_spectrogram.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/spectrograms/_transform.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/wgetting/__init__.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/wgetting/_callisto.py +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core.egg-info/dependency_links.txt +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core.egg-info/requires.txt +0 -0
- {spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core.egg-info/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from textwrap import dedent
|
|
7
7
|
from copy import deepcopy
|
8
8
|
|
9
9
|
from ._pnames import PName
|
10
|
-
from ._pconstraints import BasePConstraint, EnforceSign, PowerOfTwo
|
10
|
+
from ._pconstraints import BasePConstraint, EnforceSign, PowerOfTwo, Bound
|
11
11
|
from ._parameters import Parameter
|
12
12
|
|
13
13
|
# value type
|
@@ -300,6 +300,14 @@ _base_ptemplates: dict[PName, PTemplate] = {
|
|
300
300
|
pconstraints=[
|
301
301
|
EnforceSign.non_positive
|
302
302
|
]),
|
303
|
+
PName.NORMALISED_GAIN: PTemplate(PName.NORMALISED_GAIN,
|
304
|
+
float,
|
305
|
+
help = """
|
306
|
+
The normalised gain value, where 1.0 is mapped to the max gain of the receiver being used.
|
307
|
+
""",
|
308
|
+
pconstraints=[
|
309
|
+
Bound(0.0, 1.0)
|
310
|
+
]),
|
303
311
|
PName.EVENT_HANDLER_KEY: PTemplate(PName.EVENT_HANDLER_KEY,
|
304
312
|
str,
|
305
313
|
help = """
|
@@ -490,4 +498,4 @@ def get_base_ptemplate(
|
|
490
498
|
# A deep copy is required as each receiver instance may mutate the original instance
|
491
499
|
# according to its particular use case. Copying preserves the original instance,
|
492
500
|
# enabling reuse.
|
493
|
-
return deepcopy( _base_ptemplates[pname] )
|
501
|
+
return deepcopy( _base_ptemplates[pname] )
|
@@ -8,6 +8,7 @@ from .plugins._receiver_names import ReceiverName
|
|
8
8
|
from .plugins._test import Test
|
9
9
|
from .plugins._rsp1a import RSP1A
|
10
10
|
from .plugins._rspduo import RSPduo
|
11
|
+
from .plugins._b200mini import B200mini
|
11
12
|
|
12
13
|
from ._base import BaseReceiver
|
13
14
|
from ._factory import get_receiver
|
@@ -15,6 +16,6 @@ from ._register import get_registered_receivers
|
|
15
16
|
from ._spec_names import SpecName
|
16
17
|
|
17
18
|
__all__ = [
|
18
|
-
"Test", "RSP1A", "RSPduo", "BaseReceiver", "get_receiver",
|
19
|
+
"Test", "RSP1A", "RSPduo", "B200mini", "BaseReceiver", "get_receiver",
|
19
20
|
"get_registered_receivers", "SpecName", "ReceiverName"
|
20
|
-
]
|
21
|
+
]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
5
5
|
from abc import ABC, abstractmethod
|
6
|
-
from typing import Callable, Optional, Literal, overload
|
6
|
+
from typing import Callable, Optional, Literal, overload, Any
|
7
7
|
|
8
8
|
from spectre_core.exceptions import ModeNotFoundError
|
9
9
|
from spectre_core.capture_configs import (
|
@@ -236,34 +236,11 @@ class BaseReceiver(ABC):
|
|
236
236
|
"""
|
237
237
|
self.specs[name] = value
|
238
238
|
|
239
|
-
|
240
|
-
# tell static type checkers the type of specification
|
241
|
-
@overload
|
242
|
-
def get_spec(self, spec_name: Literal[SpecName.API_RETUNING_LATENCY]) -> float: ...
|
243
|
-
@overload
|
244
|
-
def get_spec(self, spec_name: Literal[SpecName.FREQUENCY_LOWER_BOUND]) -> float: ...
|
245
|
-
@overload
|
246
|
-
def get_spec(self, spec_name: Literal[SpecName.FREQUENCY_UPPER_BOUND]) -> float: ...
|
247
|
-
@overload
|
248
|
-
def get_spec(self, spec_name: Literal[SpecName.SAMPLE_RATE_LOWER_BOUND]) -> int: ...
|
249
|
-
@overload
|
250
|
-
def get_spec(self, spec_name: Literal[SpecName.SAMPLE_RATE_UPPER_BOUND]) -> int: ...
|
251
|
-
@overload
|
252
|
-
def get_spec(self, spec_name: Literal[SpecName.BANDWIDTH_LOWER_BOUND]) -> float: ...
|
253
|
-
@overload
|
254
|
-
def get_spec(self, spec_name: Literal[SpecName.BANDWIDTH_UPPER_BOUND]) -> float: ...
|
255
|
-
@overload
|
256
|
-
def get_spec(self, spec_name: Literal[SpecName.RF_GAIN_UPPER_BOUND]) -> int: ...
|
257
|
-
@overload
|
258
|
-
def get_spec(self, spec_name: Literal[SpecName.IF_GAIN_UPPER_BOUND]) -> int: ...
|
259
|
-
@overload
|
260
|
-
def get_spec(self, spec_name: Literal[SpecName.BANDWIDTH_OPTIONS]) -> list[float]: ...
|
261
|
-
|
262
239
|
|
263
240
|
def get_spec(
|
264
241
|
self,
|
265
242
|
spec_name: SpecName
|
266
|
-
) ->
|
243
|
+
) -> Any:
|
267
244
|
"""
|
268
245
|
Retrieve a hardware specification.
|
269
246
|
|
@@ -328,4 +305,4 @@ class BaseReceiver(ABC):
|
|
328
305
|
parameters = self.capture_template.apply_template(capture_config.parameters)
|
329
306
|
self.pvalidator(parameters)
|
330
307
|
|
331
|
-
return parameters
|
308
|
+
return parameters
|
@@ -11,6 +11,7 @@ from .plugins._receiver_names import ReceiverName
|
|
11
11
|
from .plugins._rsp1a import RSP1A
|
12
12
|
from .plugins._rspduo import RSPduo
|
13
13
|
from .plugins._test import Test
|
14
|
+
from .plugins._b200mini import B200mini
|
14
15
|
|
15
16
|
|
16
17
|
@overload
|
@@ -37,6 +38,14 @@ def get_receiver(
|
|
37
38
|
...
|
38
39
|
|
39
40
|
|
41
|
+
@overload
|
42
|
+
def get_receiver(
|
43
|
+
receiver_name: Literal[ReceiverName.B200MINI],
|
44
|
+
mode: Optional[str] = None
|
45
|
+
) -> B200mini:
|
46
|
+
...
|
47
|
+
|
48
|
+
|
40
49
|
@overload
|
41
50
|
def get_receiver(
|
42
51
|
receiver_name: ReceiverName,
|
@@ -18,6 +18,8 @@ class SpecName(Enum):
|
|
18
18
|
Negative values indicate attenuation.
|
19
19
|
:ivar RF_GAIN_UPPER_BOUND: The upper bound for the radio frequency gain, in dB.
|
20
20
|
Negative values indicate attenuation.
|
21
|
+
:ivar API_RETUNING_LATENCY: An empirical estimate of the delay between issuing a command
|
22
|
+
for a receiver to retune its center frequency and the actual physical update of the center frequency.
|
21
23
|
"""
|
22
24
|
FREQUENCY_LOWER_BOUND = "frequency_lower_bound"
|
23
25
|
FREQUENCY_UPPER_BOUND = "frequency_upper_bound"
|
@@ -28,4 +30,4 @@ class SpecName(Enum):
|
|
28
30
|
BANDWIDTH_OPTIONS = "bandwidth_options"
|
29
31
|
IF_GAIN_UPPER_BOUND = "if_gain_upper_bound"
|
30
32
|
RF_GAIN_UPPER_BOUND = "rf_gain_upper_bound"
|
31
|
-
API_RETUNING_LATENCY = "api_retuning_latency"
|
33
|
+
API_RETUNING_LATENCY = "api_retuning_latency"
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
+
# This file is part of SPECTRE
|
3
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
+
|
5
|
+
from dataclasses import dataclass
|
6
|
+
|
7
|
+
from ._receiver_names import ReceiverName
|
8
|
+
from ._usrp import (
|
9
|
+
get_pvalidator_fixed_center_frequency,
|
10
|
+
get_capture_template_fixed_center_frequency
|
11
|
+
)
|
12
|
+
from .gr._usrp import CaptureMethod
|
13
|
+
from .._spec_names import SpecName
|
14
|
+
from .._base import BaseReceiver
|
15
|
+
from .._register import register_receiver
|
16
|
+
|
17
|
+
@dataclass(frozen=True)
|
18
|
+
class Mode:
|
19
|
+
"""An operating mode for the `B200mini` receiver."""
|
20
|
+
FIXED_CENTER_FREQUENCY = "fixed_center_frequency"
|
21
|
+
|
22
|
+
|
23
|
+
@register_receiver(ReceiverName.B200MINI)
|
24
|
+
class B200mini(BaseReceiver):
|
25
|
+
"""Receiver implementation for the USRP B200mini (https://www.ettus.com/all-products/usrp-b200mini/)"""
|
26
|
+
def _add_specs(
|
27
|
+
self
|
28
|
+
) -> None:
|
29
|
+
self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3 )
|
30
|
+
self.add_spec( SpecName.SAMPLE_RATE_UPPER_BOUND, 56e6 )
|
31
|
+
self.add_spec( SpecName.FREQUENCY_LOWER_BOUND , 70e6 )
|
32
|
+
self.add_spec( SpecName.FREQUENCY_UPPER_BOUND , 6e9 )
|
33
|
+
self.add_spec( SpecName.BANDWIDTH_LOWER_BOUND , 200e3 )
|
34
|
+
self.add_spec( SpecName.BANDWIDTH_UPPER_BOUND , 56e6 )
|
35
|
+
|
36
|
+
|
37
|
+
def _add_capture_methods(
|
38
|
+
self
|
39
|
+
) -> None:
|
40
|
+
self.add_capture_method(Mode.FIXED_CENTER_FREQUENCY,
|
41
|
+
CaptureMethod.fixed_center_frequency)
|
42
|
+
|
43
|
+
|
44
|
+
def _add_capture_templates(
|
45
|
+
self
|
46
|
+
) -> None:
|
47
|
+
self.add_capture_template(Mode.FIXED_CENTER_FREQUENCY,
|
48
|
+
get_capture_template_fixed_center_frequency(self))
|
49
|
+
|
50
|
+
|
51
|
+
def _add_pvalidators(
|
52
|
+
self
|
53
|
+
) -> None:
|
54
|
+
self.add_pvalidator(Mode.FIXED_CENTER_FREQUENCY,
|
55
|
+
get_pvalidator_fixed_center_frequency(self))
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/_receiver_names.py
RENAMED
@@ -10,7 +10,9 @@ class ReceiverName(Enum):
|
|
10
10
|
:ivar RSP1A: SDRPlay RSP1A
|
11
11
|
:ivar RSPDUO: SDRPlay RSPduo
|
12
12
|
:ivar TEST: `spectre` test receiver.
|
13
|
+
:ivar B200MINI: USRP B200mini.
|
13
14
|
"""
|
14
|
-
RSP1A
|
15
|
-
RSPDUO
|
16
|
-
TEST
|
15
|
+
RSP1A = "rsp1a"
|
16
|
+
RSPDUO = "rspduo"
|
17
|
+
TEST = "test"
|
18
|
+
B200MINI = "b200mini"
|
@@ -6,8 +6,12 @@ from dataclasses import dataclass
|
|
6
6
|
|
7
7
|
from ._receiver_names import ReceiverName
|
8
8
|
from .gr._rsp1a import CaptureMethod
|
9
|
+
from ._sdrplay_receiver import (
|
10
|
+
get_pvalidator_fixed_center_frequency, get_pvalidator_swept_center_frequency,
|
11
|
+
get_capture_template_fixed_center_frequency, get_capture_template_swept_center_frequency
|
12
|
+
)
|
9
13
|
from .._spec_names import SpecName
|
10
|
-
from
|
14
|
+
from .._base import BaseReceiver
|
11
15
|
from .._register import register_receiver
|
12
16
|
|
13
17
|
@dataclass(frozen=True)
|
@@ -18,9 +22,11 @@ class Mode:
|
|
18
22
|
|
19
23
|
|
20
24
|
@register_receiver(ReceiverName.RSP1A)
|
21
|
-
class RSP1A(
|
25
|
+
class RSP1A(BaseReceiver):
|
22
26
|
"""Receiver implementation for the SDRPlay RSP1A (https://www.sdrplay.com/rsp1a/)"""
|
23
|
-
def _add_specs(
|
27
|
+
def _add_specs(
|
28
|
+
self
|
29
|
+
) -> None:
|
24
30
|
self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3 )
|
25
31
|
self.add_spec( SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6 )
|
26
32
|
self.add_spec( SpecName.FREQUENCY_LOWER_BOUND , 1e3 )
|
@@ -45,15 +51,15 @@ class RSP1A(SDRPlayReceiver):
|
|
45
51
|
self
|
46
52
|
) -> None:
|
47
53
|
self.add_capture_template(Mode.FIXED_CENTER_FREQUENCY,
|
48
|
-
self
|
54
|
+
get_capture_template_fixed_center_frequency(self))
|
49
55
|
self.add_capture_template(Mode.SWEPT_CENTER_FREQUENCY,
|
50
|
-
self
|
56
|
+
get_capture_template_swept_center_frequency(self))
|
51
57
|
|
52
58
|
|
53
59
|
def _add_pvalidators(
|
54
60
|
self
|
55
61
|
) -> None:
|
56
62
|
self.add_pvalidator(Mode.FIXED_CENTER_FREQUENCY,
|
57
|
-
self
|
63
|
+
get_pvalidator_fixed_center_frequency(self))
|
58
64
|
self.add_pvalidator(Mode.SWEPT_CENTER_FREQUENCY,
|
59
|
-
self
|
65
|
+
get_pvalidator_swept_center_frequency(self))
|
@@ -7,7 +7,11 @@ from dataclasses import dataclass
|
|
7
7
|
from ._receiver_names import ReceiverName
|
8
8
|
from .gr._rspduo import CaptureMethod
|
9
9
|
from .._spec_names import SpecName
|
10
|
-
from ._sdrplay_receiver import
|
10
|
+
from ._sdrplay_receiver import (
|
11
|
+
get_pvalidator_fixed_center_frequency, get_pvalidator_swept_center_frequency,
|
12
|
+
get_capture_template_fixed_center_frequency, get_capture_template_swept_center_frequency
|
13
|
+
)
|
14
|
+
from .._base import BaseReceiver
|
11
15
|
from .._register import register_receiver
|
12
16
|
|
13
17
|
|
@@ -20,7 +24,7 @@ class Mode:
|
|
20
24
|
|
21
25
|
|
22
26
|
@register_receiver(ReceiverName.RSPDUO)
|
23
|
-
class RSPduo(
|
27
|
+
class RSPduo(BaseReceiver):
|
24
28
|
"""Receiver implementation for the SDRPlay RSPduo (https://www.sdrplay.com/rspduo/)"""
|
25
29
|
def _add_specs(self) -> None:
|
26
30
|
self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3 )
|
@@ -49,19 +53,19 @@ class RSPduo(SDRPlayReceiver):
|
|
49
53
|
self
|
50
54
|
) -> None:
|
51
55
|
self.add_capture_template(Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
|
52
|
-
self
|
56
|
+
get_capture_template_fixed_center_frequency(self))
|
53
57
|
self.add_capture_template(Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
|
54
|
-
self
|
58
|
+
get_capture_template_fixed_center_frequency(self))
|
55
59
|
self.add_capture_template(Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
56
|
-
self
|
60
|
+
get_capture_template_swept_center_frequency(self))
|
57
61
|
|
58
62
|
|
59
63
|
def _add_pvalidators(
|
60
64
|
self
|
61
65
|
) -> None:
|
62
66
|
self.add_pvalidator(Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
|
63
|
-
self
|
67
|
+
get_pvalidator_fixed_center_frequency(self))
|
64
68
|
self.add_pvalidator(Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
|
65
|
-
self
|
69
|
+
get_pvalidator_fixed_center_frequency(self))
|
66
70
|
self.add_pvalidator(Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
67
|
-
self
|
71
|
+
get_pvalidator_swept_center_frequency(self))
|
@@ -0,0 +1,174 @@
|
|
1
|
+
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
+
# This file is part of SPECTRE
|
3
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
+
|
5
|
+
from typing import Callable, overload
|
6
|
+
|
7
|
+
from spectre_core.capture_configs import (
|
8
|
+
CaptureTemplate, CaptureMode, Parameters, Bound, PName,
|
9
|
+
get_base_capture_template, get_base_ptemplate, OneOf,
|
10
|
+
validate_fixed_center_frequency, validate_swept_center_frequency
|
11
|
+
)
|
12
|
+
from .._base import BaseReceiver
|
13
|
+
from .._spec_names import SpecName
|
14
|
+
|
15
|
+
|
16
|
+
def get_pvalidator_fixed_center_frequency(
|
17
|
+
sdrplay_receiver: BaseReceiver
|
18
|
+
) -> Callable[[Parameters], None]:
|
19
|
+
def pvalidator(parameters: Parameters) -> None:
|
20
|
+
validate_fixed_center_frequency(parameters)
|
21
|
+
return pvalidator
|
22
|
+
|
23
|
+
|
24
|
+
def get_pvalidator_swept_center_frequency(
|
25
|
+
sdrplay_receiver: BaseReceiver
|
26
|
+
) -> Callable[[Parameters], None]:
|
27
|
+
def pvalidator(parameters: Parameters) -> None:
|
28
|
+
validate_swept_center_frequency(parameters,
|
29
|
+
sdrplay_receiver.get_spec(SpecName.API_RETUNING_LATENCY))
|
30
|
+
return pvalidator
|
31
|
+
|
32
|
+
|
33
|
+
def get_capture_template_fixed_center_frequency(
|
34
|
+
sdrplay_receiver: BaseReceiver
|
35
|
+
) -> CaptureTemplate:
|
36
|
+
|
37
|
+
capture_template = get_base_capture_template( CaptureMode.FIXED_CENTER_FREQUENCY )
|
38
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
|
39
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.IF_GAIN) )
|
40
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.RF_GAIN) )
|
41
|
+
|
42
|
+
capture_template.set_defaults(
|
43
|
+
(PName.BATCH_SIZE, 3.0),
|
44
|
+
(PName.CENTER_FREQUENCY, 95800000),
|
45
|
+
(PName.SAMPLE_RATE, 600000),
|
46
|
+
(PName.BANDWIDTH, 600000),
|
47
|
+
(PName.WINDOW_HOP, 512),
|
48
|
+
(PName.WINDOW_SIZE, 1024),
|
49
|
+
(PName.WINDOW_TYPE, "blackman"),
|
50
|
+
(PName.RF_GAIN, -30),
|
51
|
+
(PName.IF_GAIN, -30)
|
52
|
+
)
|
53
|
+
|
54
|
+
capture_template.add_pconstraint(
|
55
|
+
PName.CENTER_FREQUENCY,
|
56
|
+
[
|
57
|
+
Bound(
|
58
|
+
lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
59
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
60
|
+
)
|
61
|
+
]
|
62
|
+
)
|
63
|
+
capture_template.add_pconstraint(
|
64
|
+
PName.SAMPLE_RATE,
|
65
|
+
[
|
66
|
+
Bound(
|
67
|
+
lower_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
68
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
69
|
+
)
|
70
|
+
]
|
71
|
+
)
|
72
|
+
capture_template.add_pconstraint(
|
73
|
+
PName.BANDWIDTH,
|
74
|
+
[
|
75
|
+
OneOf(
|
76
|
+
sdrplay_receiver.get_spec( SpecName.BANDWIDTH_OPTIONS )
|
77
|
+
)
|
78
|
+
]
|
79
|
+
)
|
80
|
+
capture_template.add_pconstraint(
|
81
|
+
PName.IF_GAIN,
|
82
|
+
[
|
83
|
+
Bound(
|
84
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
|
85
|
+
)
|
86
|
+
]
|
87
|
+
)
|
88
|
+
capture_template.add_pconstraint(
|
89
|
+
PName.RF_GAIN,
|
90
|
+
[
|
91
|
+
Bound(
|
92
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
|
93
|
+
)
|
94
|
+
]
|
95
|
+
)
|
96
|
+
return capture_template
|
97
|
+
|
98
|
+
|
99
|
+
def get_capture_template_swept_center_frequency(
|
100
|
+
sdrplay_receiver: BaseReceiver
|
101
|
+
) -> CaptureTemplate:
|
102
|
+
|
103
|
+
capture_template = get_base_capture_template( CaptureMode.SWEPT_CENTER_FREQUENCY )
|
104
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
|
105
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.IF_GAIN) )
|
106
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.RF_GAIN) )
|
107
|
+
|
108
|
+
capture_template.set_defaults(
|
109
|
+
(PName.BATCH_SIZE, 4.0),
|
110
|
+
(PName.MIN_FREQUENCY, 95000000),
|
111
|
+
(PName.MAX_FREQUENCY, 100000000),
|
112
|
+
(PName.SAMPLES_PER_STEP, 80000),
|
113
|
+
(PName.FREQUENCY_STEP, 1536000),
|
114
|
+
(PName.SAMPLE_RATE, 1536000),
|
115
|
+
(PName.BANDWIDTH, 1536000),
|
116
|
+
(PName.WINDOW_HOP, 512),
|
117
|
+
(PName.WINDOW_SIZE, 1024),
|
118
|
+
(PName.WINDOW_TYPE, "blackman"),
|
119
|
+
(PName.RF_GAIN, -30),
|
120
|
+
(PName.IF_GAIN, -30)
|
121
|
+
)
|
122
|
+
|
123
|
+
capture_template.add_pconstraint(
|
124
|
+
PName.MIN_FREQUENCY,
|
125
|
+
[
|
126
|
+
Bound(
|
127
|
+
lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
128
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
129
|
+
)
|
130
|
+
]
|
131
|
+
)
|
132
|
+
capture_template.add_pconstraint(
|
133
|
+
PName.MAX_FREQUENCY,
|
134
|
+
[
|
135
|
+
Bound(
|
136
|
+
lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
137
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
138
|
+
)
|
139
|
+
]
|
140
|
+
)
|
141
|
+
capture_template.add_pconstraint(
|
142
|
+
PName.SAMPLE_RATE,
|
143
|
+
[
|
144
|
+
Bound(
|
145
|
+
lower_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
146
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
147
|
+
)
|
148
|
+
]
|
149
|
+
)
|
150
|
+
capture_template.add_pconstraint(
|
151
|
+
PName.BANDWIDTH,
|
152
|
+
[
|
153
|
+
OneOf(
|
154
|
+
sdrplay_receiver.get_spec( SpecName.BANDWIDTH_OPTIONS )
|
155
|
+
)
|
156
|
+
]
|
157
|
+
)
|
158
|
+
capture_template.add_pconstraint(
|
159
|
+
PName.IF_GAIN,
|
160
|
+
[
|
161
|
+
Bound(
|
162
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
|
163
|
+
)
|
164
|
+
]
|
165
|
+
)
|
166
|
+
capture_template.add_pconstraint(
|
167
|
+
PName.RF_GAIN,
|
168
|
+
[
|
169
|
+
Bound(
|
170
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
|
171
|
+
)
|
172
|
+
]
|
173
|
+
)
|
174
|
+
return capture_template
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
+
# This file is part of SPECTRE
|
3
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
+
|
5
|
+
from typing import Callable, overload
|
6
|
+
|
7
|
+
from spectre_core.capture_configs import (
|
8
|
+
CaptureTemplate, CaptureMode, Parameters, Bound, PName,
|
9
|
+
get_base_capture_template, get_base_ptemplate, OneOf,
|
10
|
+
validate_fixed_center_frequency, validate_swept_center_frequency
|
11
|
+
)
|
12
|
+
from .._base import BaseReceiver
|
13
|
+
from .._spec_names import SpecName
|
14
|
+
|
15
|
+
|
16
|
+
def get_pvalidator_fixed_center_frequency(
|
17
|
+
usrp_receiver: BaseReceiver
|
18
|
+
) -> Callable[[Parameters], None]:
|
19
|
+
def pvalidator(parameters: Parameters) -> None:
|
20
|
+
validate_fixed_center_frequency(parameters)
|
21
|
+
return pvalidator
|
22
|
+
|
23
|
+
|
24
|
+
def get_capture_template_fixed_center_frequency(
|
25
|
+
usrp_receiver: BaseReceiver
|
26
|
+
) -> CaptureTemplate:
|
27
|
+
|
28
|
+
capture_template = get_base_capture_template( CaptureMode.FIXED_CENTER_FREQUENCY )
|
29
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
|
30
|
+
capture_template.add_ptemplate( get_base_ptemplate(PName.NORMALISED_GAIN) )
|
31
|
+
|
32
|
+
capture_template.set_defaults(
|
33
|
+
(PName.BATCH_SIZE, 3.0),
|
34
|
+
(PName.CENTER_FREQUENCY, 95800000),
|
35
|
+
(PName.SAMPLE_RATE, 1000000),
|
36
|
+
(PName.BANDWIDTH, 1000000),
|
37
|
+
(PName.WINDOW_HOP, 512),
|
38
|
+
(PName.WINDOW_SIZE, 1024),
|
39
|
+
(PName.WINDOW_TYPE, "blackman"),
|
40
|
+
(PName.NORMALISED_GAIN, 0.3),
|
41
|
+
)
|
42
|
+
|
43
|
+
capture_template.add_pconstraint(
|
44
|
+
PName.CENTER_FREQUENCY,
|
45
|
+
[
|
46
|
+
Bound(
|
47
|
+
lower_bound=usrp_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
48
|
+
upper_bound=usrp_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
49
|
+
)
|
50
|
+
]
|
51
|
+
)
|
52
|
+
capture_template.add_pconstraint(
|
53
|
+
PName.SAMPLE_RATE,
|
54
|
+
[
|
55
|
+
Bound(
|
56
|
+
lower_bound=usrp_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
57
|
+
upper_bound=usrp_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
58
|
+
)
|
59
|
+
]
|
60
|
+
)
|
61
|
+
capture_template.add_pconstraint(
|
62
|
+
PName.BANDWIDTH,
|
63
|
+
[
|
64
|
+
Bound(
|
65
|
+
lower_bound=usrp_receiver.get_spec( SpecName.BANDWIDTH_LOWER_BOUND ),
|
66
|
+
upper_bound=usrp_receiver.get_spec( SpecName.BANDWIDTH_UPPER_BOUND )
|
67
|
+
)
|
68
|
+
]
|
69
|
+
)
|
70
|
+
return capture_template
|
@@ -1,17 +1,3 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
#
|
5
|
-
# SPDX-License-Identifier: GPL-3.0
|
6
|
-
#
|
7
|
-
# GNU Radio Python Flow Graph
|
8
|
-
# Title: Test receiver
|
9
|
-
# GNU Radio version: 3.10.1.1
|
10
|
-
|
11
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
12
|
-
# This file is part of SPECTRE
|
13
|
-
# SPDX-License-Identifier: GPL-3.0-or-later
|
14
|
-
|
15
1
|
#
|
16
2
|
# RSP1A receiver top blocks
|
17
3
|
#
|
@@ -145,4 +131,4 @@ class _swept_center_frequency(spectre_top_block):
|
|
145
131
|
@dataclass(frozen=True)
|
146
132
|
class CaptureMethod:
|
147
133
|
fixed_center_frequency = partial(capture, top_block_cls=_fixed_center_frequency)
|
148
|
-
swept_center_frequency = partial(capture, top_block_cls=_swept_center_frequency, max_noutput_items=1024)
|
134
|
+
swept_center_frequency = partial(capture, top_block_cls=_swept_center_frequency, max_noutput_items=1024)
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# USRP top blocks
|
3
|
+
#
|
4
|
+
|
5
|
+
from functools import partial
|
6
|
+
from dataclasses import dataclass
|
7
|
+
import time
|
8
|
+
|
9
|
+
from spectre_core.capture_configs import Parameters, PName
|
10
|
+
from spectre_core.config import get_batches_dir_path
|
11
|
+
from ._base import capture, spectre_top_block
|
12
|
+
|
13
|
+
|
14
|
+
class _fixed_center_frequency(spectre_top_block):
|
15
|
+
def flowgraph(
|
16
|
+
self,
|
17
|
+
tag: str,
|
18
|
+
parameters: Parameters
|
19
|
+
) -> None:
|
20
|
+
# OOT moudle inline imports
|
21
|
+
from gnuradio import spectre
|
22
|
+
from gnuradio import uhd
|
23
|
+
|
24
|
+
# Variables
|
25
|
+
sample_rate = parameters.get_parameter_value(PName.SAMPLE_RATE)
|
26
|
+
normalised_gain = parameters.get_parameter_value(PName.NORMALISED_GAIN)
|
27
|
+
center_freq = parameters.get_parameter_value(PName.CENTER_FREQUENCY)
|
28
|
+
batch_size = parameters.get_parameter_value(PName.BATCH_SIZE)
|
29
|
+
bandwidth = parameters.get_parameter_value(PName.BANDWIDTH)
|
30
|
+
|
31
|
+
# Blocks
|
32
|
+
self.uhd_usrp_source_0 = uhd.usrp_source(
|
33
|
+
",".join(("", '')),
|
34
|
+
uhd.stream_args(
|
35
|
+
cpu_format="fc32",
|
36
|
+
args='',
|
37
|
+
channels=list(range(0,1)),
|
38
|
+
),
|
39
|
+
)
|
40
|
+
self.uhd_usrp_source_0.set_samp_rate(sample_rate)
|
41
|
+
self.uhd_usrp_source_0.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS)
|
42
|
+
|
43
|
+
self.uhd_usrp_source_0.set_center_freq(center_freq, 0)
|
44
|
+
self.uhd_usrp_source_0.set_antenna("RX2", 0)
|
45
|
+
self.uhd_usrp_source_0.set_bandwidth(bandwidth, 0)
|
46
|
+
self.uhd_usrp_source_0.set_rx_agc(False, 0)
|
47
|
+
self.uhd_usrp_source_0.set_normalized_gain(normalised_gain, 0)
|
48
|
+
self.spectre_batched_file_sink_0 = spectre.batched_file_sink(get_batches_dir_path(),
|
49
|
+
tag,
|
50
|
+
batch_size,
|
51
|
+
sample_rate, False,
|
52
|
+
'freq',
|
53
|
+
0)
|
54
|
+
|
55
|
+
|
56
|
+
# Connections
|
57
|
+
self.connect((self.uhd_usrp_source_0, 0), (self.spectre_batched_file_sink_0, 0))
|
58
|
+
|
59
|
+
|
60
|
+
@dataclass(frozen=True)
|
61
|
+
class CaptureMethod:
|
62
|
+
fixed_center_frequency = partial(capture, top_block_cls=_fixed_center_frequency)
|
@@ -59,16 +59,19 @@ src/spectre_core/receivers/_factory.py
|
|
59
59
|
src/spectre_core/receivers/_register.py
|
60
60
|
src/spectre_core/receivers/_spec_names.py
|
61
61
|
src/spectre_core/receivers/plugins/__init__.py
|
62
|
+
src/spectre_core/receivers/plugins/_b200mini.py
|
62
63
|
src/spectre_core/receivers/plugins/_receiver_names.py
|
63
64
|
src/spectre_core/receivers/plugins/_rsp1a.py
|
64
65
|
src/spectre_core/receivers/plugins/_rspduo.py
|
65
66
|
src/spectre_core/receivers/plugins/_sdrplay_receiver.py
|
66
67
|
src/spectre_core/receivers/plugins/_test.py
|
68
|
+
src/spectre_core/receivers/plugins/_usrp.py
|
67
69
|
src/spectre_core/receivers/plugins/gr/__init__.py
|
68
70
|
src/spectre_core/receivers/plugins/gr/_base.py
|
69
71
|
src/spectre_core/receivers/plugins/gr/_rsp1a.py
|
70
72
|
src/spectre_core/receivers/plugins/gr/_rspduo.py
|
71
73
|
src/spectre_core/receivers/plugins/gr/_test.py
|
74
|
+
src/spectre_core/receivers/plugins/gr/_usrp.py
|
72
75
|
src/spectre_core/spectrograms/__init__.py
|
73
76
|
src/spectre_core/spectrograms/_analytical.py
|
74
77
|
src/spectre_core/spectrograms/_array_operations.py
|
@@ -1,190 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
-
# This file is part of SPECTRE
|
3
|
-
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
-
|
5
|
-
from typing import Callable, overload
|
6
|
-
|
7
|
-
from spectre_core.capture_configs import (
|
8
|
-
CaptureTemplate, CaptureMode, Parameters, Bound, PName,
|
9
|
-
get_base_capture_template, get_base_ptemplate, OneOf,
|
10
|
-
validate_fixed_center_frequency, validate_swept_center_frequency
|
11
|
-
)
|
12
|
-
from .._base import BaseReceiver
|
13
|
-
from .._spec_names import SpecName
|
14
|
-
|
15
|
-
class SDRPlayReceiver(BaseReceiver):
|
16
|
-
"""An abstract base class for SDRPlay receivers.
|
17
|
-
|
18
|
-
Includes ready-to-go pvalidators and capture templates which are shared by all subclasses.
|
19
|
-
Each subclasses must define the following hardware specifications:
|
20
|
-
|
21
|
-
.. code-block:: python
|
22
|
-
def _add_specs(self) -> None:
|
23
|
-
self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, <TBD> )
|
24
|
-
self.add_spec( SpecName.SAMPLE_RATE_UPPER_BOUND, <TBD> )
|
25
|
-
self.add_spec( SpecName.FREQUENCY_LOWER_BOUND , <TBD> )
|
26
|
-
self.add_spec( SpecName.FREQUENCY_UPPER_BOUND , <TBD> )
|
27
|
-
self.add_spec( SpecName.IF_GAIN_UPPER_BOUND , <TBD> )
|
28
|
-
self.add_spec( SpecName.RF_GAIN_UPPER_BOUND , <TBD> )
|
29
|
-
self.add_spec( SpecName.API_RETUNING_LATENCY , <TBD> )
|
30
|
-
self.add_spec( SpecName.BANDWIDTH_OPTIONS , <TBD> )
|
31
|
-
"""
|
32
|
-
def _get_pvalidator_fixed_center_frequency(
|
33
|
-
self
|
34
|
-
) -> Callable[[Parameters], None]:
|
35
|
-
def pvalidator(parameters: Parameters):
|
36
|
-
validate_fixed_center_frequency(parameters)
|
37
|
-
return pvalidator
|
38
|
-
|
39
|
-
|
40
|
-
def _get_pvalidator_swept_center_frequency(
|
41
|
-
self
|
42
|
-
) -> Callable[[Parameters], None]:
|
43
|
-
def pvalidator(parameters: Parameters):
|
44
|
-
validate_swept_center_frequency(parameters,
|
45
|
-
self.get_spec(SpecName.API_RETUNING_LATENCY))
|
46
|
-
return pvalidator
|
47
|
-
|
48
|
-
|
49
|
-
def _get_capture_template_fixed_center_frequency(
|
50
|
-
self
|
51
|
-
) -> CaptureTemplate:
|
52
|
-
|
53
|
-
capture_template = get_base_capture_template( CaptureMode.FIXED_CENTER_FREQUENCY )
|
54
|
-
capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
|
55
|
-
capture_template.add_ptemplate( get_base_ptemplate(PName.IF_GAIN) )
|
56
|
-
capture_template.add_ptemplate( get_base_ptemplate(PName.RF_GAIN) )
|
57
|
-
|
58
|
-
capture_template.set_defaults(
|
59
|
-
(PName.BATCH_SIZE, 3.0),
|
60
|
-
(PName.CENTER_FREQUENCY, 95800000),
|
61
|
-
(PName.SAMPLE_RATE, 600000),
|
62
|
-
(PName.BANDWIDTH, 600000),
|
63
|
-
(PName.WINDOW_HOP, 512),
|
64
|
-
(PName.WINDOW_SIZE, 1024),
|
65
|
-
(PName.WINDOW_TYPE, "blackman"),
|
66
|
-
(PName.RF_GAIN, -30),
|
67
|
-
(PName.IF_GAIN, -30)
|
68
|
-
)
|
69
|
-
|
70
|
-
capture_template.add_pconstraint(
|
71
|
-
PName.CENTER_FREQUENCY,
|
72
|
-
[
|
73
|
-
Bound(
|
74
|
-
lower_bound=self.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
75
|
-
upper_bound=self.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
76
|
-
)
|
77
|
-
]
|
78
|
-
)
|
79
|
-
capture_template.add_pconstraint(
|
80
|
-
PName.SAMPLE_RATE,
|
81
|
-
[
|
82
|
-
Bound(
|
83
|
-
lower_bound=self.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
84
|
-
upper_bound=self.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
85
|
-
)
|
86
|
-
]
|
87
|
-
)
|
88
|
-
capture_template.add_pconstraint(
|
89
|
-
PName.BANDWIDTH,
|
90
|
-
[
|
91
|
-
OneOf(
|
92
|
-
self.get_spec( SpecName.BANDWIDTH_OPTIONS )
|
93
|
-
)
|
94
|
-
]
|
95
|
-
)
|
96
|
-
capture_template.add_pconstraint(
|
97
|
-
PName.IF_GAIN,
|
98
|
-
[
|
99
|
-
Bound(
|
100
|
-
upper_bound=self.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
|
101
|
-
)
|
102
|
-
]
|
103
|
-
)
|
104
|
-
capture_template.add_pconstraint(
|
105
|
-
PName.RF_GAIN,
|
106
|
-
[
|
107
|
-
Bound(
|
108
|
-
upper_bound=self.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
|
109
|
-
)
|
110
|
-
]
|
111
|
-
)
|
112
|
-
return capture_template
|
113
|
-
|
114
|
-
|
115
|
-
def _get_capture_template_swept_center_frequency(
|
116
|
-
self
|
117
|
-
) -> CaptureTemplate:
|
118
|
-
|
119
|
-
capture_template = get_base_capture_template( CaptureMode.SWEPT_CENTER_FREQUENCY )
|
120
|
-
capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
|
121
|
-
capture_template.add_ptemplate( get_base_ptemplate(PName.IF_GAIN) )
|
122
|
-
capture_template.add_ptemplate( get_base_ptemplate(PName.RF_GAIN) )
|
123
|
-
|
124
|
-
capture_template.set_defaults(
|
125
|
-
(PName.BATCH_SIZE, 4.0),
|
126
|
-
(PName.MIN_FREQUENCY, 95000000),
|
127
|
-
(PName.MAX_FREQUENCY, 100000000),
|
128
|
-
(PName.SAMPLES_PER_STEP, 80000),
|
129
|
-
(PName.FREQUENCY_STEP, 1536000),
|
130
|
-
(PName.SAMPLE_RATE, 1536000),
|
131
|
-
(PName.BANDWIDTH, 1536000),
|
132
|
-
(PName.WINDOW_HOP, 512),
|
133
|
-
(PName.WINDOW_SIZE, 1024),
|
134
|
-
(PName.WINDOW_TYPE, "blackman"),
|
135
|
-
(PName.RF_GAIN, -30),
|
136
|
-
(PName.IF_GAIN, -30)
|
137
|
-
)
|
138
|
-
|
139
|
-
capture_template.add_pconstraint(
|
140
|
-
PName.MIN_FREQUENCY,
|
141
|
-
[
|
142
|
-
Bound(
|
143
|
-
lower_bound=self.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
144
|
-
upper_bound=self.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
145
|
-
)
|
146
|
-
]
|
147
|
-
)
|
148
|
-
capture_template.add_pconstraint(
|
149
|
-
PName.MAX_FREQUENCY,
|
150
|
-
[
|
151
|
-
Bound(
|
152
|
-
lower_bound=self.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
153
|
-
upper_bound=self.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
154
|
-
)
|
155
|
-
]
|
156
|
-
)
|
157
|
-
capture_template.add_pconstraint(
|
158
|
-
PName.SAMPLE_RATE,
|
159
|
-
[
|
160
|
-
Bound(
|
161
|
-
lower_bound=self.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
162
|
-
upper_bound=self.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
163
|
-
)
|
164
|
-
]
|
165
|
-
)
|
166
|
-
capture_template.add_pconstraint(
|
167
|
-
PName.BANDWIDTH,
|
168
|
-
[
|
169
|
-
OneOf(
|
170
|
-
self.get_spec( SpecName.BANDWIDTH_OPTIONS )
|
171
|
-
)
|
172
|
-
]
|
173
|
-
)
|
174
|
-
capture_template.add_pconstraint(
|
175
|
-
PName.IF_GAIN,
|
176
|
-
[
|
177
|
-
Bound(
|
178
|
-
upper_bound=self.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
|
179
|
-
)
|
180
|
-
]
|
181
|
-
)
|
182
|
-
capture_template.add_pconstraint(
|
183
|
-
PName.RF_GAIN,
|
184
|
-
[
|
185
|
-
Bound(
|
186
|
-
upper_bound=self.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
|
187
|
-
)
|
188
|
-
]
|
189
|
-
)
|
190
|
-
return capture_template
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_capture_config.py
RENAMED
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_capture_modes.py
RENAMED
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_capture_templates.py
RENAMED
File without changes
|
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_pconstraints.py
RENAMED
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/capture_configs/_pvalidators.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/post_processing/_post_processor.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/__init__.py
RENAMED
File without changes
|
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/receivers/plugins/gr/_rspduo.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spectre_core-0.0.14 → spectre_core-0.0.15}/src/spectre_core/spectrograms/_array_operations.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|