[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Galois-form LFSR now in trunk (r4613)

From: Trond Danielsen
Subject: Re: [Discuss-gnuradio] Galois-form LFSR now in trunk (r4613)
Date: Fri, 23 Feb 2007 21:03:21 +0100

2007/2/23, Johnathan Corgan <address@hidden>:
An implementation of a Galois-form LFSR pseudo-random sequence generator
is now in the trunk as of r4613.

gr.glfsr_source_b(degree, repeat=True, mask=0, seed=1)

degree: The shift register length, 1-32 inclusive
repeat: whether to repeat once sequence completes (True, False)
        defaults to True
mask:   The LFSR polynomial mask to use.  If not supplied, a suitable
        one is chosen based on the degree specified.
seed:   The initial shift register value.  This should not be zero, and
        if not supplied, defaults to 1

The block outputs a series of bytes equal to 0 or 1, forming a maximal
length sequence (m-sequence) of length 2^degree-1.  The output of this
block can be further processed by other blocks to map it to other
values, pack it into bytes, etc.

The simplest use is to specify only the degree:

src = gr.glfsr_source_b(32)

This will generate a 2^32-1 length m-sequence and repeat until the the
application is exited.

M-sequences are useful as digital noise sources, as they contain energy
at every discrete frequency interval up to the Nyquist frequency, for a
given sampling rate and sequence length.

Johnathan Corgan
Corgan Enterprises LLC

Is this correct?
- - - - - - - - -
gr_glfsr_source_b::gr_glfsr_source_b(int degree, bool repeat, int
mask, int seed)
 : gr_sync_block ("glfsr_source_b",
                  gr_make_io_signature (0, 0, 0),
                  gr_make_io_signature (1, 1, sizeof(unsigned char))),
 if (degree < 1 || degree > 32)
   throw std::runtime_error("gr_glfsr_source_b: degree must be
between 1 and 32 inclusive");
 d_length = (int)(1ULL << degree)-1;
- - - - -

Trond Danielsen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]