ScratchRadio Library: Difference between revisions

Democratising Wireless Innovation
Jump to navigation Jump to search
(Added block descriptions for all source and sink blocks.)
 
(Added information about the framer/deframer blocks.)
Line 44: Line 44:


The input of the message sink block is compatible with outputs from the ''message source'' block and the ''simple deframer'' block.
The input of the message sink block is compatible with outputs from the ''message source'' block and the ''simple deframer'' block.
==Data Processing Blocks==
===Simple Framer Block===
The ''simple framer'' block is used to add a header and checksum to messages prior to transmission. The block accepts input messages that are made up of a length byte that specifies the number of bytes in the message, followed by the specified number of payload bytes. It generates an output which consists of the same message, but with header and checksum bytes added and the data serialised into individual bits. When no message is being sent, idle bits may be inserted. The generated frame consists of a six byte preamble, a four byte synchronisation word, the length and payload bytes from the original message, two checksum bytes and a single byte frame terminator. The checksum is calculated over the length and payload fields using Fletcher’s checksum method (modulo 255). For more information about using this checksum method, see the [https://en.wikipedia.org/wiki/Fletcher%27s_checksum Wikipedia article]. The overall format is as follows:
  A5 F0 A5 F0 A5 F0 7E 81 C3 3C <LEN> <PAYLOAD…> <CS0> <CS1> FF
The input of the simple framer block is compatible with outputs from the ''message source'' block. The output is compatible with inputs to the ''Manchester encoder'' block, the ''OOK modulator'' block and the ''simple deframer'' block.
===Simple Deframer Block===
The ''simple deframer'' block accepts input messages that are formatted as previously described for the ''simple framer'' block. It uses the synchronisation word (7E 81 C3 3C) to align to the start of the received message and then validates the checksum for the length and payload fields. If the checksum passes, the received message is forwarded to the deframer output as a series of bytes, consisting of the message length byte followed by the decoded payload bytes. The input of the simple deframer block is compatible with outputs from the ''Manchester decoder'' block, the ''bit rate sampler'' block and the ''simple framer'' block. The output is compatible with inputs to the ''message sink'' block.




{{Community}}
{{Community}}

Revision as of 16:55, 25 July 2018

Data Source Blocks

Radio Source Block

The radio source block takes data samples that are supplied by the LimeSDR-Mini receiver and forwards them as a stream of complex data values, each of which is an I/Q pair of single precision floating point values. The radio source block has two configurable parameters:

  • Centre Frequency - This is the front-end mixer frequency used by the LimeSDR-Mini. It specifies the centre frequency of the 400kHz wide spectrum segment which is mixed down and presented at the block output.
  • Fixed Input Gain - This is the front-end amplifier gain used by the LimeSDR-Mini. It sets the amount by which the radio input is amplified before being sampled.

The output of the radio source block is compatible with inputs to the radio sink block, the spectrum display block, the low pass filter block, the band pass filter block and the OOK demodulator block.

Message Source Block

The message source block takes text messages that are supplied via the send message block and formats them as a stream of data bytes at the message source block output. Each message is made up of a length byte that specifies the number of bytes in the message (1 to 255) followed by the message body consisting of the specified number of bytes. When no message is available for transmission, zero valued padding bytes are inserted. A typical "Hello World!" message complete with padding bytes would be formatted as follows:

 ... 00 00 0C 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 ...

The output of the message source block is compatible with inputs to the message sink block and the simple framer block.

Data Source Tap Block

The data source tap block is used to tap into the data stream at the output of other blocks, replicating the data so that it can be processed in two or more parallel datapaths. The block has a single configurable parameter that specifies the name of the source block from which the output data is being derived. The output of the data source tap block will be compatible with the same set of downstream blocks as for the original data source.

Data Sink Blocks

Radio Sink Block

The radio sink block accepts a stream of complex data values, each of which is an I/Q pair of single precision floating point values, and forwards them to the LimeSDR-Mini transmitter. The radio sink block has two configurable parameters:

  • Centre Frequency – This is the front-end mixer frequency used by the LimeSDR-Mini. It specifies the centre frequency of the 400kHz spectrum segment which is presented at the block input.
  • Fixed Output Gain – This is the front-end amplifier gain used by the LimeSDR-Mini. It sets the amount by which the radio output is amplified before being transmitted.

The input of the radio sink block is compatible with outputs from the radio source block, the low pass filter block, the band pass filter block and the OOK modulator block.

Spectrum Display Block

The spectrum display block accepts a stream of complex data values, each of which is an I/Q pair of single precision floating point values, and displays the associated frequency spectrum. Two graphical representations are supported – a conventional power spectral density plot and a colourised waterfall plot. The appropriate representation can be selected using the block’s drop down menu as spectrum and waterfall respectively. The block also has an additional configurable parameter which sets the centre frequency to be used when labelling the frequency axis of the plots.

Message Sink Block

The message sink block accepts messages that are formatted within a stream of data bytes at the block input and converts them for use within the Scratch programming environment via the receive message block. Each input message is made up of a length byte that specifies the number of bytes in the message (1 to 255) followed by the message body consisting of the specified number of bytes. When no message has been received, zero valued padding bytes are inserted. A typical “Hello World!” message complete with padding bytes would be formatted as follows:

 ... 00 00 0C 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 ...

The input of the message sink block is compatible with outputs from the message source block and the simple deframer block.

Data Processing Blocks

Simple Framer Block

The simple framer block is used to add a header and checksum to messages prior to transmission. The block accepts input messages that are made up of a length byte that specifies the number of bytes in the message, followed by the specified number of payload bytes. It generates an output which consists of the same message, but with header and checksum bytes added and the data serialised into individual bits. When no message is being sent, idle bits may be inserted. The generated frame consists of a six byte preamble, a four byte synchronisation word, the length and payload bytes from the original message, two checksum bytes and a single byte frame terminator. The checksum is calculated over the length and payload fields using Fletcher’s checksum method (modulo 255). For more information about using this checksum method, see the Wikipedia article. The overall format is as follows:

 A5 F0 A5 F0 A5 F0 7E 81 C3 3C <LEN> <PAYLOAD…> <CS0> <CS1> FF

The input of the simple framer block is compatible with outputs from the message source block. The output is compatible with inputs to the Manchester encoder block, the OOK modulator block and the simple deframer block.

Simple Deframer Block

The simple deframer block accepts input messages that are formatted as previously described for the simple framer block. It uses the synchronisation word (7E 81 C3 3C) to align to the start of the received message and then validates the checksum for the length and payload fields. If the checksum passes, the received message is forwarded to the deframer output as a series of bytes, consisting of the message length byte followed by the decoded payload bytes. The input of the simple deframer block is compatible with outputs from the Manchester decoder block, the bit rate sampler block and the simple framer block. The output is compatible with inputs to the message sink block.