05-07-2016 06:46 AM
hello,
i have a Labview problem. I need to do a generator of pseudo-random noise test signal with parameters according to standart ITU-T O.131. The main parameter is Crestfaktor which must be in range 10 dB to 11 dB.
Anyone have any idea? Thank you..
05-07-2016 10:35 AM
05-07-2016 11:55 AM
Wow! It must be several decades since I've thought about PRBS's (Pseudo-Random Binary Sequences), a key element of the standard document you reference.
A PRBS is relatively easy to generate if you understand the principle. To generate the 17-bit sequence of the Standard, where bits 3 and 17 become the new bit. I coded this up, but it needs some explanation.
The key step is to create a 17-bit quantity, which I do by creating a Boolean Array of length 17. A proper PRBS must be initialized with any non-zero 17-bit number -- I use a U32 value called "Seed" (but don't check if it is > 131071), along with a Flag that gets set the first time Seed is non-zero (to prevent re-initialization). This is the code shown in the initial Case structure's False
limb, where the non-zero Seed is converted to a 32-bit Boolean Array, 15 bits are discarded, and we have an initialized 17-bit Binary Shift Register (which we store in a LabVIEW Shift Register). The "already-initialized" True Case just passes the Shift Registers through. The rest of the code implements the specified PRBS -- bits 3 and 17 (Array Indices 2 and 16) are XOred, and placed in Position 17 where they will be rotated into Position 1 to produce the next 17-bit PRBS value (after expressing the bit pattern as a new 17-bit integer).
Bob Schor
05-15-2016 07:28 AM
Thank you Bob Schor for the PRBS. Do you know how to solve the Crestfaktor on the output of PRBS? I tried solve this problem, but i could not figure. Btw I have the LabVIEW 2014
Thank you.
05-15-2016 08:49 AM
Sure. The Crest Factor is defined as the ratio of the peak value of a waveform to its RMS value. A PRBS of order N is designed to produce all of the numbers from 1 to the (Nth power of 2 - 1) -- let's call this number P (for "PRBS Size").
I'm going to do this "mathematically" -- it should be an easy exercise to write LabVIEW code to generate a PRBS sequence of arbitrary size, find its peak, find its RMS, and take the ratio, but let's derive what it should be.
So what is the Peak Value of a sequence that takes on all values from 1 to P? [Hint -- it is slightly larger than P-1].
A slightly harder question is what is the RMS value of the P numbers that constitute the PRBS sequence? Well, let's first sort these numbers, and what do we have? Why, the integers from 1 to P. To get the RMS, we need to sum the squares of the integers, divide by the number of them, and take the square root.
The sum of the first P integers is P*(P+1)*(2P+1)/6. Dividing by P give (P+1)*(2P+1)/6. Now simply take the square root of this result.
If we say that P = 2^17 - 1, then the Crest Factor is 1.732. Note that as P gets large, the Crest Factor will approach the square root of 3, which I remember from my high school days as 1.732 ...
Bob Schor
05-15-2016 09:16 AM
OK, I think I understand it. If the Crestfaktor on output should be in the range 10 dB to 11 dB. Crestfaktor = 20*log peak value/RMS value. How to do it?
Thank you again
05-15-2016 11:16 AM
The Crest Factor is a function of the signal. If you are generating a PRBS, you need to understand the meaning of the word "Random" -- you don't "control" it, it is what it is. For a PRBS of infinite duration (which we can model as a PRBS that completes a single cycle, namely, in your 17-stage case, 2^17-1 outputs), we can derive the Crest Factor, which is 1.732. If you want to express this in dB, go right ahead. However, don't try to "adjust" it -- if you want to do that, you'll have to come up with a different signal.
Bob Schor