spectre-core 0.0.22__py3-none-any.whl → 0.0.23__py3-none-any.whl
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/_file_io/__init__.py +4 -4
- spectre_core/_file_io/file_handlers.py +60 -106
- spectre_core/batches/__init__.py +20 -3
- spectre_core/batches/_base.py +85 -134
- spectre_core/batches/_batches.py +55 -99
- spectre_core/batches/_factory.py +21 -20
- spectre_core/batches/_register.py +8 -8
- spectre_core/batches/plugins/_batch_keys.py +7 -6
- spectre_core/batches/plugins/_callisto.py +65 -97
- spectre_core/batches/plugins/_iq_stream.py +105 -169
- spectre_core/capture_configs/__init__.py +46 -17
- spectre_core/capture_configs/_capture_config.py +25 -52
- spectre_core/capture_configs/_capture_modes.py +8 -6
- spectre_core/capture_configs/_capture_templates.py +50 -110
- spectre_core/capture_configs/_parameters.py +37 -74
- spectre_core/capture_configs/_pconstraints.py +40 -40
- spectre_core/capture_configs/_pnames.py +36 -34
- spectre_core/capture_configs/_ptemplates.py +260 -347
- spectre_core/capture_configs/_pvalidators.py +99 -102
- spectre_core/config/__init__.py +13 -8
- spectre_core/config/_paths.py +18 -35
- spectre_core/config/_time_formats.py +6 -5
- spectre_core/exceptions.py +38 -0
- spectre_core/jobs/__init__.py +3 -6
- spectre_core/jobs/_duration.py +12 -0
- spectre_core/jobs/_jobs.py +72 -43
- spectre_core/jobs/_workers.py +55 -105
- spectre_core/logs/__init__.py +7 -2
- spectre_core/logs/_configure.py +13 -17
- spectre_core/logs/_decorators.py +6 -4
- spectre_core/logs/_logs.py +37 -89
- spectre_core/logs/_process_types.py +5 -3
- spectre_core/plotting/__init__.py +13 -3
- spectre_core/plotting/_base.py +64 -138
- spectre_core/plotting/_format.py +10 -8
- spectre_core/plotting/_panel_names.py +7 -5
- spectre_core/plotting/_panel_stack.py +82 -115
- spectre_core/plotting/_panels.py +120 -155
- spectre_core/post_processing/__init__.py +6 -3
- spectre_core/post_processing/_base.py +41 -55
- spectre_core/post_processing/_factory.py +14 -11
- spectre_core/post_processing/_post_processor.py +16 -12
- spectre_core/post_processing/_register.py +10 -7
- spectre_core/post_processing/plugins/_event_handler_keys.py +4 -3
- spectre_core/post_processing/plugins/_fixed_center_frequency.py +54 -47
- spectre_core/post_processing/plugins/_swept_center_frequency.py +199 -174
- spectre_core/receivers/__init__.py +9 -2
- spectre_core/receivers/_base.py +82 -148
- spectre_core/receivers/_factory.py +20 -30
- spectre_core/receivers/_register.py +7 -10
- spectre_core/receivers/_spec_names.py +17 -15
- spectre_core/receivers/plugins/_b200mini.py +47 -60
- spectre_core/receivers/plugins/_receiver_names.py +8 -6
- spectre_core/receivers/plugins/_rsp1a.py +44 -40
- spectre_core/receivers/plugins/_rspduo.py +59 -44
- spectre_core/receivers/plugins/_sdrplay_receiver.py +67 -83
- spectre_core/receivers/plugins/_test.py +136 -129
- spectre_core/receivers/plugins/_usrp.py +93 -85
- spectre_core/receivers/plugins/gr/__init__.py +1 -1
- spectre_core/receivers/plugins/gr/_base.py +14 -22
- spectre_core/receivers/plugins/gr/_rsp1a.py +53 -60
- spectre_core/receivers/plugins/gr/_rspduo.py +77 -89
- spectre_core/receivers/plugins/gr/_test.py +49 -57
- spectre_core/receivers/plugins/gr/_usrp.py +61 -59
- spectre_core/spectrograms/__init__.py +21 -13
- spectre_core/spectrograms/_analytical.py +108 -99
- spectre_core/spectrograms/_array_operations.py +39 -46
- spectre_core/spectrograms/_spectrogram.py +289 -322
- spectre_core/spectrograms/_transform.py +106 -73
- spectre_core/wgetting/__init__.py +1 -3
- spectre_core/wgetting/_callisto.py +87 -93
- {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/METADATA +9 -23
- spectre_core-0.0.23.dist-info/RECORD +79 -0
- {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/WHEEL +1 -1
- spectre_core-0.0.22.dist-info/RECORD +0 -78
- {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/licenses/LICENSE +0 -0
- {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/top_level.txt +0 -0
@@ -4,15 +4,17 @@
|
|
4
4
|
|
5
5
|
from enum import Enum
|
6
6
|
|
7
|
-
|
7
|
+
|
8
|
+
class ReceiverName(Enum):
|
8
9
|
"""A `spectre` supported receiver.
|
9
|
-
|
10
|
+
|
10
11
|
:ivar RSP1A: SDRPlay RSP1A
|
11
12
|
:ivar RSPDUO: SDRPlay RSPduo
|
12
13
|
:ivar TEST: `spectre` test receiver.
|
13
14
|
:ivar B200MINI: USRP B200mini.
|
14
15
|
"""
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
|
17
|
+
RSP1A = "rsp1a"
|
18
|
+
RSPDUO = "rspduo"
|
19
|
+
TEST = "test"
|
20
|
+
B200MINI = "b200mini"
|
@@ -7,59 +7,63 @@ from dataclasses import dataclass
|
|
7
7
|
from ._receiver_names import ReceiverName
|
8
8
|
from .gr._rsp1a import CaptureMethod
|
9
9
|
from ._sdrplay_receiver import (
|
10
|
-
get_pvalidator_fixed_center_frequency,
|
11
|
-
|
10
|
+
get_pvalidator_fixed_center_frequency,
|
11
|
+
get_pvalidator_swept_center_frequency,
|
12
|
+
get_capture_template_fixed_center_frequency,
|
13
|
+
get_capture_template_swept_center_frequency,
|
12
14
|
)
|
13
15
|
from .._spec_names import SpecName
|
14
16
|
from .._base import BaseReceiver
|
15
17
|
from .._register import register_receiver
|
16
18
|
|
19
|
+
|
17
20
|
@dataclass(frozen=True)
|
18
21
|
class Mode:
|
19
22
|
"""An operating mode for the `RSP1A` receiver."""
|
20
|
-
|
21
|
-
|
23
|
+
|
24
|
+
FIXED_CENTER_FREQUENCY = "fixed_center_frequency"
|
25
|
+
SWEPT_CENTER_FREQUENCY = "swept_center_frequency"
|
22
26
|
|
23
27
|
|
24
28
|
@register_receiver(ReceiverName.RSP1A)
|
25
29
|
class RSP1A(BaseReceiver):
|
26
30
|
"""Receiver implementation for the SDRPlay RSP1A (https://www.sdrplay.com/rsp1a/)"""
|
27
|
-
def _add_specs(
|
28
|
-
self
|
29
|
-
) -> None:
|
30
|
-
self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3 )
|
31
|
-
self.add_spec( SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6 )
|
32
|
-
self.add_spec( SpecName.FREQUENCY_LOWER_BOUND , 1e3 )
|
33
|
-
self.add_spec( SpecName.FREQUENCY_UPPER_BOUND , 2e9 )
|
34
|
-
self.add_spec( SpecName.IF_GAIN_UPPER_BOUND , -20 )
|
35
|
-
self.add_spec( SpecName.RF_GAIN_UPPER_BOUND , 0 )
|
36
|
-
self.add_spec( SpecName.API_RETUNING_LATENCY , 50 * 1e-3 )
|
37
|
-
self.add_spec( SpecName.BANDWIDTH_OPTIONS,
|
38
|
-
[200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000])
|
39
31
|
|
32
|
+
def _add_specs(self) -> None:
|
33
|
+
self.add_spec(SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3)
|
34
|
+
self.add_spec(SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6)
|
35
|
+
self.add_spec(SpecName.FREQUENCY_LOWER_BOUND, 1e3)
|
36
|
+
self.add_spec(SpecName.FREQUENCY_UPPER_BOUND, 2e9)
|
37
|
+
self.add_spec(SpecName.IF_GAIN_UPPER_BOUND, -20)
|
38
|
+
self.add_spec(SpecName.RF_GAIN_UPPER_BOUND, 0)
|
39
|
+
self.add_spec(SpecName.API_RETUNING_LATENCY, 25 * 1e-3)
|
40
|
+
self.add_spec(
|
41
|
+
SpecName.BANDWIDTH_OPTIONS,
|
42
|
+
[200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000],
|
43
|
+
)
|
44
|
+
|
45
|
+
def _add_capture_methods(self) -> None:
|
46
|
+
self.add_capture_method(
|
47
|
+
Mode.FIXED_CENTER_FREQUENCY, CaptureMethod.fixed_center_frequency
|
48
|
+
)
|
49
|
+
self.add_capture_method(
|
50
|
+
Mode.SWEPT_CENTER_FREQUENCY, CaptureMethod.swept_center_frequency
|
51
|
+
)
|
40
52
|
|
41
|
-
def
|
42
|
-
self
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
self.
|
47
|
-
|
48
|
-
|
53
|
+
def _add_capture_templates(self) -> None:
|
54
|
+
self.add_capture_template(
|
55
|
+
Mode.FIXED_CENTER_FREQUENCY,
|
56
|
+
get_capture_template_fixed_center_frequency(self),
|
57
|
+
)
|
58
|
+
self.add_capture_template(
|
59
|
+
Mode.SWEPT_CENTER_FREQUENCY,
|
60
|
+
get_capture_template_swept_center_frequency(self),
|
61
|
+
)
|
49
62
|
|
50
|
-
def
|
51
|
-
self
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
def _add_pvalidators(
|
60
|
-
self
|
61
|
-
) -> None:
|
62
|
-
self.add_pvalidator(Mode.FIXED_CENTER_FREQUENCY,
|
63
|
-
get_pvalidator_fixed_center_frequency(self))
|
64
|
-
self.add_pvalidator(Mode.SWEPT_CENTER_FREQUENCY,
|
65
|
-
get_pvalidator_swept_center_frequency(self))
|
63
|
+
def _add_pvalidators(self) -> None:
|
64
|
+
self.add_pvalidator(
|
65
|
+
Mode.FIXED_CENTER_FREQUENCY, get_pvalidator_fixed_center_frequency(self)
|
66
|
+
)
|
67
|
+
self.add_pvalidator(
|
68
|
+
Mode.SWEPT_CENTER_FREQUENCY, get_pvalidator_swept_center_frequency(self)
|
69
|
+
)
|
@@ -8,8 +8,10 @@ from ._receiver_names import ReceiverName
|
|
8
8
|
from .gr._rspduo import CaptureMethod
|
9
9
|
from .._spec_names import SpecName
|
10
10
|
from ._sdrplay_receiver import (
|
11
|
-
get_pvalidator_fixed_center_frequency,
|
12
|
-
|
11
|
+
get_pvalidator_fixed_center_frequency,
|
12
|
+
get_pvalidator_swept_center_frequency,
|
13
|
+
get_capture_template_fixed_center_frequency,
|
14
|
+
get_capture_template_swept_center_frequency,
|
13
15
|
)
|
14
16
|
from .._base import BaseReceiver
|
15
17
|
from .._register import register_receiver
|
@@ -18,54 +20,67 @@ from .._register import register_receiver
|
|
18
20
|
@dataclass
|
19
21
|
class Mode:
|
20
22
|
"""An operating mode for the `RSPduo` receiver."""
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
|
24
|
+
TUNER_1_FIXED_CENTER_FREQUENCY = f"tuner_1_fixed_center_frequency"
|
25
|
+
TUNER_2_FIXED_CENTER_FREQUENCY = f"tuner_2_fixed_center_frequency"
|
26
|
+
TUNER_1_SWEPT_CENTER_FREQUENCY = f"tuner_1_swept_center_frequency"
|
24
27
|
|
25
28
|
|
26
29
|
@register_receiver(ReceiverName.RSPDUO)
|
27
30
|
class RSPduo(BaseReceiver):
|
28
31
|
"""Receiver implementation for the SDRPlay RSPduo (https://www.sdrplay.com/rspduo/)"""
|
32
|
+
|
29
33
|
def _add_specs(self) -> None:
|
30
|
-
self.add_spec(
|
31
|
-
self.add_spec(
|
32
|
-
self.add_spec(
|
33
|
-
self.add_spec(
|
34
|
-
self.add_spec(
|
35
|
-
self.add_spec(
|
36
|
-
self.add_spec(
|
37
|
-
self.add_spec(
|
38
|
-
|
34
|
+
self.add_spec(SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3)
|
35
|
+
self.add_spec(SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6)
|
36
|
+
self.add_spec(SpecName.FREQUENCY_LOWER_BOUND, 1e3)
|
37
|
+
self.add_spec(SpecName.FREQUENCY_UPPER_BOUND, 2e9)
|
38
|
+
self.add_spec(SpecName.IF_GAIN_UPPER_BOUND, -20)
|
39
|
+
self.add_spec(SpecName.RF_GAIN_UPPER_BOUND, 0)
|
40
|
+
self.add_spec(SpecName.API_RETUNING_LATENCY, 50 * 1e-3)
|
41
|
+
self.add_spec(
|
42
|
+
SpecName.BANDWIDTH_OPTIONS,
|
43
|
+
[200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000],
|
44
|
+
)
|
39
45
|
|
46
|
+
def _add_capture_methods(self) -> None:
|
47
|
+
self.add_capture_method(
|
48
|
+
Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
|
49
|
+
CaptureMethod.tuner_1_fixed_center_frequency,
|
50
|
+
)
|
51
|
+
self.add_capture_method(
|
52
|
+
Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
|
53
|
+
CaptureMethod.tuner_2_fixed_center_frequency,
|
54
|
+
)
|
55
|
+
self.add_capture_method(
|
56
|
+
Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
57
|
+
CaptureMethod.tuner_1_swept_center_frequency,
|
58
|
+
)
|
40
59
|
|
41
|
-
def
|
42
|
-
self
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
self.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
60
|
+
def _add_capture_templates(self) -> None:
|
61
|
+
self.add_capture_template(
|
62
|
+
Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
|
63
|
+
get_capture_template_fixed_center_frequency(self),
|
64
|
+
)
|
65
|
+
self.add_capture_template(
|
66
|
+
Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
|
67
|
+
get_capture_template_fixed_center_frequency(self),
|
68
|
+
)
|
69
|
+
self.add_capture_template(
|
70
|
+
Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
71
|
+
get_capture_template_swept_center_frequency(self),
|
72
|
+
)
|
51
73
|
|
52
|
-
def
|
53
|
-
self
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
self.
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
) -> None:
|
66
|
-
self.add_pvalidator(Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
|
67
|
-
get_pvalidator_fixed_center_frequency(self))
|
68
|
-
self.add_pvalidator(Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
|
69
|
-
get_pvalidator_fixed_center_frequency(self))
|
70
|
-
self.add_pvalidator(Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
71
|
-
get_pvalidator_swept_center_frequency(self))
|
74
|
+
def _add_pvalidators(self) -> None:
|
75
|
+
self.add_pvalidator(
|
76
|
+
Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
|
77
|
+
get_pvalidator_fixed_center_frequency(self),
|
78
|
+
)
|
79
|
+
self.add_pvalidator(
|
80
|
+
Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
|
81
|
+
get_pvalidator_fixed_center_frequency(self),
|
82
|
+
)
|
83
|
+
self.add_pvalidator(
|
84
|
+
Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
85
|
+
get_pvalidator_swept_center_frequency(self),
|
86
|
+
)
|
@@ -5,170 +5,154 @@
|
|
5
5
|
from typing import Callable, overload
|
6
6
|
|
7
7
|
from spectre_core.capture_configs import (
|
8
|
-
CaptureTemplate,
|
9
|
-
|
10
|
-
|
8
|
+
CaptureTemplate,
|
9
|
+
CaptureMode,
|
10
|
+
Parameters,
|
11
|
+
Bound,
|
12
|
+
PName,
|
13
|
+
get_base_capture_template,
|
14
|
+
get_base_ptemplate,
|
15
|
+
OneOf,
|
16
|
+
validate_fixed_center_frequency,
|
17
|
+
validate_swept_center_frequency,
|
11
18
|
)
|
12
19
|
from .._base import BaseReceiver
|
13
20
|
from .._spec_names import SpecName
|
14
21
|
|
15
22
|
|
16
23
|
def get_pvalidator_fixed_center_frequency(
|
17
|
-
sdrplay_receiver: BaseReceiver
|
24
|
+
sdrplay_receiver: BaseReceiver,
|
18
25
|
) -> Callable[[Parameters], None]:
|
19
26
|
def pvalidator(parameters: Parameters) -> None:
|
20
27
|
validate_fixed_center_frequency(parameters)
|
28
|
+
|
21
29
|
return pvalidator
|
22
30
|
|
23
31
|
|
24
32
|
def get_pvalidator_swept_center_frequency(
|
25
|
-
sdrplay_receiver: BaseReceiver
|
33
|
+
sdrplay_receiver: BaseReceiver,
|
26
34
|
) -> Callable[[Parameters], None]:
|
27
35
|
def pvalidator(parameters: Parameters) -> None:
|
28
|
-
validate_swept_center_frequency(
|
29
|
-
|
36
|
+
validate_swept_center_frequency(
|
37
|
+
parameters, sdrplay_receiver.get_spec(SpecName.API_RETUNING_LATENCY)
|
38
|
+
)
|
39
|
+
|
30
40
|
return pvalidator
|
31
41
|
|
32
42
|
|
33
43
|
def get_capture_template_fixed_center_frequency(
|
34
|
-
sdrplay_receiver: BaseReceiver
|
44
|
+
sdrplay_receiver: BaseReceiver,
|
35
45
|
) -> CaptureTemplate:
|
36
|
-
|
37
|
-
capture_template = get_base_capture_template(
|
38
|
-
capture_template.add_ptemplate(
|
39
|
-
capture_template.add_ptemplate(
|
40
|
-
capture_template.add_ptemplate(
|
46
|
+
|
47
|
+
capture_template = get_base_capture_template(CaptureMode.FIXED_CENTER_FREQUENCY)
|
48
|
+
capture_template.add_ptemplate(get_base_ptemplate(PName.BANDWIDTH))
|
49
|
+
capture_template.add_ptemplate(get_base_ptemplate(PName.IF_GAIN))
|
50
|
+
capture_template.add_ptemplate(get_base_ptemplate(PName.RF_GAIN))
|
41
51
|
|
42
52
|
capture_template.set_defaults(
|
43
|
-
(PName.BATCH_SIZE,
|
44
|
-
(PName.CENTER_FREQUENCY,
|
45
|
-
(PName.SAMPLE_RATE,
|
46
|
-
(PName.BANDWIDTH,
|
47
|
-
(PName.WINDOW_HOP,
|
48
|
-
(PName.WINDOW_SIZE,
|
49
|
-
(PName.WINDOW_TYPE,
|
50
|
-
(PName.RF_GAIN,
|
51
|
-
(PName.IF_GAIN,
|
52
|
-
)
|
53
|
+
(PName.BATCH_SIZE, 3.0),
|
54
|
+
(PName.CENTER_FREQUENCY, 95800000),
|
55
|
+
(PName.SAMPLE_RATE, 600000),
|
56
|
+
(PName.BANDWIDTH, 600000),
|
57
|
+
(PName.WINDOW_HOP, 512),
|
58
|
+
(PName.WINDOW_SIZE, 1024),
|
59
|
+
(PName.WINDOW_TYPE, "blackman"),
|
60
|
+
(PName.RF_GAIN, -30),
|
61
|
+
(PName.IF_GAIN, -30),
|
62
|
+
)
|
53
63
|
|
54
64
|
capture_template.add_pconstraint(
|
55
65
|
PName.CENTER_FREQUENCY,
|
56
66
|
[
|
57
67
|
Bound(
|
58
68
|
lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
59
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
69
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND),
|
60
70
|
)
|
61
|
-
]
|
71
|
+
],
|
62
72
|
)
|
63
73
|
capture_template.add_pconstraint(
|
64
74
|
PName.SAMPLE_RATE,
|
65
75
|
[
|
66
76
|
Bound(
|
67
77
|
lower_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
68
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
78
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND),
|
69
79
|
)
|
70
|
-
]
|
80
|
+
],
|
71
81
|
)
|
72
82
|
capture_template.add_pconstraint(
|
73
|
-
PName.BANDWIDTH,
|
74
|
-
[
|
75
|
-
OneOf(
|
76
|
-
sdrplay_receiver.get_spec( SpecName.BANDWIDTH_OPTIONS )
|
77
|
-
)
|
78
|
-
]
|
83
|
+
PName.BANDWIDTH, [OneOf(sdrplay_receiver.get_spec(SpecName.BANDWIDTH_OPTIONS))]
|
79
84
|
)
|
80
85
|
capture_template.add_pconstraint(
|
81
86
|
PName.IF_GAIN,
|
82
|
-
[
|
83
|
-
Bound(
|
84
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
|
85
|
-
)
|
86
|
-
]
|
87
|
+
[Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND))],
|
87
88
|
)
|
88
89
|
capture_template.add_pconstraint(
|
89
90
|
PName.RF_GAIN,
|
90
|
-
[
|
91
|
-
Bound(
|
92
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
|
93
|
-
)
|
94
|
-
]
|
91
|
+
[Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND))],
|
95
92
|
)
|
96
93
|
return capture_template
|
97
94
|
|
98
95
|
|
99
96
|
def get_capture_template_swept_center_frequency(
|
100
|
-
sdrplay_receiver: BaseReceiver
|
97
|
+
sdrplay_receiver: BaseReceiver,
|
101
98
|
) -> CaptureTemplate:
|
102
99
|
|
103
|
-
capture_template = get_base_capture_template(
|
104
|
-
capture_template.add_ptemplate(
|
105
|
-
capture_template.add_ptemplate(
|
106
|
-
capture_template.add_ptemplate(
|
100
|
+
capture_template = get_base_capture_template(CaptureMode.SWEPT_CENTER_FREQUENCY)
|
101
|
+
capture_template.add_ptemplate(get_base_ptemplate(PName.BANDWIDTH))
|
102
|
+
capture_template.add_ptemplate(get_base_ptemplate(PName.IF_GAIN))
|
103
|
+
capture_template.add_ptemplate(get_base_ptemplate(PName.RF_GAIN))
|
107
104
|
|
108
105
|
capture_template.set_defaults(
|
109
|
-
(PName.BATCH_SIZE,
|
110
|
-
(PName.MIN_FREQUENCY,
|
111
|
-
(PName.MAX_FREQUENCY,
|
112
|
-
(PName.SAMPLES_PER_STEP,
|
113
|
-
(PName.FREQUENCY_STEP,
|
114
|
-
(PName.SAMPLE_RATE,
|
115
|
-
(PName.BANDWIDTH,
|
116
|
-
(PName.WINDOW_HOP,
|
117
|
-
(PName.WINDOW_SIZE,
|
118
|
-
(PName.WINDOW_TYPE,
|
119
|
-
(PName.RF_GAIN,
|
120
|
-
(PName.IF_GAIN,
|
121
|
-
)
|
106
|
+
(PName.BATCH_SIZE, 4.0),
|
107
|
+
(PName.MIN_FREQUENCY, 95000000),
|
108
|
+
(PName.MAX_FREQUENCY, 100000000),
|
109
|
+
(PName.SAMPLES_PER_STEP, 80000),
|
110
|
+
(PName.FREQUENCY_STEP, 1536000),
|
111
|
+
(PName.SAMPLE_RATE, 1536000),
|
112
|
+
(PName.BANDWIDTH, 1536000),
|
113
|
+
(PName.WINDOW_HOP, 512),
|
114
|
+
(PName.WINDOW_SIZE, 1024),
|
115
|
+
(PName.WINDOW_TYPE, "blackman"),
|
116
|
+
(PName.RF_GAIN, -30),
|
117
|
+
(PName.IF_GAIN, -30),
|
118
|
+
)
|
122
119
|
|
123
120
|
capture_template.add_pconstraint(
|
124
121
|
PName.MIN_FREQUENCY,
|
125
122
|
[
|
126
123
|
Bound(
|
127
124
|
lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
128
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
125
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND),
|
129
126
|
)
|
130
|
-
]
|
127
|
+
],
|
131
128
|
)
|
132
129
|
capture_template.add_pconstraint(
|
133
130
|
PName.MAX_FREQUENCY,
|
134
131
|
[
|
135
132
|
Bound(
|
136
133
|
lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
|
137
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
|
134
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND),
|
138
135
|
)
|
139
|
-
]
|
136
|
+
],
|
140
137
|
)
|
141
138
|
capture_template.add_pconstraint(
|
142
139
|
PName.SAMPLE_RATE,
|
143
140
|
[
|
144
141
|
Bound(
|
145
142
|
lower_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
|
146
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
|
143
|
+
upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND),
|
147
144
|
)
|
148
|
-
]
|
145
|
+
],
|
149
146
|
)
|
150
147
|
capture_template.add_pconstraint(
|
151
|
-
PName.BANDWIDTH,
|
152
|
-
[
|
153
|
-
OneOf(
|
154
|
-
sdrplay_receiver.get_spec( SpecName.BANDWIDTH_OPTIONS )
|
155
|
-
)
|
156
|
-
]
|
148
|
+
PName.BANDWIDTH, [OneOf(sdrplay_receiver.get_spec(SpecName.BANDWIDTH_OPTIONS))]
|
157
149
|
)
|
158
150
|
capture_template.add_pconstraint(
|
159
151
|
PName.IF_GAIN,
|
160
|
-
[
|
161
|
-
Bound(
|
162
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
|
163
|
-
)
|
164
|
-
]
|
152
|
+
[Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND))],
|
165
153
|
)
|
166
154
|
capture_template.add_pconstraint(
|
167
155
|
PName.RF_GAIN,
|
168
|
-
[
|
169
|
-
Bound(
|
170
|
-
upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
|
171
|
-
)
|
172
|
-
]
|
156
|
+
[Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND))],
|
173
157
|
)
|
174
158
|
return capture_template
|