GNU Radio C++ API Reference: glfsr.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
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
14#include <gnuradio/digital/api.h>
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 */
28 class DIGITAL_API glfsr
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 }
40 ~glfsr();
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 */
gr::digital::glfsr::glfsr
glfsr(uint64_t mask, uint64_t seed)
Definition glfsr.h:35
gr::digital::glfsr::next_bit
uint8_t next_bit()
gr::digital::glfsr::glfsr_mask
static uint64_t glfsr_mask(unsigned int degree)
gr::digital::glfsr::mask
uint64_t mask() const
Definition glfsr.h:46
gr::digital::glfsr::~glfsr
~glfsr()
api.h
DIGITAL_API
#define DIGITAL_API
Definition gr-digital/include/gnuradio/digital/api.h:18
gr::digital
Definition adaptive_algorithm.h:22
gr
GNU Radio logging wrapper.
Definition basic_block.h:29