Class: PWN::SDR::Decoder::RTTY::Demod

Inherits:
Object
  • Object
show all
Defined in:
lib/pwn/sdr/decoder/rtty.rb

Overview

Streaming 2-FSK Baudot demodulator fed by Base.run_native.

Instance Method Summary collapse

Constructor Details

#initialize(rate: 48_000, baud: 45.45, mark_hz: 2125.0, space_hz: 2295.0) ⇒ Demod

Returns a new instance of Demod.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pwn/sdr/decoder/rtty.rb', line 16

def initialize(rate: 48_000, baud: 45.45, mark_hz: 2125.0, space_hz: 2295.0)
  @rate     = rate
  @baud     = baud
  @mark_hz  = mark_hz
  @space_hz = space_hz
  @spb      = rate / baud
  @buf      = []
  @figs     = false
  @line     = +''
  @idle_bits = 0
end

Instance Method Details

#feed(samples) ⇒ Object



28
29
30
31
# File 'lib/pwn/sdr/decoder/rtty.rb', line 28

def feed(samples, &)
  @buf.concat(samples)
  demod_buffer(&)
end

#flushObject



33
34
35
36
# File 'lib/pwn/sdr/decoder/rtty.rb', line 33

def flush(&)
  demod_buffer(&)
  flush_line(&)
end