Class: PWN::SDR::Decoder::LTE::AcquiredPBCHIQ
- Defined in:
- lib/pwn/sdr/decoder/lte.rb
Overview
Continuous offline IQ acquisition; overlap protects SF0 at window edges. Only a CRC-verified PBCH payload is emitted, never a synchronization hit.
Instance Method Summary collapse
- #feed_iq(samples, rate: nil) ⇒ Object
- #flush {|frame| ... } ⇒ Object
-
#initialize ⇒ AcquiredPBCHIQ
constructor
A new instance of AcquiredPBCHIQ.
Constructor Details
#initialize ⇒ AcquiredPBCHIQ
Returns a new instance of AcquiredPBCHIQ.
88 89 90 91 92 93 |
# File 'lib/pwn/sdr/decoder/lte.rb', line 88 def initialize super(pci: nil) @native.attach_function :pwn_lte_acquire, %i[pointer uint pointer pointer pointer pointer], :int @sample_offset = 0 @last_timing = nil end |
Instance Method Details
#feed_iq(samples, rate: nil) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/pwn/sdr/decoder/lte.rb', line 95 def feed_iq(samples, rate: nil) raise ArgumentError, 'PBCH requires 1.92 Msps' if rate && rate != FS_BASE @buffer.concat(samples) while @buffer.length >= 19_200 frame = acquire(@buffer.first(19_200)) yield frame if frame @buffer.shift(15_360) @sample_offset += 7680 end end |
#flush {|frame| ... } ⇒ Object
107 108 109 110 111 |
# File 'lib/pwn/sdr/decoder/lte.rb', line 107 def flush frame = acquire(@buffer) if @buffer.length >= 3840 yield frame if frame @buffer.clear end |