spectre-core 0.0.6__tar.gz → 0.0.8__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.
Files changed (79) hide show
  1. {spectre_core-0.0.6 → spectre_core-0.0.8}/PKG-INFO +2 -2
  2. {spectre_core-0.0.6 → spectre_core-0.0.8}/README.md +1 -1
  3. {spectre_core-0.0.6 → spectre_core-0.0.8}/pyproject.toml +1 -1
  4. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/panel_stack.py +2 -5
  5. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/base.py +4 -4
  6. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rspduo/gr/tuner_1_fixed.py +6 -2
  7. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rspduo/gr/tuner_1_sweep.py +8 -12
  8. spectre_core-0.0.8/src/spectre_core/receivers/library/rspduo/gr/tuner_2_fixed.py +120 -0
  9. spectre_core-0.0.8/src/spectre_core/receivers/library/rspduo/gr/tuner_2_sweep.py +119 -0
  10. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rspduo/receiver.py +34 -5
  11. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/test/receiver.py +32 -28
  12. spectre_core-0.0.6/src/spectre_core/watchdog/watcher.py → spectre_core-0.0.8/src/spectre_core/watchdog/post_processor.py +2 -2
  13. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core.egg-info/PKG-INFO +2 -2
  14. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core.egg-info/SOURCES.txt +3 -1
  15. {spectre_core-0.0.6 → spectre_core-0.0.8}/LICENSE +0 -0
  16. {spectre_core-0.0.6 → spectre_core-0.0.8}/setup.cfg +0 -0
  17. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/__init__.py +0 -0
  18. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/cfg.py +0 -0
  19. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/__init__.py +0 -0
  20. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/base.py +0 -0
  21. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/chunk_register.py +0 -0
  22. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/factory.py +0 -0
  23. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/__init__.py +0 -0
  24. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/callisto/__init__.py +0 -0
  25. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/callisto/chunk.py +0 -0
  26. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/fixed/__init__.py +0 -0
  27. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/fixed/chunk.py +0 -0
  28. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/sweep/__init__.py +0 -0
  29. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/chunks/library/sweep/chunk.py +0 -0
  30. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/dynamic_imports.py +0 -0
  31. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/exceptions.py +0 -0
  32. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/file_handlers/base.py +0 -0
  33. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/file_handlers/configs.py +0 -0
  34. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/file_handlers/json.py +0 -0
  35. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/file_handlers/text.py +0 -0
  36. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/logging.py +0 -0
  37. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/__init__.py +0 -0
  38. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/base.py +0 -0
  39. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/factory.py +0 -0
  40. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/format.py +0 -0
  41. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/library/__init__.py +0 -0
  42. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/library/frequency_cuts/panel.py +0 -0
  43. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/library/integral_over_frequency/panel.py +0 -0
  44. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/library/spectrogram/panel.py +0 -0
  45. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/library/time_cuts/panel.py +0 -0
  46. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/plotting/panel_register.py +0 -0
  47. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/__init__.py +0 -0
  48. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/factory.py +0 -0
  49. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/__init__.py +0 -0
  50. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rsp1a/__init__.py +0 -0
  51. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rsp1a/gr/__init__.py +0 -0
  52. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rsp1a/gr/fixed.py +0 -0
  53. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rsp1a/gr/sweep.py +0 -0
  54. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rsp1a/receiver.py +0 -0
  55. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rspduo/__init__.py +0 -0
  56. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/rspduo/gr/__init__.py +0 -0
  57. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/test/__init__.py +0 -0
  58. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/test/gr/__init__.py +0 -0
  59. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/test/gr/cosine_signal_1.py +0 -0
  60. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/library/test/gr/tagged_staircase.py +0 -0
  61. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/receiver_register.py +0 -0
  62. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/receivers/validators.py +0 -0
  63. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/spectrograms/__init__.py +0 -0
  64. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/spectrograms/analytical.py +0 -0
  65. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/spectrograms/array_operations.py +0 -0
  66. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/spectrograms/spectrogram.py +0 -0
  67. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/spectrograms/transform.py +0 -0
  68. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/__init__.py +0 -0
  69. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/base.py +0 -0
  70. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/event_handler_register.py +0 -0
  71. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/factory.py +0 -0
  72. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/library/__init__.py +0 -0
  73. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/library/fixed/__init__.py +0 -0
  74. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/library/fixed/event_handler.py +0 -0
  75. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/watchdog/library/sweep/event_handler.py +0 -0
  76. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core/web_fetch/callisto.py +0 -0
  77. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core.egg-info/dependency_links.txt +0 -0
  78. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core.egg-info/requires.txt +0 -0
  79. {spectre_core-0.0.6 → spectre_core-0.0.8}/src/spectre_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spectre-core
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: The core Python package used by the spectre program.
5
5
  Maintainer-email: Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -698,7 +698,7 @@ Requires-Dist: watchdog==4.0.0
698
698
 
699
699
  :loudspeaker: **This project is under active development. Contributors welcome.** :loudspeaker:
700
700
 
701
- ```spectre-core``` provides a SDR receiver-agnostic digital signal processing framework. It is the core Python package used by the [`spectre`](https://github.com/jcfitzpatrick12/spectre.git) program.
701
+ ```spectre-core``` provides a SDR receiver-agnostic digital signal processing framework. It is the core Python package used by the [`spectre`](https://github.com/jcfitzpatrick12/spectre.git) program.
702
702
 
703
703
 
704
704
  ## Installation
@@ -4,7 +4,7 @@
4
4
 
5
5
  :loudspeaker: **This project is under active development. Contributors welcome.** :loudspeaker:
6
6
 
7
- ```spectre-core``` provides a SDR receiver-agnostic digital signal processing framework. It is the core Python package used by the [`spectre`](https://github.com/jcfitzpatrick12/spectre.git) program.
7
+ ```spectre-core``` provides a SDR receiver-agnostic digital signal processing framework. It is the core Python package used by the [`spectre`](https://github.com/jcfitzpatrick12/spectre.git) program.
8
8
 
9
9
 
10
10
  ## Installation
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "spectre-core"
7
- version = "0.0.6"
7
+ version = "0.0.8"
8
8
  maintainers = [
9
9
  { name="Jimmy Fitzpatrick", email="jcfitzpatrick12@gmail.com" },
10
10
  ]
@@ -9,13 +9,10 @@ from matplotlib.figure import Figure
9
9
  from matplotlib.axes import Axes
10
10
 
11
11
  from spectre_core.spectrograms.spectrogram import Spectrogram
12
- from spectre_core.plotting.base import BasePanel
12
+ from spectre_core.plotting.base import BasePanel, CutsPanel
13
+ from spectre_core.plotting.format import DEFAULT_FORMATS
13
14
  from spectre_core.plotting.factory import get_panel
14
- from spectre_core.plotting.library.time_cuts.panel import Panel as TimeCutsPanel
15
- from spectre_core.plotting.library.frequency_cuts.panel import Panel as FrequencyCutsPanel
16
15
  from spectre_core.plotting.library.spectrogram.panel import Panel as SpectrogramPanel
17
- from spectre_core.plotting.base import CutsPanel
18
- from spectre_core.plotting.format import DEFAULT_FORMATS
19
16
 
20
17
  class PanelStack:
21
18
  def __init__(self, time_type: str, figsize: Tuple[int, int] = (10, 10)):
@@ -240,8 +240,8 @@ class SPECTREReceiver(BaseReceiver):
240
240
  "window_kwargs": dict, # keyword arguments for window function, must be in order as in scipy documentation.
241
241
  "window_size": int, # number of samples in STFFT window
242
242
  "hop": int, # STFFT window hops by so many samples
243
- "chunk_key": str, # tag will map to the chunk with this key
244
- "event_handler_key": str, # tag will map to event handler with this key during post processing
243
+ "chunk_key": str, # maps to the corresponding chunk class
244
+ "event_handler_key": str, # maps to the event handler used in post processing
245
245
  },
246
246
  "sweep": {
247
247
  "min_freq": float, # [Hz]
@@ -260,8 +260,8 @@ class SPECTREReceiver(BaseReceiver):
260
260
  "window_kwargs": dict, # keyword arguments for window function, must be in order as in scipy documentation.
261
261
  "window_size": int, # number of samples in STFFT window
262
262
  "hop": int, # keyword arguments for the scipy STFFT class
263
- "chunk_key": str, # tag will map to the chunk with this key
264
- "event_handler_key": str, # tag will map to event handler with this key during post processing
263
+ "chunk_key": str, # maps to the corresponding chunk class
264
+ "event_handler_key": str, # maps to the event handler used in post processing
265
265
  }
266
266
  }
267
267
 
@@ -5,7 +5,7 @@
5
5
  # SPDX-License-Identifier: GPL-3.0
6
6
  #
7
7
  # GNU Radio Python Flow Graph
8
- # Title: Options 0
8
+ # Title: tuner_1_fixed
9
9
  # GNU Radio version: 3.10.1.1
10
10
 
11
11
  # SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
@@ -50,7 +50,11 @@ class tuner_1_fixed(gr.top_block):
50
50
  ##################################################
51
51
  # Blocks
52
52
  ##################################################
53
- self.spectre_batched_file_sink_0 = spectre.batched_file_sink(CHUNKS_DIR_PATH, tag, chunk_size, samp_rate, is_sweeping)
53
+ self.spectre_batched_file_sink_0 = spectre.batched_file_sink(CHUNKS_DIR_PATH,
54
+ tag,
55
+ chunk_size,
56
+ samp_rate,
57
+ is_sweeping)
54
58
  self.sdrplay3_rspduo_0 = sdrplay3.rspduo(
55
59
  '',
56
60
  rspduo_mode="Single Tuner",
@@ -5,9 +5,13 @@
5
5
  # SPDX-License-Identifier: GPL-3.0
6
6
  #
7
7
  # GNU Radio Python Flow Graph
8
- # Title: Not titled yet
8
+ # Title: tuner_1_sweep
9
9
  # GNU Radio version: 3.10.1.1
10
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
+
11
15
  import sys
12
16
  import signal
13
17
  from argparse import ArgumentParser
@@ -31,7 +35,7 @@ from spectre_core.file_handlers.configs import CaptureConfig
31
35
  class tuner_1_sweep(gr.top_block):
32
36
  def __init__(self,
33
37
  capture_config: CaptureConfig):
34
- gr.top_block.__init__(self, "tuner-1-sweep", catch_exceptions=True)
38
+ gr.top_block.__init__(self, "tuner_1_sweep", catch_exceptions=True)
35
39
 
36
40
  ##################################################
37
41
  # Unpack capture config
@@ -93,8 +97,8 @@ class tuner_1_sweep(gr.top_block):
93
97
  self.sdrplay3_rspduo_0.set_debug_mode(False)
94
98
  self.sdrplay3_rspduo_0.set_sample_sequence_gaps_check(False)
95
99
  self.sdrplay3_rspduo_0.set_show_gain_changes(False)
96
- self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_gr_complex*1, 'freq', "freq")
97
- self.blocks_tag_debug_0.set_display(True)
100
+ # self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_gr_complex*1, 'freq', "freq")
101
+ # self.blocks_tag_debug_0.set_display(True)
98
102
 
99
103
 
100
104
  ##################################################
@@ -105,14 +109,6 @@ class tuner_1_sweep(gr.top_block):
105
109
  self.connect((self.sdrplay3_rspduo_0, 0), (self.spectre_sweep_driver_0, 0))
106
110
 
107
111
 
108
- def get_samp_rate(self):
109
- return self.samp_rate
110
-
111
- def set_samp_rate(self, samp_rate):
112
- self.samp_rate = samp_rate
113
- self.sdrplay3_rspduo_0.set_sample_rate(self.samp_rate, True)
114
-
115
-
116
112
 
117
113
 
118
114
  def main(capture_config: CaptureConfig,
@@ -0,0 +1,120 @@
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: Not titled yet
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
+ from gnuradio import gr
16
+ from gnuradio.filter import firdes
17
+ from gnuradio.fft import window
18
+ import sys
19
+ import signal
20
+ from argparse import ArgumentParser
21
+ from gnuradio.eng_arg import eng_float, intx
22
+ from gnuradio import eng_notation
23
+ from gnuradio import sdrplay3
24
+ from gnuradio import spectre
25
+
26
+ from spectre_core.cfg import CHUNKS_DIR_PATH
27
+ from spectre_core.file_handlers.configs import CaptureConfig
28
+
29
+
30
+ class tuner_2_fixed(gr.top_block):
31
+
32
+ def __init__(self,
33
+ capture_config: CaptureConfig):
34
+ gr.top_block.__init__(self, "tuner_2_fixed", catch_exceptions=True)
35
+
36
+ ##################################################
37
+ # Unpack capture config
38
+ ##################################################
39
+ samp_rate = capture_config['samp_rate']
40
+ tag = capture_config['tag']
41
+ chunk_size = capture_config['chunk_size']
42
+ center_freq = capture_config['center_freq']
43
+ bandwidth = capture_config['bandwidth']
44
+ IF_gain = capture_config['IF_gain']
45
+ RF_gain = capture_config['RF_gain']
46
+ is_sweeping = False
47
+
48
+ ##################################################
49
+ # Blocks
50
+ ##################################################
51
+ self.spectre_batched_file_sink_0 = spectre.batched_file_sink(CHUNKS_DIR_PATH,
52
+ tag,
53
+ chunk_size,
54
+ samp_rate,
55
+ is_sweeping)
56
+ self.sdrplay3_rspduo_0 = sdrplay3.rspduo(
57
+ '',
58
+ rspduo_mode="Single Tuner",
59
+ antenna="Tuner 2 50 ohm",
60
+ stream_args=sdrplay3.stream_args(
61
+ output_type='fc32',
62
+ channels_size=1
63
+ ),
64
+ )
65
+ self.sdrplay3_rspduo_0.set_sample_rate(samp_rate)
66
+ self.sdrplay3_rspduo_0.set_center_freq(center_freq)
67
+ self.sdrplay3_rspduo_0.set_bandwidth(bandwidth)
68
+ self.sdrplay3_rspduo_0.set_antenna("Tuner 2 50 ohm")
69
+ self.sdrplay3_rspduo_0.set_gain_mode(False)
70
+ self.sdrplay3_rspduo_0.set_gain(IF_gain, 'IF')
71
+ self.sdrplay3_rspduo_0.set_gain(RF_gain, 'RF', False)
72
+ self.sdrplay3_rspduo_0.set_freq_corr(0)
73
+ self.sdrplay3_rspduo_0.set_dc_offset_mode(False)
74
+ self.sdrplay3_rspduo_0.set_iq_balance_mode(False)
75
+ self.sdrplay3_rspduo_0.set_agc_setpoint(-30)
76
+ self.sdrplay3_rspduo_0.set_rf_notch_filter(False)
77
+ self.sdrplay3_rspduo_0.set_dab_notch_filter(False)
78
+ self.sdrplay3_rspduo_0.set_am_notch_filter(False)
79
+ self.sdrplay3_rspduo_0.set_biasT(False)
80
+ self.sdrplay3_rspduo_0.set_stream_tags(False)
81
+ self.sdrplay3_rspduo_0.set_debug_mode(False)
82
+ self.sdrplay3_rspduo_0.set_sample_sequence_gaps_check(False)
83
+ self.sdrplay3_rspduo_0.set_show_gain_changes(False)
84
+
85
+
86
+ ##################################################
87
+ # Connections
88
+ ##################################################
89
+ self.connect((self.sdrplay3_rspduo_0, 0), (self.spectre_batched_file_sink_0, 0))
90
+
91
+
92
+ def get_samp_rate(self):
93
+ return self.samp_rate
94
+
95
+ def set_samp_rate(self, samp_rate):
96
+ self.samp_rate = samp_rate
97
+ self.sdrplay3_rspduo_0.set_sample_rate(self.samp_rate, False)
98
+
99
+
100
+
101
+
102
+ def main(capture_config: CaptureConfig,
103
+ top_block_cls=tuner_2_fixed,
104
+ options=None):
105
+
106
+ tb = top_block_cls(capture_config)
107
+
108
+ def sig_handler(sig=None, frame=None):
109
+ tb.stop()
110
+ tb.wait()
111
+
112
+ sys.exit(0)
113
+
114
+ signal.signal(signal.SIGINT, sig_handler)
115
+ signal.signal(signal.SIGTERM, sig_handler)
116
+
117
+ tb.start()
118
+
119
+ tb.wait()
120
+
@@ -0,0 +1,119 @@
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: Not titled yet
9
+ # GNU Radio version: 3.10.1.1
10
+
11
+ from gnuradio import gr
12
+ from gnuradio.filter import firdes
13
+ from gnuradio.fft import window
14
+ import sys
15
+ import signal
16
+ from argparse import ArgumentParser
17
+ from gnuradio.eng_arg import eng_float, intx
18
+ from gnuradio import eng_notation
19
+ from gnuradio import sdrplay3
20
+ from gnuradio import spectre
21
+
22
+ from spectre_core.cfg import CHUNKS_DIR_PATH
23
+ from spectre_core.file_handlers.configs import CaptureConfig
24
+
25
+
26
+ class tuner_2_sweep(gr.top_block):
27
+ def __init__(self,
28
+ capture_config: CaptureConfig):
29
+ gr.top_block.__init__(self, "tuner_2_sweep", catch_exceptions=True)
30
+
31
+ ##################################################
32
+ # Unpack capture config
33
+ ##################################################
34
+ samp_rate = capture_config['samp_rate']
35
+ bandwidth = capture_config['bandwidth']
36
+ min_freq = capture_config['min_freq']
37
+ max_freq = capture_config['max_freq']
38
+ freq_step = capture_config['freq_step']
39
+ samples_per_step = capture_config['samples_per_step']
40
+ IF_gain = capture_config['IF_gain']
41
+ RF_gain = capture_config['RF_gain']
42
+ chunk_size = capture_config['chunk_size']
43
+ start_freq = min_freq + samp_rate/2
44
+ tag = capture_config['tag']
45
+
46
+ ##################################################
47
+ # Blocks
48
+ ##################################################
49
+ self.spectre_sweep_driver_0 = spectre.sweep_driver(min_freq,
50
+ max_freq,
51
+ freq_step,
52
+ samp_rate,
53
+ samples_per_step,
54
+ 'freq')
55
+ self.spectre_batched_file_sink_0 = spectre.batched_file_sink(CHUNKS_DIR_PATH,
56
+ tag,
57
+ chunk_size,
58
+ samp_rate,
59
+ True,
60
+ 'freq',
61
+ start_freq)
62
+ self.sdrplay3_rspduo_0 = sdrplay3.rspduo(
63
+ '',
64
+ rspduo_mode="Single Tuner",
65
+ antenna="Tuner 2 50 ohm",
66
+ stream_args=sdrplay3.stream_args(
67
+ output_type='fc32',
68
+ channels_size=1
69
+ ),
70
+ )
71
+ self.sdrplay3_rspduo_0.set_sample_rate(samp_rate, True)
72
+ self.sdrplay3_rspduo_0.set_center_freq(start_freq, True)
73
+ self.sdrplay3_rspduo_0.set_bandwidth(bandwidth)
74
+ self.sdrplay3_rspduo_0.set_antenna("Tuner 2 50 ohm")
75
+ self.sdrplay3_rspduo_0.set_gain_mode(False)
76
+ self.sdrplay3_rspduo_0.set_gain(IF_gain, 'IF', True)
77
+ self.sdrplay3_rspduo_0.set_gain(RF_gain, 'RF', True)
78
+ self.sdrplay3_rspduo_0.set_freq_corr(0)
79
+ self.sdrplay3_rspduo_0.set_dc_offset_mode(False)
80
+ self.sdrplay3_rspduo_0.set_iq_balance_mode(False)
81
+ self.sdrplay3_rspduo_0.set_agc_setpoint(-30)
82
+ self.sdrplay3_rspduo_0.set_rf_notch_filter(False)
83
+ self.sdrplay3_rspduo_0.set_dab_notch_filter(True)
84
+ self.sdrplay3_rspduo_0.set_am_notch_filter(False)
85
+ self.sdrplay3_rspduo_0.set_biasT(False)
86
+ self.sdrplay3_rspduo_0.set_stream_tags(True)
87
+ self.sdrplay3_rspduo_0.set_debug_mode(False)
88
+ self.sdrplay3_rspduo_0.set_sample_sequence_gaps_check(False)
89
+ self.sdrplay3_rspduo_0.set_show_gain_changes(False)
90
+
91
+
92
+ ##################################################
93
+ # Connections
94
+ ##################################################
95
+ self.msg_connect((self.spectre_sweep_driver_0, 'freq'), (self.sdrplay3_rspduo_0, 'freq'))
96
+ self.connect((self.sdrplay3_rspduo_0, 0), (self.spectre_batched_file_sink_0, 0))
97
+ self.connect((self.sdrplay3_rspduo_0, 0), (self.spectre_sweep_driver_0, 0))
98
+
99
+
100
+ def main(capture_config: CaptureConfig,
101
+ top_block_cls=tuner_2_sweep,
102
+ options=None):
103
+ tb = top_block_cls(capture_config)
104
+
105
+ def sig_handler(sig=None, frame=None):
106
+ tb.stop()
107
+ tb.wait()
108
+
109
+ sys.exit(0)
110
+
111
+ signal.signal(signal.SIGINT, sig_handler)
112
+ signal.signal(signal.SIGTERM, sig_handler)
113
+
114
+ tb.start(1024)
115
+
116
+ tb.wait()
117
+
118
+ if __name__ == '__main__':
119
+ main()
@@ -4,7 +4,12 @@
4
4
 
5
5
  from spectre_core.receivers.base import SDRPlayReceiver
6
6
  from spectre_core.receivers.receiver_register import register_receiver
7
- from spectre_core.receivers.library.rspduo.gr import tuner_1_fixed, tuner_1_sweep
7
+ from spectre_core.receivers.library.rspduo.gr import (
8
+ tuner_1_fixed,
9
+ tuner_1_sweep,
10
+ tuner_2_fixed,
11
+ tuner_2_sweep
12
+ )
8
13
  from spectre_core.file_handlers.configs import CaptureConfig
9
14
 
10
15
 
@@ -17,14 +22,18 @@ class Receiver(SDRPlayReceiver):
17
22
  def _set_capture_methods(self) -> None:
18
23
  self._capture_methods = {
19
24
  "tuner-1-fixed": self.__tuner_1_fixed,
20
- "tuner-1-sweep": self.__tuner_1_sweep
25
+ "tuner-1-sweep": self.__tuner_1_sweep,
26
+ "tuner-2-fixed": self.__tuner_2_fixed,
27
+ "tuner-2-sweep": self.__tuner_2_sweep
21
28
  }
22
29
 
23
30
 
24
31
  def _set_validators(self) -> None:
25
32
  self._validators = {
26
33
  "tuner-1-fixed": self.__tuner_1_fixed_validator,
27
- "tuner-1-sweep": self.__tuner_1_sweep_validator
34
+ "tuner-1-sweep": self.__tuner_1_sweep_validator,
35
+ "tuner-2-fixed": self.__tuner_2_fixed_validator,
36
+ "tuner-2-sweep": self.__tuner_2_sweep_validator,
28
37
  }
29
38
  return
30
39
 
@@ -33,6 +42,8 @@ class Receiver(SDRPlayReceiver):
33
42
  self._type_templates = {
34
43
  "tuner-1-fixed": self._get_default_type_template("fixed"),
35
44
  "tuner-1-sweep": self._get_default_type_template("sweep"),
45
+ "tuner-2-fixed": self._get_default_type_template("fixed"),
46
+ "tuner-2-sweep": self._get_default_type_template("sweep"),
36
47
  }
37
48
 
38
49
  def _set_specifications(self) -> None:
@@ -55,14 +66,32 @@ class Receiver(SDRPlayReceiver):
55
66
 
56
67
  def __tuner_1_sweep(self, capture_config: CaptureConfig) -> None:
57
68
  tuner_1_sweep.main(capture_config)
69
+
70
+
71
+ def __tuner_2_fixed(self, capture_config: CaptureConfig) -> None:
72
+ tuner_2_fixed.main(capture_config)
58
73
 
59
74
 
75
+ def __tuner_2_sweep(self, capture_config: CaptureConfig) -> None:
76
+ tuner_2_sweep.main(capture_config)
77
+
78
+
60
79
  def __tuner_1_fixed_validator(self, capture_config: CaptureConfig) -> None:
61
80
  self._default_fixed_validator(capture_config)
62
81
  self._sdrplay_validator(capture_config)
63
-
64
-
82
+
83
+
65
84
  def __tuner_1_sweep_validator(self, capture_config: CaptureConfig) -> None:
85
+ self._default_sweep_validator(capture_config)
86
+ self._sdrplay_validator(capture_config)
87
+
88
+
89
+ def __tuner_2_fixed_validator(self, capture_config: CaptureConfig) -> None:
90
+ self._default_fixed_validator(capture_config)
91
+ self._sdrplay_validator(capture_config)
92
+
93
+
94
+ def __tuner_2_sweep_validator(self, capture_config: CaptureConfig) -> None:
66
95
  self._default_sweep_validator(capture_config)
67
96
  self._sdrplay_validator(capture_config)
68
97
 
@@ -33,41 +33,42 @@ class Receiver(SPECTREReceiver):
33
33
  def _set_type_templates(self) -> None:
34
34
  self._type_templates = {
35
35
  "cosine-signal-1": {
36
- 'samp_rate': int, # [Hz]
37
- 'frequency': float, # [Hz]
38
- 'amplitude': float, # unitless
39
- 'chunk_size': int, # [s]
40
- 'joining_time': int, # [s]
41
- 'time_resolution': float, # [s]
42
- 'frequency_resolution': float, # [Hz]
43
- 'window_type': str, # the window type for the STFFT
44
- 'window_kwargs': dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
45
- 'window_size': int, # number of samples for the window
46
- 'hop': int, # STFFT hop shifts window by so many samples
47
- 'chunk_key': str, # tag will map to the chunk with this key
48
- 'event_handler_key': str # tag will map to event handler with this key during post processing
36
+ "samp_rate": int, # [Hz]
37
+ "frequency": float, # [Hz]
38
+ "amplitude": float, # unitless
39
+ "chunk_size": int, # [s]
40
+ "joining_time": int, # [s]
41
+ "time_resolution": float, # [s]
42
+ "frequency_resolution": float, # [Hz]
43
+ "window_type": str, # the window type for the STFFT
44
+ "window_kwargs": dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
45
+ "window_size": int, # number of samples for the window
46
+ "hop": int, # STFFT hop shifts window by so many samples
47
+ "chunk_key": str, # maps to the corresponding chunk class
48
+ "event_handler_key": str, # maps to the event handler used in post processing
49
49
  },
50
50
  "tagged-staircase": {
51
- 'samp_rate': int, # [Hz]
52
- 'min_samples_per_step': int, # [samples]
53
- 'max_samples_per_step': int, # [samples]
54
- 'freq_step': float, # [Hz]
55
- 'step_increment': int, # [samples]
56
- 'chunk_size': int, # [s]
57
- 'joining_time': int, # [s]
58
- 'time_resolution': float, # [s]
59
- 'frequency_resolution': float, # [Hz]
60
- 'window_type': str, # the window type for the STFFT
61
- 'window_kwargs': dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
62
- 'window_size': int, # number of samples for the window
63
- 'hop': int, # keyword arguments for scipy STFFT class
64
- 'chunk_key': str, # tag will map to the chunk with this key
65
- 'event_handler_key': str, # tag will map to event handler with this key during post processing
51
+ "samp_rate": int, # [Hz]
52
+ "min_samples_per_step": int, # [samples]
53
+ "max_samples_per_step": int, # [samples]
54
+ "freq_step": float, # [Hz]
55
+ "step_increment": int, # [samples]
56
+ "chunk_size": int, # [s]
57
+ "joining_time": int, # [s]
58
+ "time_resolution": float, # [s]
59
+ "frequency_resolution": float, # [Hz]
60
+ "window_type": str, # the window type for the STFFT
61
+ "window_kwargs": dict, # keyword arguments for scipy get window function. Must be in order as in scipy documentation.
62
+ "window_size": int, # number of samples for the window
63
+ "hop": int, # keyword arguments for scipy STFFT class
64
+ "chunk_key": str, # maps to the corresponding chunk class
65
+ "event_handler_key": str, # maps to the event handler used in post processing
66
66
  }
67
67
  }
68
68
 
69
69
  def _set_specifications(self) -> None:
70
70
  self._specifications = {
71
+ "samp_rate_lower_bound": 64000
71
72
  }
72
73
 
73
74
 
@@ -105,6 +106,9 @@ class Receiver(SPECTREReceiver):
105
106
  validators.chunk_key(chunk_key, "fixed")
106
107
  validators.event_handler_key(event_handler_key, "fixed")
107
108
 
109
+ if samp_rate < self.specifications.get("samp_rate_lower_bound"):
110
+ raise ValueError(f"Sample rate must be greater than or equal to {self.specifications.get('samp_rate_lower_bound')}")
111
+
108
112
  if time_resolution != 0:
109
113
  raise ValueError(f"Time resolution must be zero. Received: {time_resolution}")
110
114
 
@@ -12,7 +12,7 @@ from watchdog.observers import Observer
12
12
  from spectre_core.watchdog.factory import get_event_handler_from_tag
13
13
  from spectre_core.cfg import CHUNKS_DIR_PATH
14
14
 
15
- class Watcher:
15
+ class PostProcessor:
16
16
  def __init__(self,
17
17
  tag: str):
18
18
  self._observer: Observer = Observer()
@@ -25,7 +25,7 @@ class Watcher:
25
25
 
26
26
 
27
27
  def start(self):
28
- _LOGGER.info("Starting watcher...")
28
+ _LOGGER.info("Starting post processor...")
29
29
 
30
30
  # Schedule and start the observer
31
31
  self._observer.schedule(self._event_handler,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spectre-core
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: The core Python package used by the spectre program.
5
5
  Maintainer-email: Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -698,7 +698,7 @@ Requires-Dist: watchdog==4.0.0
698
698
 
699
699
  :loudspeaker: **This project is under active development. Contributors welcome.** :loudspeaker:
700
700
 
701
- ```spectre-core``` provides a SDR receiver-agnostic digital signal processing framework. It is the core Python package used by the [`spectre`](https://github.com/jcfitzpatrick12/spectre.git) program.
701
+ ```spectre-core``` provides a SDR receiver-agnostic digital signal processing framework. It is the core Python package used by the [`spectre`](https://github.com/jcfitzpatrick12/spectre.git) program.
702
702
 
703
703
 
704
704
  ## Installation
@@ -53,6 +53,8 @@ src/spectre_core/receivers/library/rspduo/receiver.py
53
53
  src/spectre_core/receivers/library/rspduo/gr/__init__.py
54
54
  src/spectre_core/receivers/library/rspduo/gr/tuner_1_fixed.py
55
55
  src/spectre_core/receivers/library/rspduo/gr/tuner_1_sweep.py
56
+ src/spectre_core/receivers/library/rspduo/gr/tuner_2_fixed.py
57
+ src/spectre_core/receivers/library/rspduo/gr/tuner_2_sweep.py
56
58
  src/spectre_core/receivers/library/test/__init__.py
57
59
  src/spectre_core/receivers/library/test/receiver.py
58
60
  src/spectre_core/receivers/library/test/gr/__init__.py
@@ -67,7 +69,7 @@ src/spectre_core/watchdog/__init__.py
67
69
  src/spectre_core/watchdog/base.py
68
70
  src/spectre_core/watchdog/event_handler_register.py
69
71
  src/spectre_core/watchdog/factory.py
70
- src/spectre_core/watchdog/watcher.py
72
+ src/spectre_core/watchdog/post_processor.py
71
73
  src/spectre_core/watchdog/library/__init__.py
72
74
  src/spectre_core/watchdog/library/fixed/__init__.py
73
75
  src/spectre_core/watchdog/library/fixed/event_handler.py
File without changes
File without changes