|
libSDRForge
|
Own RF warmup, discontinuity recovery, and one WFM receiver. More...
Public Member Functions | |
| None | __init__ (self, *, int frequency_hz, Literal["mono", "stereo"] mode="stereo", bool rds_enabled=False, float|None gain_db=29.7, float rf_warmup_seconds=2.0, SdrSourceIf|None source=None, Callable[[IqBlock], None]|None iq_observer=None) |
| Initialize the instance. | |
| RadioSession | fm (cls, float frequency_mhz, *, bool stereo=True, bool rds=False, float|None gain_db=None, SdrSourceIf|None source=None, float rf_warmup_seconds=2.0) |
| Create an FM session using MHz instead of integer Hz. | |
| RadioSessionStatus | status (self) |
| Return the status. | |
| str | demodulation (self) |
| Return the active audio demodulation mode. | |
| int | channel_bandwidth_hz (self) |
| Return the configured channel bandwidth in hertz. | |
| None | start (self) |
| Start the component. | |
| None | set_demodulation (self, str mode, int bandwidth_hz=0) |
| Select the live DSP without reopening the shared SDR source. | |
| None | retune (self, int frequency_hz) |
| Retune an open source without releasing its USB handle. | |
| bool | pan_acquisition (self, int center_hz) |
| Move RF acquisition, following with the listener only when necessary. | |
| bool | recenter (self) |
| Move the acquisition center to the selected listening frequency. | |
| None | stop (self) |
| Stop the component. | |
| Self | __enter__ (self) |
| Enter the managed context. | |
| None | __exit__ (self, object exc_type, object exc, object tb) |
| Exit the managed context. | |
| RadioFrame | read (self) |
| Decode one block, resetting DSP after gaps while preserving RDS. | |
| Iterator[RadioFrame] | stream (self) |
| Yield decoded blocks until stopped or acquisition raises. | |
Public Attributes | |
| frequency_hz = frequency_hz | |
| acquisition_frequency_hz = frequency_hz | |
| gain_db = gain_db | |
| rf_warmup_seconds = rf_warmup_seconds | |
| source = source if source is not None else RtlSdrSource() | |
| iq_observer = iq_observer | |
| int | observer_errors = 0 |
| tuple | receiver |
| performance = DspPerformanceMonitor() | |
Protected Member Functions | |
| None | _reset_receiver (self, *, bool preserve_metadata=False) |
| bool | _channel_fits (self, int frequency_hz, int bandwidth_hz) |
| None | _validate_block (self, object block) |
| int|None | _dropped_blocks (self) |
Protected Attributes | |
| _receiver_mode = mode | |
| str | _demodulation = "WFM" |
| int | _channel_bandwidth_hz = 200_000 |
| _rds_enabled = rds_enabled | |
| bool | _started = False |
| int | _blocks = 0 |
| int | _samples = 0 |
| int | _discontinuities = 0 |
| str|None | _last_error = None |
| int|None | _last_timestamp_ns = None |
| int | _last_duration_ns = 0 |
| int|None | _last_dropped_blocks = None |
Own RF warmup, discontinuity recovery, and one WFM receiver.
Source injection keeps tests independent of USB and allows future SDR adapters. The caller controls the iteration lifetime.
| None sdrforge.session.RadioSession.__init__ | ( | self, | |
| * | , | ||
| int | frequency_hz, | ||
| Literal["mono", "stereo"] | mode = "stereo", | ||
| bool | rds_enabled = False, | ||
| float | None | gain_db = 29.7, | ||
| float | rf_warmup_seconds = 2.0, | ||
| SdrSourceIf | None | source = None, | ||
| Callable[[IqBlock], None] | None | iq_observer = None ) |
Initialize the instance.
| self | The current instance. |
| frequency_hz | The frequency_hz value. |
| mode | The mode value. |
| rds_enabled | The rds_enabled value. |
| gain_db | The gain_db value. |
| rf_warmup_seconds | The rf_warmup_seconds value. |
| source | The source value. |
| iq_observer | The iq_observer value. |
| Self sdrforge.session.RadioSession.__enter__ | ( | self | ) |
Enter the managed context.
| self | The current instance. |
| None sdrforge.session.RadioSession.__exit__ | ( | self, | |
| object | exc_type, | ||
| object | exc, | ||
| object | tb ) |
Exit the managed context.
| self | The current instance. |
| exc_type | The exc_type value. |
| exc | The exc value. |
| tb | The tb value. |
|
protected |
|
protected |
|
protected |
|
protected |
| int sdrforge.session.RadioSession.channel_bandwidth_hz | ( | self | ) |
Return the configured channel bandwidth in hertz.
| self | The current instance. |
| str sdrforge.session.RadioSession.demodulation | ( | self | ) |
Return the active audio demodulation mode.
| self | The current instance. |
| RadioSession sdrforge.session.RadioSession.fm | ( | cls, | |
| float | frequency_mhz, | ||
| * | , | ||
| bool | stereo = True, | ||
| bool | rds = False, | ||
| float | None | gain_db = None, | ||
| SdrSourceIf | None | source = None, | ||
| float | rf_warmup_seconds = 2.0 ) |
Create an FM session using MHz instead of integer Hz.
Capture is asynchronous when supported by the default RTL-SDR adapter. Pass an injected source for hardware-free or alternate-hardware use.
| cls | The current class. |
| frequency_mhz | The frequency_mhz value. |
| stereo | The stereo value. |
| rds | The rds value. |
| gain_db | The tuner gain in decibels, or None for automatic gain. |
| source | The source value. |
| rf_warmup_seconds | The rf_warmup_seconds value. |
| bool sdrforge.session.RadioSession.pan_acquisition | ( | self, | |
| int | center_hz ) |
Move RF acquisition, following with the listener only when necessary.
| self | The current instance. |
| center_hz | Requested acquisition center in hertz. |
| RadioFrame sdrforge.session.RadioSession.read | ( | self | ) |
Decode one block, resetting DSP after gaps while preserving RDS.
| self | The current instance. |
| bool sdrforge.session.RadioSession.recenter | ( | self | ) |
Move the acquisition center to the selected listening frequency.
| self | The current instance. |
| None sdrforge.session.RadioSession.retune | ( | self, | |
| int | frequency_hz ) |
Retune an open source without releasing its USB handle.
| self | The current instance. |
| frequency_hz | The frequency hz value. |
| None sdrforge.session.RadioSession.set_demodulation | ( | self, | |
| str | mode, | ||
| int | bandwidth_hz = 0 ) |
Select the live DSP without reopening the shared SDR source.
| self | The current instance. |
| mode | The mode value. |
| bandwidth_hz | The bandwidth hz value. |
| None sdrforge.session.RadioSession.start | ( | self | ) |
Start the component.
| self | The current instance. |
| RadioSessionStatus sdrforge.session.RadioSession.status | ( | self | ) |
Return the status.
| self | The current instance. |
| None sdrforge.session.RadioSession.stop | ( | self | ) |
Stop the component.
| self | The current instance. |
| Iterator[RadioFrame] sdrforge.session.RadioSession.stream | ( | self | ) |
Yield decoded blocks until stopped or acquisition raises.
| self | The current instance. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| sdrforge.session.RadioSession.acquisition_frequency_hz = frequency_hz |
| sdrforge.session.RadioSession.frequency_hz = frequency_hz |
| sdrforge.session.RadioSession.gain_db = gain_db |
| sdrforge.session.RadioSession.iq_observer = iq_observer |
| int sdrforge.session.RadioSession.observer_errors = 0 |
| sdrforge.session.RadioSession.performance = DspPerformanceMonitor() |
| sdrforge.session.RadioSession.receiver |
| sdrforge.session.RadioSession.rf_warmup_seconds = rf_warmup_seconds |
| sdrforge.session.RadioSession.source = source if source is not None else RtlSdrSource() |