Skip to content

Commit

Permalink
composites/rdsreceiver: add rds decoder block to flow graph
Browse files Browse the repository at this point in the history
  • Loading branch information
vsergeev committed Apr 5, 2021
1 parent cecb1de commit e351da4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions radio/composites/rdsreceiver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
-- @category Receivers
-- @block RDSReceiver
--
-- @signature in:ComplexFloat32 > out:RDSFrameType
-- @signature in:ComplexFloat32 > out:RDSPacketType
--
-- @usage
-- local receiver = radio.RDSReceiver()
-- local decoder = radio.RDSDecoderBlock()
-- local snk = radio.JSONSink()
-- top:connect(src, receiver, decoder, snk)
-- top:connect(src, receiver, snk)

local block = require('radio.core.block')
local types = require('radio.types')
Expand Down Expand Up @@ -39,6 +38,7 @@ function RDSReceiver:instantiate()
local bit_decoder = blocks.ManchesterDecoderBlock()
local bit_diff_decoder = blocks.DifferentialDecoderBlock()
local framer = blocks.RDSFramerBlock()
local decoder = blocks.RDSDecoderBlock()

self:connect(fm_demod, hilbert, mixer_delay)
self:connect(hilbert, pilot_filter, pll_baseband)
Expand All @@ -48,11 +48,11 @@ function RDSReceiver:instantiate()
self:connect(phase_corrector, clock_demod, clock_recoverer)
self:connect(phase_corrector, 'out', sampler, 'data')
self:connect(clock_recoverer, 'out', sampler, 'clock')
self:connect(sampler, bit_demod, bit_slicer, bit_decoder, bit_diff_decoder, framer)
self:connect(sampler, bit_demod, bit_slicer, bit_decoder, bit_diff_decoder, framer, decoder)

self:add_type_signature({block.Input("in", types.ComplexFloat32)}, {block.Output("out", blocks.RDSFramerBlock.RDSFrameType)})
self:add_type_signature({block.Input("in", types.ComplexFloat32)}, {block.Output("out", blocks.RDSDecoderBlock.RDSPacketType)})
self:connect(self, "in", fm_demod, "in")
self:connect(self, "out", framer, "out")
self:connect(self, "out", decoder, "out")
end

return RDSReceiver

0 comments on commit e351da4

Please sign in to comment.