2.4 Digital Specification
33
2.4.3.1 Lossless Encoding
The Huffman coding uses variable length codewords [22]. Values that are present
in the data with a higher frequency result in shorter codewords with fewer bits,
whereas values with a lower frequency are coded in longer codewords. The Huffman
coding creates codewords so that no codeword can be a prefix of another codeword,
referred to as prefix codes. The codewords are uniquely identifiable in the stream
and can be decoded without using any separators between the code boundaries. As
each channel has a slightly different baseline, it is not efficient to make a table based
on the raw input values from the ADC. However, since the signal from gas-based
detectors primarily has gradual changes and few large changes, it is instead better to
transmit the difference between a sample and the previous. The bulk of the values
have then been found to lie between −10 and +10. The first value in an event needs
to be stored unencoded so that it is possible to decode the following differentially
encoded values.
With Huffman coding, the less probable value are represented by codes that have
many more bits than the original 10 bits of the sample due to the requirement that one
code cannot be the prefix of another. As the SAMPA device does not have the memory
to store all codes, and since significant changes in occupancy can potentially increase
the bandwidth usage too much if many long codes are suddenly more common, the
SAMPA will instead use a limited programmable table of codes. The table will only
have codes for the differentially encoded values that are close to zero, as these are
generally the most common. For values that are outside of the table range the raw
sample-value will be prepended by a special assigned codeword. When the stream
is decoded this codeword is still unique, but it instructs the decoder to take the next
10 bits as a raw sample value and continue decoding from there. In a worst case
scenario, where all values in an event is outside the table size, though this is not
possible, the increase in size of a packet will only be about 40%, since the codeword
used for values outside the table will generally be 3-4 bits long.
The bit-length of the payload for an event needs to end on a 10-bit boundary
to conform to the rest of the readout architecture. As the header only dictates the
number of 10-bit words in the payload and not the number of samples, the stream of
data in the payload needs to end in a predictable manner for the Huffman decoder to
decode the data properly. If the last sample in the event is always transmitted as if it
was a value outside the table, then the decoder can have a rule that states that when
a raw encoded sample ends within the last 10-bit word in the payload, then the rest
of the bits should be discarded. This will only have a minor overall impact on the
bandwidth.
2.4.3.2 Bandwidth TPC
Since tracks in the TPC are more plentiful at lower angles, there will be more data
on the channels that are closer to the centre of the barrel than for the outer sections.
Précédent

- 52/173

Suivant