GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
glfsr.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2007,2012,2016 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_DIGITAL_GLFSR_H
12#define INCLUDED_DIGITAL_GLFSR_H
13
15#include <cstdint>
16
17namespace gr {
18namespace digital {
19
20/*!
21 * \brief Galois Linear Feedback Shift Register using specified polynomial mask
22 * \ingroup waveform_generators_blk
23 *
24 * \details
25 * Generates a maximal length pseudo-random sequence of length 2^degree-1
26 * if given a primitive polynomial.
27 */
29{
30private:
31 uint64_t d_shift_register;
32 uint64_t d_mask;
33
34public:
35 glfsr(uint64_t mask, uint64_t seed)
36 {
37 d_shift_register = seed;
38 d_mask = mask;
39 }
41
42 static uint64_t glfsr_mask(unsigned int degree);
43
44 uint8_t next_bit();
45
46 uint64_t mask() const { return d_mask; }
47};
48
49} /* namespace digital */
50} /* namespace gr */
51
52#endif /* INCLUDED_DIGITAL_GLFSR_H */
Galois Linear Feedback Shift Register using specified polynomial mask.
Definition: glfsr.h:29
glfsr(uint64_t mask, uint64_t seed)
Definition: glfsr.h:35
static uint64_t glfsr_mask(unsigned int degree)
uint64_t mask() const
Definition: glfsr.h:46
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29