GNU Radio's DSD Package
p25p1_hdu.h
Go to the documentation of this file.
1
2#ifndef P25P1_HDU_H_9f95c3a5072842e8aaf94444e1452d20
3#define P25P1_HDU_H_9f95c3a5072842e8aaf94444e1452d20
4
5
6#include "p25p1_heuristics.h"
7
8/**
9 * Reads a dibit (two bits) from the stream of data. Takes into account the periodic occurrence of status
10 * bits that show up every 36 dibits. Status bits are discarded.
11 * \param opts A pointer the the DSD options.
12 * \param state A pointer the the DSD state structure.
13 * \param output A pointer to be filled with the dibit read. Two bytes used for each dibit.
14 * \param status_count Variable used to keep track of the status symbols in the dibit stream. There is one
15 * status every 36 dibits. With this counter we can skip the status.
16 * \param analog_signal A pointer with the actual analog value read from the input signal and that has been
17 * interpreted as the dibit we are returning in output.
18 * \param did_read_status Address were a boolean is returned. This is set to true when one status symbol was
19 * read (and skipped). This indicates that the sequence on dibits has been broken and is used by the P25
20 * heuristics.
21 */
22int read_dibit (dsd_opts* opts, dsd_state* state, char* output, int* status_count, int* analog_signal,
23 int* did_read_status);
24
25/**
26 * Reads a number of dibits and stores its value together with the actual analog value that has been
27 * intrepreted as the dibit into an AnalogSignal structure. This is used later in the P25 heuristics module
28 * to improve the accuracy of the digitizer.
29 * \param opts A pointer the the DSD options.
30 * \param state A pointer the the DSD state structure.
31 * \param output A pointer to be filled with the dibits read.
32 * \param count The number of bits to read (remember: 1 dibit = 2 bits).
33 * \param status_count Variable used to keep track of the status symbols in the dibit stream. There is one
34 * status every 36 dibits. With this counter we can skip the status.
35 * \param analog_signal_array The pointer to the start of a sequence of AnalogSignal structures. The
36 * information is updated for each dibit read.
37 * \param analog_signal_index The actual index into the AnalogSignal array. This is increased here wich each
38 * dibit read.
39 */
40void read_dibit_update_analog_data (dsd_opts* opts, dsd_state* state, char* buffer, unsigned int count,
41 int* status_count, AnalogSignal* analog_signal_array, int* analog_signal_index);
42
43/**
44 * Reads a word, made up of length bits or length/2 dibits. Also keeps track of the status dibits.
45 */
46void read_word (dsd_opts* opts, dsd_state* state, char* word, unsigned int length, int* status_count,
47 AnalogSignal* analog_signal_array, int* analog_signal_index);
48
49/**
50 * Reads 4 bits from the stream of data. Those are the parity bits that follow each hex word.
51 */
52void read_hamm_parity (dsd_opts* opts, dsd_state* state, char* parity, int* status_count,
53 AnalogSignal* analog_signal_array, int* analog_signal_index);
54
55/**
56 * Reads 12 bits from the stream of data. Those are the extended Golay parity bits that follow a word of data.
57 */
58void read_golay24_parity (dsd_opts* opts, dsd_state* state, char* parity, int* status_count, AnalogSignal* analog_signal_array, int* analog_signal_index);
59
60/**
61 * Reads bits from the data stream that should all be zeros. This is valuable information for the
62 * heuristics module and we update it.
63 * \param opts A pointer the the DSD options.
64 * \param state A pointer the the DSD state structure.
65 * \param analog_signal_array The pointer to the start of a sequence of AnalogSignal structures.
66 * \param length Number of bits to read.
67 * \param status_count Variable used to keep track of the status symbols in the dibit stream.
68 * \param new_sequence Bool used to update the sequence_broken value of the first AnalogSignal element.
69 */
70void read_zeros(dsd_opts* opts, dsd_state* state, AnalogSignal* analog_signal_array, unsigned int length,
71 int* status_count, int new_sequence);
72
73#endif // P25P1_HDU_H_9f95c3a5072842e8aaf94444e1452d20
void read_word(dsd_opts *opts, dsd_state *state, char *word, unsigned int length, int *status_count, AnalogSignal *analog_signal_array, int *analog_signal_index)
void read_dibit_update_analog_data(dsd_opts *opts, dsd_state *state, char *buffer, unsigned int count, int *status_count, AnalogSignal *analog_signal_array, int *analog_signal_index)
void read_hamm_parity(dsd_opts *opts, dsd_state *state, char *parity, int *status_count, AnalogSignal *analog_signal_array, int *analog_signal_index)
int read_dibit(dsd_opts *opts, dsd_state *state, char *output, int *status_count, int *analog_signal, int *did_read_status)
void read_golay24_parity(dsd_opts *opts, dsd_state *state, char *parity, int *status_count, AnalogSignal *analog_signal_array, int *analog_signal_index)
void read_zeros(dsd_opts *opts, dsd_state *state, AnalogSignal *analog_signal_array, unsigned int length, int *status_count, int new_sequence)
Definition p25p1_heuristics.h:24
Definition dsd.h:62
Definition dsd.h:129