^{1}

^{*}

^{1}

^{*}

The National Institute of Standards and Technology (NIST) document is a list of fifteen tests for estimating the probability of signal randomness degree.
Test number six in the NIST document is the Discrete Fourier Transform
(DFT) test suitable for stationary incoming sequences. But, for cases where the input sequence is not stationary, the DFT test provides inaccurate results. For these cases, test number seven and eight (the Non-overlapping Template Matching Test and the Overlapping Template Matching Test) of the NIST document were designed to classify those non-stationary sequences. But, even with test number seven and eight of the NIST document, the results are not always accurate. Thus, the NIST test does not give a proper answer for the non-stationary input sequence case. In this paper, we offer a new algorithm
or test, which may replace the NIST tests number six, seven and eight. The
proposed test is applicable also for non-stationary sequences and supplies
more
accurate results than the existing tests (NIST tests number six, seven and
eight), for non-stationary sequences. The new proposed test is based on the Wigner function and on the Generalized Gaussian Distribution (GGD). In addition,
this new proposed algorithm alarms and indicates on suspicious places of
cyclic
sections in the tested sequence. Thus, it gives us the option to repair or to
remove the suspicious places of cyclic sections
** **
(this part is beyond the scope of this paper), so that after that, the repaired or the shortened sequence (original sequence with removed sections) will result as a sequence with high probability of random degree.

In this paper, the problem of estimating the probability of signal randomness degree is addressed, which is widespread used in cryptography applications [

The series obtained from the RNG should be checked if this is not a lacking random series [

The NIST tests [

The NIST tests [

In this paper, we deal with non-stationary sequences for which test number six (the DFT test from the NIST document [

The various tests from NIST [

In this paper, we propose a time-frequency approach, that analysis the input sequence in the frequency and time domain in parallel, by using innovative functions such as the Wigner Distribution [

1) For the first time, the ability to test non-stationary sequences is possible.

2) For the first time, it is possible to locate the periodic section in the tested input sequence.

This approach offers a test that can replace the DFT test in the NIST document [

This paper is organized as follows. In Section 2, we explain the motivation of using the Wigner function in estimating the probability of signal randomness degree. In Section 3, we present the various parameters used for the Wigner test which will be shown in Section 4 to be part of the whole proposed algorithm. In Section 4, we present the structure of the whole algorithm, by using both the Wigner and the GGD functions. In Section 5, we test our new proposed algorithm via simulation and compare the results to those obtained from the NIST (test six, seven and eight [

The Wigner function [

The absolute output values from the Wigner function [

The random signal has no specific frequency, otherwise, the signal is not random. In fact, the random signal behaves like the assembly of multiple signals, which causes some difficulties in identifying processes within the signal.

Our new method should respond to changes in the time domain, where the existing methods (tests) (NIST test [

With the help of the Wigner function [

In the previous section, we have mentioned that the output values from the matrix obtained from the Wigner function [

In the following we present four parameters (“Power”, “Distance”, “Density” and “Highest”) with their range of values for which the input sequence is declared as a random sequence. Please note, in order to declare that the sequence is a random sequence, the four parameters (“Power”, “Distance”, “Density” and “Highest”) must be in the range for which the sequence is declared as a random

sequence. Please note that in the following we mean by “samples” the absolute values from the matrix obtained from the Wigner function [

The parameters are:

1) Power—Describes the height of the samples. To obtain a normalized range— the samples are divided by their maximum obtained value. For the random signal case, the received range must be between: Power = 0.7 - 0.8.

2) Distance—Describes the “distance” and is equal to the number of samples between two samples with “Power” 0.8. To obtain a normalized range—the received value is divided by the number of samples of the tested sequence. In the random signal case, the received “Distance” is: Distance = 0.1 - 0.3.

3) Density—Describes the ratio of the number of samples above the “Power” of 0.75 in the central part of the matrix to the numbers of samples above the “Power” of 0.75 outside the central part of the matrix. For a random signal, a high ratio is being received, meaning that most of the high samples are in the centre of the signal. In order to declare the input sequence as a random sequence, the received “Density” should be: Density > 0.87.

4) Highest—Describes the number of samples above the “Power” of 0.9. In a random signal the received number is Highest < 15.

Simulation Wigner TestThe sequences structure:

For sequence length of 1024 samples:

Sequence number 1—8 × 128 (8 cycles of 128 bits sequence),

Length of sequence | Wigner test | |||||
---|---|---|---|---|---|---|

Power | Distance | Density | Highest | Random | ||

1 | 1024 | 0.9 - 1 | 0.78 | 0.51 | 1208 | no |

2 | 1024 | 0.9 - 1 | 0.72 | 0.56 | 3611 | no |

3 | 1024 | 0.8 - 0.9 | 0.3 | 0.78 | 18 | no |

4 | 1024 | 0.7 - 0.8 | 0.25 | 0.88 | 6 | yes |

5 | 1024 | 0.8 - 0.9 | 0.39 | 0.79 | 19 | no |

6 | 1024 | 0.7 - 0.8 | 0.3 | 0.9 | 19 | no |

7 | 1024 | 0.9 - 1 | 0.47 | 0.83 | 36 | no |

8 | 1024 | 0.9 - 1 | 0.44 | 0.76 | 33 | no |

9 | 2048 | 0.9 - 1 | 0.75 | 0.6 | 3282 | no |

10 | 2048 | 0.9 - 1 | 0.8 | 0.5 | 9182 | no |

11 | 2048 | 0.7 - 0.8 | 0.22 | 0.77 | 13 | no |

12 | 2048 | 0.7 - 0.8 | 0.26 | 0.61 | 7 | no |

13 | 2048 | 0.9 - 1 | 0.29 | 0.91 | 48 | no |

14 | 2048 | 0.7 - 0.8 | 0.3 | 0.91 | 13 | yes |

15 | 2048 | 0.9 - 1 | 0.4 | 0.84 | 43 | no |

16 | 2048 | 0.9 - 1 | 0.4 | 0.8 | 51 | no |

17 | 4096 | 0.9 - 1 | 0.83 | 0.62 | 6346 | no |

18 | 4096 | 0.9 - 1 | 0.7 | 0.51 | 24,527 | no |

19 | 4096 | 0.7 - 0.8 | 0.25 | 0.72 | 4 | no |

20 | 4096 | 0.7 - 0.8 | 0.3 | 0.6 | 11 | no |

21 | 4096 | 0.9 - 1 | 0.42 | 0.92 | 84 | no |

22 | 4096 | 0.7 - 0.8 | 0.35 | 0.93 | 19 | no |

23 | 4096 | 0.9 - 1 | 0.48 | 0.84 | 96 | no |

24 | 4096 | 0.9 - 1 | 0.52 | 0.81 | 124 | no |

Sequence number 2—16 × 64 (16 cycles of 64 bits sequence),

Sequence number 3—768 + 32 × 8 (periodic part in the end of the sequence),

Sequence number 4—32 × 8 + 768 (periodic part in the start of the sequence),

Sequence number 5—384 + 32 × 8 + 384 (periodic part in the middle of sequence),

Sequence number 6—128 + 320 + 128 + 320 + 128,

Sequence number 7—64 + 128 + 64 + 128 + 64 + 128 + 64 + 128 + 64 + 128 + 64,

Sequence number 8—32 × 2 + 128 + 32 × 2 + 128 + 32 × 2 + 128 + 32 × 2 + 128 + 32 × 2 + 128 + 32 × 2.

For sequence length of 2048 samples:

Sequence number 9—8 × 256 (8 cycles of 256 bits sequence),

Sequence number 10—16 × 128 (16 cycles of 128 bits sequence),

Sequence number 11—1536 + 64 × 8 (periodic part in the end of the sequence),

Sequence number 12—64 × 8 + 1536 (periodic part in the start of the sequence),

Sequence number 13—768 + 64 × 8 + 768 (periodic part in the middle of sequence),

Sequence number 14—256 + 640 + 256 + 640 + 256,

Sequence number 15—128 + 256 + 128 + 256 + 128 + 256 + 128 + 256 + 128 + 256 + 128,

Sequence number 16—64 × 2 + 256 + 64 × 2 + 256 + 64 × 2 + 256 + 64 × 2 + 256 + 64 × 2 + 256 + 64 × 2.

For sequence length of 4096 samples:

Sequence number 17—8 × 512 (8 cycles of 512 bits sequence),

Sequence number 18—16 × 256 (16 cycles of 256 bits sequence),

Sequence number 19—3072 + 128 × 8 (periodic part in the end of the sequence),

Sequence number 20—128 × 8 + 3072 (periodic part in the start of the sequence),

Sequence number 21—1536 + 128 × 8 + 1536 (periodic part in the middle of sequence),

Sequence number 22—512 + 1280 + 512 + 1280 + 512,

Sequence number 23—256 + 512 + 256 + 512 + 256 + 512 + 256 + 512 + 256 + 512 + 256,

Sequence number 24—128 × 2 + 512 + 128 × 2 + 512 + 128 × 2 + 512 + 128 × 2 + 512 + 128 × 2 + 512 + 128 × 2

Simulation results:

Please note, in

According to

The general structure of the algorithm can be seen in the block diagram presented in

According to

W [ n , τ ] = f f t ( R s s [ τ , n ] ) (1)

where ω = 2 π f , f stands for the frequency, f f t ( . ) is the Fast Fourier Transform on ( . ) and R s s [ τ , n ] is the Autocorrelation of s ′ [ n ] given by:

R s s [ τ , n ] = E [ ( s ′ [ n ] ∗ s ′ ∗ [ n + τ ] ) ] (2)

where “*” is the multiplication operation, s ′ ∗ [ n ] is the conjugate part of s ′ [ n ] and E [ . ] stands for the expectation operation.

At this point, the decision part of

Changes in the shape parameter of the GGD [

According to the GGD function [

p ( k i ) = { 2 ln 27 16 / ln 3 4 k i 2 if k i ∈ [ 0 , 0.131246 ) 1 2 a 1 ( − a 2 + a 2 2 − 4 a 1 a 3 + 4 a 1 k i ) if k i ∈ [ 0.131246 , 0.448994 ) 1 2 b 3 k i ( b 1 − b 2 k i − _ i ( b 1 − b 2 k i ) 2 − 4 b 3 k i 2 ) if k i ∈ [ 0.448994 , 0.671256 ) 1 2 c 3 ( c 2 − c 2 2 + 4 c 3 ln ( 3 − 4 k i 4 c 1 ) if k i ∈ [ 0.671256 , 0.75 ) (3)

where a 1 = − 0.535707356 , a 2 = 1.168939911 , a 3 = − 0.1516189217 , b 1 = 0.9694429 , b 2 = 0.8727534 , b 3 = 0.07350824 , c 1 = 0.3655157 , c 2 = 0.6723532 , c 3 = 0.033834.

According to [

k i = ( E | W ˜ i | ) 2 E [ ( | W ˜ i | ) 2 ] (4)

where W ˜ i is the i-th column (representing the frequency domain) in the matrix W [ n , ω ] .

Based on Equation (3) and Equation (4) the vector G [ n ] can be defined:

G [ n ] = [ p ( k 1 ) , p ( k 2 ) , p ( k 3 ) , ⋯ , p ( k N ) ]

where N is the length of the tested input sequence.

The vector G [ n ] holds all the changes in the time domain of the shape parameter. An example of the shape parameter vector G [ n ] can be seen in

To simplify the shape parameter signal classification, an average operation is carried out on G [ n ] by averaging every eight following samples of G [ n ] for an input sequence with length of 1024. In generally, the number of samples for the average operation is 8, 16 and 32 for an input sequence with length of 1024, 2048 and 4096 respectively. The averaged signal G [ n ] from

In the following we define:

W ˜ i = W ( i , j ) for i = 1 , 2 , 3 , ⋯ , N ( time domain ) (5)

W ^ j = W ( i , j ) for j = 1 , 2 , 3 , ⋯ , N ( freguency domain ) (6)

According to Equation (4), Equation (5) and Equation (6) we can define:

k i = ( E | W ˜ i | ) 2 E [ ( | W ˜ i | ) 2 ] for i = 1 , 2 , 3 , ⋯ , N ( time domain ) (7)

k ^ j = ( E | W ^ j | ) 2 E [ ( | W ^ j | ) 2 ] for j = 1 , 2 , 3 , ⋯ , N ( freguency domain ) (8)

Therefore, the vectors G [ n ] and G ^ [ n ] can be defined:

G [ n ] = [ p ( k 1 ) , p ( k 2 ) , p ( k 3 ) , ⋯ , p ( k N ) ] ( time domain ) (9)

G ^ [ n ] = [ p ( k ^ 1 ) , p ( k ^ 2 ) , p ( k ^ 3 ) , ⋯ , p ( k ^ N ) ] ( freguency domain ) (10)

After the average operation on G [ n ] and G ^ [ n ] , we get the vectors g ˜ [ n ] and g ^ [ n ] respectively. In the following we set q equal to 1, 2, 4 for an input sequence length of 1024, 2048 and 4096 respectively.

g ˜ [ n ] = [ a 0 , a 8 q , a 16 q , a 24 q , ⋯ , a N − 8 q ] ( time domain )

g ^ [ n ] = [ a ^ 0 , a ^ 8 q , a ^ 16 q , a ^ 24 q , ⋯ , a ^ N − 8 q ] ( freguency domain )

For simplicity we show in the following a j and a ^ j for q = 1 where j = 0 , 8 q , ⋯ , N − 8 q . Please refer to the Appendix for the definition of a j and a ^ j for q equal to two and four.

a j = [ 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] , 1 8 ∑ i = 1 i = 8 G [ i + j ] ]

a ^ j = [ 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] , 1 8 ∑ i = 1 i = 8 G ^ [ i + j ] ]

Detection AlgorithmThe signal D [ n ] is the output from the detection algorithm (

1) Determine whether the sequence is random or not random.

2) Finding the periodic part in the tested input sequence if it exists.

Let us start explaining the first step. Here we apply the histogram function (from Matlab version R2018a) on the vectors g ˜ [ n ] and g ^ [ n ] (obtained from the tested input sequence) in order to have the distribution of the appearance of the values of the shape parameter. In addition, for comparison, we apply also the histogram function on the vectors g ˜ [ n ] and g ^ [ n ] obtained from a random sequence. In order to generate this random sequence, the “randn” function from the Matlab version R2018a is applied which generates “random” numbers from a Gaussian distribution with variance of one and with a zero mean. Next, if the generated number is positive or equal to zero, then the used number is set to one, else it is set to zero. Please note that for some tests in the NIST test [

Please note that in Figures 11-17 the x-axis represents the various values of the shape parameter associated with the tested input sequence, while the y-axis represents the probability density of their appearance. As already was mentioned earlier in this paper, the shape parameter allows us to characterize the absolute values from the matrix obtained from the Wigner function [

In the following, we mean by saying that the test is performed in the time domain that the shape parameter was calculated on each column (representing the frequency domain) in the matrix. In addition, if it is stated that the test is performed in the frequency domain, it means that the shape parameter was calculated on each row (representing the time domain) in the matrix.

The seven test cases are:

Test 1—Checks, whether the maximum height is at the center of the graph and if the width of the graph is smaller than 0.2. This test is performed in the time domain. If the conditions are not met—the signal will be marked as a non- random sequence. An example of this test can be seen in

Test 2—Checks if there is more than one peak in the graph. It looks for the two highest bins in the graph and declares that the tested input sequence is suspected to be a non-random sequence if at least there is one bin between the two highest found bins, and the difference between the heights of those two highest bins is less than 15%. This test is performed in the time domain. An example for this test can be seen in

Test 3—Checks whether the maximum height is obtained in the x-axis between 1.29 and 1.4. If it is outside of this boundary, the sequence is marked as a non-random sequence. This test performed in the time domain. An example of this test can be seen in

Test 4—Checks whether the maximum height is above 0.25. If it is, the tested input sequence is marked as a non-random sequence. This test is performed in the frequency domain. The main idea behind this test is that if there is a concentration around a certain frequency, it indicates that the tested sequence is suspected to have a periodicity within the sequence. An example of this test can be seen in

Test 5—Checks the position of the maximum height of the bin between the time domain and the frequency domain. If there is no match, this indicates that the tested input sequence is a non-random sequence. An example for this test can be seen in

Test 6—This test checks two conditions concerning the heights of the bins. First, it checks if a bin can be found with a height lower than 0.05. Next, it checks whether a bin can be found with a height above 0.2. If no bin is left with a height lower than 0.05 and a bin is found with a height above 0.2, the sequence is announced as a non-random sequence. This test is performed in the time domain. An example for this test can be seen in

Test 7—The pdf should increase monotonically towards the center bin (or to the bin with the maximum height) of the pdf and decrease monotonically from the center bin (or from the bin with the maximum height) downwards. If there is a 40% decrease in the height of a bin with the bin before it, the tested sequence is announced as a non-random sequence. An example for this test can be seen in

Next, we determine the mathematical description of the above seven tests.

First, we define:

∑ i = 1 i = L m ˜ i = 1 ; ∑ i = 1 i = L m ^ i = 1

where m ˜ i and m ^ i holds the number of observations of g ˜ [ n ] and g ^ [ n ] respectively that fall into each of the disjoint bins divided by the length of g ˜ [ n ] and g ^ [ n ] respectively, and L is the total number of bins.

x d ( i ) = min ( g ˜ [ n ] ) + d i f f x d ∗ ( i − 1 ) , i = 1 , 2 , 3 , ⋯ , L

d i f f x d = max ( g ˜ [ n ] ) − min ( g ˜ [ n ] ) L

where x d ( i ) holds the value in the x-axis of the edge where the bin begins.

x ^ d ( i ) = min ( g ^ [ n ] ) + max ( g ^ [ n ] ) − min ( g ^ [ n ] ) L ∗ ( i − 1 ) , i = 1 , 2 , 3 , ⋯ , L

where x ^ d ( i ) holds the value in the x-axis of the edge where the bin begins. It was already mentioned earlier that those bins that have a height less than 0.01 will be deleted and not considered in the seven tests. In addition, after the deletion of those bins that have a height of less than 0.01, the bins that are not close to the center bins are also deleted. Thus, from the mathematical point of view we may write:

Step 1: find the index or indexes where ( m ˜ i < 0.01 ) is true and set those

indexes to i 1 , i 2 , i 3 , ⋯ , i L .

Step 2: set m ˜ i ( i a ) = 0 ; for a = 1 , 2 , 3 , ⋯ , L according to the founded

indexes from Step 1.

Step 3: find max ( m ˜ 1 , m ˜ 2 , ⋯ , m ˜ L ) and set the index i where the maximum

was achieved as i 1

Step 4: a = 1 ;

for i = 1 to ( i 1 − 1 ) checking if there is a bin with m ˜ i = 0 in order to

set “a” as the start of the histogram after this bin.

if m ˜ i = = 0 then

a = i + 1

end

end

Step 5: b = 0 ;

i = i 1 + 1 ;

while ( b = = 0 ) checking if there is a bin with m ˜ i = 0 in order to

set “b” as the end of the histogram before this bin.

if ( i = = L ) then

b = L

end

if ( m ˜ i = = 0 ) then

b = i − 1

end

i = i + 1

end

Test number 1:

Step 1: find max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) and set the index i ( a < i < b ) where the

maximum was achieved as i 1 .

Step 2: if ( | ( b − i 1 ) − ( i 1 − a ) | ≤ 2 & x d ( b ) + d i f f x d − x d ( a ) < 0.2 ) then

D n ( 1 ) = 1 Random signal

else

D n ( 1 ) = 0 Not Random signal

end

Test number 2:

Step 1: find max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) and set the index i ( a < i < b ) where the

maximum was achieved as i 1 .

Step 2: find max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ i 1 − 1 , m ˜ i 1 + 1 , ⋯ , m ˜ b ) and set the index i

( a < i < b ) where the maximum was achieved as i 2 .

Step 3: if ( m ˜ i 1 − m ˜ i 2 m ˜ 1 100 ) < 15 & ( | i 2 − i 1 | ≥ 2 ) then

D n ( 2 ) = 0 Not Random signal

else

D n ( 2 ) = 1 Random signal

end

Test number 3:

Step 1: find max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) and set the index i

( a < i < b ) where the maximum was achieved as i 1 .

Step 2: if 1.29 < x d ( i 1 ) < 1.4 then

D n ( 3 ) = 1 Random signal

else

D n ( 3 ) = 0 Not Random signal

end

Test number 4:

Step 1: if ( max ( m ^ 1 , m ^ 2 , ⋯ , m ^ L ) ) > 0.25 then

D n ( 4 ) = 0 Not Random signal

else

D n ( 4 ) = 1 Random signal

end

Test number 5:

Step 1: find max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) and set the index i

( a < i < b ) where the maximum was achieved as i 1 .

Step 2: find max ( m ^ 1 , m ^ 2 , ⋯ , m ^ L ) and set the index i

( 1 < i < L ) where the maximum was achieved as i 2 .

Step 3: if | x d ( i 1 ) − x ^ d ( i 2 ) | ≤ 0.05 then

D n ( 5 ) = 1 Random signal

else

D n ( 5 ) = 0 Not Random signal

end

Test number 6:

Step 1: if ( max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) > 0.2 ) & ( min ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) > 0.05 )

then

D n ( 6 ) = 0 Not Random signal

else

D n ( 6 ) = 1 Random signal

end

Test number 7:

Step 1: find max ( m ˜ a , m ˜ a + 1 , ⋯ , m ˜ b ) and set the index i

( a < i < b ) where the maximum was achieved as i 1 .

Step 2: D n ( 7 ) = 1 Random signal

for i = a to i 1 checking if there is an increase monotonically

towards the center bin

if ( | m ˜ i − m ˜ i + 1 | m ˜ i 100 ≥ 40 ) & ( m ˜ i > m ˜ i + 1 ) then

D n ( 7 ) = 0 Not Random signal

end

end

for i = i 1 to b checking if there is a decrease monotonically

from the center bin down

if ( | m ˜ i − m ˜ i + 1 | m ˜ i 100 ≥ 40 ) & ( m ˜ i < m ˜ i + 1 ) then

D n ( 7 ) = 0 Not Random signal

end

end

Outcome from the seven tests:

if ∑ k = 1 k = 7 D n ( k ) = = 7 then

D = 1 the tested sequence is Random

else

D = 0 the tested sequence is not Random

end

Please note that when D = 0 we continue to the next step in the algorithm of locating the periodic part.

The second step in the detection algorithm is to find the periodic part in the tested input sequence. For this purpose, we apply three different kind of averages on the tested averaged vector G [ n ] ( g ˜ [ n ] ). This part of the algorithm is performed only on g ˜ [ n ] which represents the time domain, because in this stage we want to locate the periodic part. The three different kind of averages are as follows:

1) The average of the whole vector g ˜ [ n ] (except for some samples at the beginning and at the end) is carried out here. Thus, one average value is obtained. In the following, we denote this kind of averaging as “Average number 1”.

2) The vector g ˜ [ n ] (except for some samples at the beginning and at the end) is divided into 3 parts (40% - 20% - 40%) and then the average operation is carried out on each part. Thus, here we have three average values. In the following, we denote this kind of averaging as “Average number 2”.

3) The vector g ˜ [ n ] (except for some samples at the beginning and at the end) is divided into 3 parts (25% - 50% - 25%) and then the average operation is carried out on each part. Thus, here we have three average values. In the following, we denote this kind of averaging as “Average number 3”.

where by “Margin” we mean that at the beginning and at the end of the averaged tested G [ n ] no averaging operation is carried out. For the case of a 1024, 2048 and 4096 length sequence, the margin on each side is 32 samples, 64 samples and 128 samples respectively.

Now, in order to declare an area to be suspicious of not being a random sequence, we compare the values of the averaged vector G [ n ] to the values of Average number 1, Average number 2 and to Average number 3. In general, if the values of the averaged vector G [ n ] are above or below the average number (Average number 1 ± ε 1 , Average number 2 ± ε 2 , Average number 3 ± ε 3 where ε 1 , ε 2 and ε 3 are predefined values) for some tested values that come in sequence, a suspicious place is declared. For more details, please refer to Figures 19-21 which describe in more details the comparison operation between the values of the averaged vector G [ n ] and the Average number 1 to Average number 3.

Figures 22-25 show the simulated results obtained for a non-random sequence with length of 1024 where the averaged vector G [ n ] ( g ˜ [ n ] ) was compared to the three different kind of averages (Average number 1, Average number 2, Average number 3) while

In the following, we describe the flowchart for finding the suspicious places of the periodic parts in the tested input sequence by using the values for Average number 1, Average number 2 and Average number 3.

Comparison to Average number 1:

Step 1: set g a v e r a g e 1 = [ g ˜ ( e d g e ) , g ˜ ( e d g e + 1 ) , ⋯ , g ˜ ( N − e d g e ) ] .

“edge” is the length of the margin defined as 32, 64 and 128 for a 1024,

2048 and 4096 length of input sequence respectively.

The input sequence length is defined as N.

Step 2: set Average number 1 = g a v e r a g e 1 N − 2 ∗ e d g e

Step 3: set g t e s t 1 a = [ g ˜ ( e d g e ) , g ˜ ( e d g e + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.25 ⌋ ) ]

where ⌊ ( . ) ⌋ is the rounding down operation on ( . ) .

Step 4:find the index or indexes where ( g t e s t 1 a > 1.01 ∗ A v e r a g e n u m b e r 1 )

is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.25 ⌋ − e d g e + 1

Step 5: set g c o m p a r i s o n 1 a ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.25 ⌋ − e g d e + 1 )

according to the founded indexes of Step 4.

Step 6: find the number of groups in g c o m p a r i s o n 1 a of consecutive samples

equal to one and set this number to K1.

Step 7: find the length of those groups of consecutive samples equal to one

from Step 6 and hold them in the vector:

l e n g t h 1 a ( j ) ; for j = 1 , ⋯ , K 1

Step 8: find the start and end position of the founded groups from

Step 6 and hold them in the matrix:

p l a c e 1 a ( j , i ) ; for j = 1 , ⋯ , K 1 ; i = 1 , 2

Step 9: set n u m b e r 1 a = K 1

A1 = 20, 40 and 80 for 1024, 2048 and 4096 length of sequence respectively.

for j = 1 to K1

if l e n g t h 1 a ( j ) < A 1 then

n u m b e r 1 a = n u m b e r 1 a − 1

for i = p l a c e 1 a ( j , 1 ) to p l a c e 1 a ( j , 2 )

g c o m p a r i s o n 1 a ( i ) = 0

end

end

end

Step 10: set g t e s t 1 b = [ g ˜ ( ⌊ N ∗ 0.45 ⌋ ) , g ˜ ( ⌊ N ∗ 0.45 ⌋ + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.55 ⌋ ) ]

Step 11: find the index or indexes where ( g t e s t 1 b < 0.97 ∗ A v e r a g e n u m b e r 1 )

is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.55 ⌋ − ⌊ N ∗ 0.45 ⌋ + 1

Step 12: set g c o m p a r i s o n 1 b ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.55 ⌋ − ⌊ N ∗ 0.45 ⌋ + 1 ) according to the

founded indexes of Step 11.

Step 13: find the number of groups in g c o m p a r i s o n 1 b of consecutive samples

equal to one and set this number to K2.

Step 14: find the length of those groups of consecutive samples equal to one

from Step 13 and hold them in the vector:

l e n g t h 1 b ( j ) ; for j = 1 , ⋯ , K 2

Step 15: find the start and end position of the founded groups from

Step 13 and hold them in the matrix:

p l a c e 1 b ( j , i ) ; for j = 1 , ⋯ , K 2 ; i = 1 , 2

Step 16: set n u m b e r 1 b = K 2

A2 = 33, 56 and 95 for 1024, 2048 and 4096 length of sequence respectively.

for j = 1 to K2

if l e n g t h 1 b ( j ) < A 2 then

n u m b e r 1 b = n u m b e r 1 b − 1

for i = p l a c e 1 b ( j , 1 ) to p l a c e 1 b ( j , 2 )

g c o m p a r i s o n 1 b ( i ) = 0

end

end

end

Step 17: set g t e s t 1 c = [ g ˜ ( ⌊ N ∗ 0.75 ⌋ ) , g ˜ ( ⌊ N ∗ 0.75 ⌋ + 1 ) , ⋯ , g ˜ ( N − e d g e ) ] .

Step 18: find the index or indexes where ( g t e s t 1 c > 1.01 ∗ A v e r a g e n u m b e r 1 )

is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N − e d g e ⌋ − ⌊ N ∗ 0.75 ⌋ + 1

Step 19: set g c o m p a r i s o n 1 c ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N − e d g e ⌋ − ⌊ N ∗ 0.75 ⌋ + 1 )

according to the founded indexes of Step 18.

Step 20: find the number of groups in g c o m p a r i s o n 1 c of consecutive samples

equal to one and set this number to K3.

Step 21: find the length of those groups of consecutive samples equal to one

from Step 20 and hold them in the vector:

l e n g t h 1 c ( j ) ; for j = 1 , ⋯ , K 3

Step 22: find the start and end position of the founded groups from

Step 20 and hold them in the matrix:

p l a c e 1 c ( j , i ) ; for j = 1 , ⋯ , K 3 ; i = 1 , 2

Step 23: set n u m b e r 1 c = K 3

for j = 1 to K3

if l e n g t h 1 c ( j ) < A 1 then

n u m b e r 1 c = n u m b e r 1 c − 1

for i = p l a c e 1 c ( j , 1 ) to p l a c e 1 c ( j , 2 )

g c o m p a r i s o n 1 c ( i ) = 0

end

end

end

Comparison to Average number 2:

Step 1: set g a v e r a g e 2 a = [ g ˜ ( e d g e ) , g ˜ ( e d g e + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.4 ⌋ ) ]

g a v e r a g e 2 b = [ g ˜ ( ⌊ N ∗ 0.6 ⌋ + 1 ) , g ˜ ( ⌊ N ∗ 0.6 ⌋ + 2 ) , ⋯ , g ˜ ( ⌊ N − e d g e ⌋ ) ]

Step 2: set l e n 2 a = ⌊ N ∗ 0.4 ⌋ − e d g e

l e n 2 b = ( ( N − e d g e ) ) − ( ⌊ N ∗ 0.6 ⌋ )

Step 3: set A v e r a g e n u m b e r 2 = [ g a v e r a g e 2 a l e n 2 a , g a v e r a g e 2 b l e n 2 b ]

Step 4: set g t e s t 2 a = [ g ˜ ( ⌊ N ∗ 0.24 ⌋ ) , g ˜ ( ⌊ N ∗ 0.24 ⌋ + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.35 ⌋ ) ]

Step 5: find the index or indexes where

( g t e s t 2 a > 1.002 ∗ A v e r a g e n u m b e r 2 ( 1 ) ) is true and set those

indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.35 ⌋ − ⌊ N ∗ 0.24 ⌋ + 1

Step 6: set g c o m p a r i s o n 2 a ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.35 ⌋ − ⌊ N ∗ 0.24 ⌋ + 1 )

according to the founded indexes of Step 5.

Step 7: find the number of groups in g c o m p a r i s o n 2 a of consecutive samples

equal to one and set this number to K4.

Step 8: find the length of those groups of consecutive samples equal to one

from Step 7 and hold them in the vector:

l e n g t h 2 a ( j ) ; for j = 1 , ⋯ , K 4

Step 9: find the start and end position of the founded groups from

Step 7 and hold them in the matrix:

p l a c e 2 a ( j , i ) ; for j = 1 , ⋯ , K 4 ; i = 1 , 2

Step 10: set n u m b e r 2 a = K 4

A3 = 17, 48 and 129 for 1024, 2048 and 4096 length of sequence respectively.

for j = 1 to K4

if l e n g t h 2 a ( j ) < A 3 then

n u m b e r 2 a = n u m b e r 2 a − 1

for i = p l a c e 2 a ( j , 1 ) to p l a c e 2 a ( j , 2 )

g c o m p a r i s o n 2 a ( i ) = 0

end

end

end

Step 11: set g t e s t 2 b = [ g ˜ ( ⌊ N ∗ 0.65 ⌋ ) , g ˜ ( ⌊ N ∗ 0.65 ⌋ + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.76 ⌋ ) ]

Step 12: find the index or indexes where

( g t e s t 2 b > 1.002 ∗ A v e r a g e n u m b e r 2 ( 2 ) ) is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.76 ⌋ − ⌊ N ∗ 0.65 ⌋ + 1

Step 13: set g c o m p a r i s o n 2 b ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.76 ⌋ − ⌊ N ∗ 0.65 ⌋ + 1 )

according to the founded indexes of Step 12.

Step 14: find the number of groups in g c o m p a r i s o n 2 b of consecutive samples

equal to one and set this number to K5.

Step 15: find the length of those groups of consecutive samples equal to one

from Step 14 and hold them in the vector:

l e n g t h 2 b ( j ) ; for j = 1 , ⋯ , K 5

Step 16: find the start and end position of the founded groups from

Step 14 and hold them in the matrix:

p l a c e 2 b ( j , i ) ; for j = 1 , ⋯ , K 5 ; i = 1 , 2

Step 17: set n u m b e r 2 b = K 5

for j = 1 to K5

if l e n g t h 2 b ( j ) < A 3 then

n u m b e r 2 b = n u m b e r 2 b − 1

for i = p l a c e 2 b ( j , 1 ) to p l a c e 2 b ( j , 2 )

g c o m p a r i s o n 2 b ( i ) = 0

end

end

end

Comparison to Average number 3:

Step 1: set g a v e r a g e 3 a = [ g ˜ ( e d g e ) , g ˜ ( e d g e + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.25 ⌋ ) ]

g a v e r a g e 3 b = [ g ˜ ( ⌊ N ∗ 0.25 ⌋ + 1 ) , g ˜ ( ⌊ N ∗ 0.25 ⌋ + 2 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.75 ⌋ ) ]

g a v e r a g e 3 c = [ g ˜ ( ⌊ N ∗ 0.75 ⌋ + 1 ) , g ˜ ( ⌊ N ∗ 0.75 ⌋ + 2 ) , ⋯ , g ˜ ( ⌊ N − e d g e ⌋ ) ]

Step 2: set l e n 3 a = ( ⌊ N ∗ 0.25 ⌋ ) − e d g e

l e n 3 b = ( ⌊ N ∗ 0.75 ⌋ ) − ( ⌊ N ∗ 0.25 ⌋ )

l e n 3 c = ( ( N − e d g e ) ) − ( ⌊ N ∗ 0.75 ⌋ )

Step 3: set A v e r a g e n u m b e r 3 = [ g a v e r a g e 3 a l e n 3 a , g a v e r a g e 3 b l e n 3 b , g a v e r a g e 3 c l e n 3 c ]

Step 4: set g t e s t 3 a = [ g ˜ ( ⌊ N ∗ 0.34 ⌋ ) , g ˜ ( ⌊ N ∗ 0.34 ⌋ + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.45 ⌋ ) ]

Step 5: find the index or indexes where ( g t e s t 3 a > A v e r a g e n u m b e r 3 ( 1 ) )

is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.45 ⌋ − ⌊ N ∗ 0.34 ⌋ + 1

Step 6: set g c o m p a r i s o n 3 a ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.45 ⌋ − ⌊ N ∗ 0.34 ⌋ + 1 )

according to the founded indexes of Step 5.

Step 7: find the number of groups in g c o m p a r i s o n 3 a of consecutive samples

equal to one and set this number to K6.

Step 8: find the length of those groups of consecutive samples equal to one

from Step 7 and hold them in the vector:

l e n g t h 3 a ( j ) ; for j = 1 , ⋯ , K 6

Step 9: find the start and end position of the founded groups from

Step 7 and hold them in the matrix:

p l a c e 3 a ( j , i ) ; for j = 1 , ⋯ , K 6 ; i = 1 , 2

Step 10: set n u m b e r 3 a = K 6

for j = 1 to K6

if l e n g t h 3 a ( j ) < A 3 then

n u m b e r 3 a = n u m b e r 3 a − 1

for i = p l a c e 3 a ( j , 1 ) to p l a c e 3 a ( j , 2 )

g c o m p a r i s o n 3 a ( i ) = 0

end

end

end

Step 11: set g t e s t 3 b = [ g ˜ ( ⌊ N ∗ 0.55 ⌋ ) , g ˜ ( ⌊ N ∗ 0.55 ⌋ + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.66 ⌋ ) ]

Step 12: find the index or indexes where ( g t e s t 3 b > A v e r a g e n u m b e r 3 ( 3 ) )

is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.66 ⌋ − ⌊ N ∗ 0.55 ⌋ + 1

Step 13: set g c o m p a r i s o n 3 b ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.66 ⌋ − ⌊ N ∗ 0.55 ⌋ + 1 )

according to the founded indexes of Step 12.

Step 14: find the number of groups in g c o m p a r i s o n 3 b of consecutive samples

equal to one and set this number to K7.

Step 15: find the length of those groups of consecutive samples equal to one

from Step 14 and hold them in the vector:

l e n g t h 3 b ( j ) ; for j = 1 , ⋯ , K 7

Step 16: find the start and end position of the founded groups from

Step 14 and hold them in the matrix:

p l a c e 3 b ( j , i ) ; for j = 1 , ⋯ , K 7 ; i = 1 , 2

Step 17: set n u m b e r 3 b = K 7

for j = 1 to K7

if l e n g t h 3 b ( j ) < A 3 then

n u m b e r 3 b = n u m b e r 3 b − 1

for i = p l a c e 3 b ( j , 1 ) to p l a c e 3 b ( j , 2 )

g c o m p a r i s o n 3 b ( i ) = 0

end

end

end

Step 18: set g t e s t 3 c = [ g ˜ ( ⌊ N ∗ 0.45 ⌋ ) , g ˜ ( ⌊ N ∗ 0.45 ⌋ + 1 ) , ⋯ , g ˜ ( ⌊ N ∗ 0.55 ⌋ ) ]

Step 19: find the index or indexes where

( g t e s t 3 c > 1.05 ∗ A v e r a g e n u m b e r 3 ( 2 ) )

is true and set those indexes to i 1 , i 2 , i 3 , ⋯ , i ⌊ N ∗ 0.55 ⌋ − ⌊ N ∗ 0.45 ⌋ + 1

Step 20: set g c o m p a r i s o n 3 c ( i a ) = 1 ;

for a = 1 , 2 , 3 , ⋯ , ( ⌊ N ∗ 0.55 ⌋ − ⌊ N ∗ 0.45 ⌋ + 1 )

according to the founded indexes of Step 19.

Step 21: find the number of groups in g c o m p a r i s o n 3 c of consecutive samples

equal to one and set this number to K8.

Step 22: find the length of those groups of consecutive samples equal to one

from Step 21 and hold them in the vector:

l e n g t h 3 c ( j ) ; for j = 1 , ⋯ , K 8

Step 23: find the start and end position of the founded groups from

Step 21 and hold them in the matrix:

p l a c e 3 c ( j , i ) ; for j = 1 , ⋯ , K 8 ; i = 1 , 2

Step 24:

A4 = 9, 15 and 63 for 1024, 2048 and 4096 length of sequence respectively.

for j = 1 to K8

if l e n g t h 3 c ( j ) < A 4 then

n u m b e r 3 c = n u m b e r 3 c − 1

for i = p l a c e 3 c ( j , 1 ) to p l a c e 3 c ( j , 2 )

g c o m p a r i s o n 3 c ( i ) = 0

end

end

end

Fine tuning on the above obtained results:

The algorithm has also false alarms at the stage of marking the suspected parts as periodic. Therefore, there is a mechanism which deletes some of the false alarms which is described in the following.

Step 1: if ( n u m b e r 1 a = = 1 ) & ( n u m b e r 1 c > 1 ) then

g c o m p a r i s o n 1 a = 0

end

Step 2: if ( n u m b e r 1 a > 1 ) & ( n u m b e r 1 c = = 1 ) then

g c o m p a r i s o n 1 c = 0

end

Step 3: if ( n u m b e r 2 a = = 1 ) & ( n u m b e r 2 b > 1 ) then

g c o m p a r i s o n 2 a = 0

end

Step 4: if ( n u m b e r 2 a > 1 ) & ( n u m b e r 2 b = = 1 ) then

g c o m p a r i s o n 2 b = 0

end

Step 5: if ( n u m b e r 3 a > 0 ) or ( n u m b e r 3 b > 0 ) then

g c o m p a r i s o n 3 c = 0

end

The last stage is to connect all the vectors with the suspicious locations as a periodic part to one outcome vector.

Step 6: Initialize the following vectors with zeros of length N:

g c o m p a r i s o n 1 a * , g c o m p a r i s o n 1 b * , g c o m p a r i s o n 1 c * , g c o m p a r i s o n 2 a * , g c o m p a r i s o n 2 b * , g c o m p a r i s o n 3 a * , g c o m p a r i s o n 3 b * , g c o m p a r i s o n 3 c * .

Step 7: Arrange the values in the vectors

g c o m p a r i s o n 1 a , g c o m p a r i s o n 1 b , g c o m p a r i s o n 1 c g c o m p a r i s o n 2 a , g c o m p a r i s o n 2 b , g c o m p a r i s o n 3 a , g c o m p a r i s o n 3 b , g c o m p a r i s o n 3 c

to their position in the original vector g ˜ [ n ] by using the vectors from

Step 6.

g c o m p a r i s o n 1 a * ( i + e d g e ) = g c o m p a r i s o n 1 a ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 1 a )

g c o m p a r i s o n 1 b * ( i + ⌊ N ∗ 0.45 ⌋ ) = g c o m p a r i s o n 1 b ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 1 b )

g c o m p a r i s o n 1 c * ( i + ⌊ N ∗ 0.75 ⌋ ) = g c o m p a r i s o n 1 c ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 1 c )

g c o m p a r i s o n 2 a * ( i + ⌊ N ∗ 0.24 ⌋ ) = g c o m p a r i s o n 2 a ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 2 a )

g c o m p a r i s o n 2 b * ( i + ⌊ N ∗ 0.65 ⌋ ) = g c o m p a r i s o n 2 b ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 2 b )

g c o m p a r i s o n 3 a * ( i + ⌊ N ∗ 0.34 ⌋ ) = g c o m p a r i s o n 3 a ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 3 a )

g c o m p a r i s o n 3 b * ( i + ⌊ N ∗ 0.54 ⌋ ) = g c o m p a r i s o n 3 b ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 3 b )

g c o m p a r i s o n 3 c * ( i + ⌊ N ∗ 0.45 ⌋ ) = g c o m p a r i s o n 3 c ( i ) ;

for i = 1 , 2 , ⋯ , l e n g t h ( g c o m p a r i s o n 3 c )

Step 8: Obtain one output vector which holds the suspicious places in g ˜ [ n ] .

s u s p i c i o u s _ p l a c e s [ n ] = g c o m p a r i s o n 1 a * + g c o m p a r i s o n 1 b * + g c o m p a r i s o n 1 c * + g c o m p a r i s o n 2 a * + g c o m p a r i s o n 2 b * + g c o m p a r i s o n 3 a * + g c o m p a r i s o n 3 b * + g c o m p a r i s o n 3 c * .

Wigner Test Vs DFT NIST Test

In this section we first show the simulation results (

New Test Vs NIST Tests

It should be pointed out that the tested input sequences used for generating the results in

Length of sequence | Wigner | DFT | ||||||
---|---|---|---|---|---|---|---|---|

Power | Distance | Density | Highest | Random | P value | Random | ||

1 | 1024 | 0.9 - 1 | 0.78 | 0.51 | 1208 | no | 1.2e-04 | no |

2 | 1024 | 0.9 - 1 | 0.72 | 0.56 | 3611 | no | yes | |

3 | 1024 | 0.8 - 0.9 | 0.3 | 0.78 | 18 | no | 0.4559 | yes |

4 | 1024 | 0.7 - 0.8 | 0.25 | 0.88 | 6 | yes | 0.6464 | yes |

5 | 1024 | 0.8 - 0.9 | 0.39 | 0.79 | 19 | no | 0.4913 | yes |

6 | 1024 | 0.7 - 0.8 | 0.3 | 0.9 | 19 | no | 0.4913 | yes |

7 | 1024 | 0.9 - 1 | 0.47 | 0.83 | 36 | no | 0.6881 | yes |

8 | 1024 | 0.9 - 1 | 0.44 | 0.76 | 33 | no | 0.0665 | yes |

9 | 2048 | 0.9 - 1 | 0.75 | 0.6 | 3282 | no | 7.2e-12 | no |

10 | 2048 | 0.9 - 1 | 0.8 | 0.5 | 9182 | no | 0.7151 | yes |

11 | 2048 | 0.7 - 0.8 | 0.22 | 0.77 | 13 | no | 0.6881 | yes |

12 | 2048 | 0.7 - 0.8 | 0.26 | 0.61 | 7 | no | 0.1215 | yes |

13 | 2048 | 0.9 - 1 | 0.29 | 0.91 | 48 | no | 0.207 | yes |

14 | 2048 | 0.7 - 0.8 | 0.3 | 0.91 | 13 | yes | 0.3304 | yes |

15 | 2048 | 0.9 - 1 | 0.4 | 0.84 | 43 | no | 0.0027 | no |

16 | 2048 | 0.9 - 1 | 0.4 | 0.8 | 51 | no | 0.0167 | yes |

17 | 4096 | 0.9 - 1 | 0.83 | 0.62 | 6346 | no | 1.3e-21 | no |

18 | 4096 | 0.9 - 1 | 0.7 | 0.51 | 24,527 | no | 0.5281 | yes |

19 | 4096 | 0.7 - 0.8 | 0.25 | 0.72 | 4 | no | 0.1687 | yes |

20 | 4096 | 0.7 - 0.8 | 0.3 | 0.6 | 11 | no | 0.0031 | no |

21 | 4096 | 0.9 - 1 | 0.42 | 0.92 | 84 | no | 0.2758 | yes |

22 | 4096 | 0.7 - 0.8 | 0.35 | 0.93 | 19 | no | 0.0963 | yes |

23 | 4096 | 0.9 - 1 | 0.48 | 0.84 | 96 | no | 0.002 | no |

24 | 4096 | 0.9 - 1 | 0.52 | 0.81 | 124 | no | 0.2175 | yes |

Test 8 NIST | Test 7 NIST | Test 6 NIST | Test 3 NIST | Test 2 NIST | Test 1 NIST | NIST test | New test | Structure |
---|---|---|---|---|---|---|---|---|

0.0733 | - | 0.4913 | 0.348 | 0.518 | 0.95 | Non random | Non random | Structure number 1 |

0.364 | 0.341 | 0.491 | 0.144 | 0.556 | 0.26 | Random | Non random |

0.837 | 0.916 | 0.122 | 0.231 | 0.34 | 0.189 | Random | Non random | |
---|---|---|---|---|---|---|---|---|

0.122 | - | 0.067 | 0.537 | 0.804 | 0.189 | Non random | Non random | |

0.102 | 0.409 | 0.122 | 0.799 | 0.367 | 0.169 | Random | Non random | |

0.17 | - | 0.067 | 0.047 | 0.197 | 0.104 | Non random | Non random | Structure number 2 |

0.793 | 0.372 | 0.688 | 0.575 | 0.932 | 0.803 | Random | Non random | |

0.045 | 0.553 | 0.6881 | 0.0541 | 0.258 | 0.532 | Random | Non random | |

0.145 | - | 0.207 | 0.552 | 0.709 | 0.317 | Non random | Non random | |

0.095 | 0.538 | 0.646 | 0.42 | 0.403 | 0.137 | Random | Non random | |

0.865 | 0.145 | 0.329 | 0.629 | 0.834 | 0.453 | Random | Non random | Structure number 3 |

0.016 | - | 0.909 | 0.247 | 0.598 | 0.317 | Non random | Non random | |

0.736 | 0.752 | 0.207 | 0.163 | 0.559 | 0.608 | Random | Non random | |

0.689 | - | 0.0665 | 0.912 | 0.223 | 0.492 | Non random | Non random | |

- | - | 0.908 | 0.617 | 0.993 | 0.95 | Non random | Non random | |

0.865 | 0.081 | 0.491 | 0.497 | 0.836 | 0.617 | Random | Non random | Structure number 4 |

0.167 | 0.123 | 0.456 | 0.667 | 0.945 | 0.617 | Random | Non random | |

0.736 | - | 0.207 | 0.855 | 0.634 | 0.708 | Non random | Non random | |

0.576 | 0.458 | 0.688 | 0.255 | 0.879 | 0.532 | Random | Random | |

0.322 | 0.301 | 0.688 | 0.193 | 0.655 | 0.118 | Random | Non random | |

0.859 | - | 0.456 | - | 0.644 | 0.851 | Non random | Random | Structure number 5 |

0.593 | - | 0.1215 | - | 0.056 | 0.317 | Non random | Non random | |

0.767 | 0.196 | 0.688 | 0.418 | 0.489 | 0.169 | Random | Non random | |

0.349 | 0.752 | 0.491 | 0.254 | 0.289 | 0.211 | Random | Non random | |

0.72 | 0.659 | 0.329 | 0.094 | 0.984 | 0.492 | Random | Non random | |

0.409 | 0.538 | 0.646 | 0.803 | 0.997 | 1 | Random | Non random | Structure number 6 |

0.647 | 0.107 | 0.909 | 0.951 | 0.827 | 0.901 | Random | Random | |

0.239 | 0.752 | 0.122 | 0.19 | 0.308 | 0.754 | Random | Non random | |

0.249 | 0.288 | 0.329 | 0.144 | 0.197 | 0.382 | Random | Non random | |

0.593 | 0.597 | 0.688 | 0.436 | 0.912 | 0.249 | Random | Non random |

The sequences structure:

Structure number 1: 128, 320, 128, 320, 128.

Structure number 2: 150, 170, 384, 170, 150.

Structure number 3: 100, 824, 100.

Structure number 4: 50, 924, 50.

Structure number 5: 200, 100, 324, 100, 300.

Structure number 6: 312, 100, 200, 100, 312.

(The number marked in red marks the periodic part in the sequence.)

Simulation results—Random or Non-random:

Simulation results—Estimating the Random places:

Next, we compare the simulated results obtained from our new algorithm “New test” to those obtained by the 15 tests from NIST [

According to Figures 27-30, our new proposed algorithm (“New test”) finds that all the input sequences are non-random as it should in contrary to the NIST tests [

Although the presented examples (Figures 27-30) refer to a sequence length of 1024 samples only, the algorithm can also be applied successfully for longer sequences such as for 2048 or 4096 samples by changing only a few parameters within the algorithm. It should be pointed out that according to [^{3} to 10^{7}) for many of the tests in [

In this paper, we proposed a new approach for estimating the probability of signal randomness degree based on the Wigner and GGD functions which allowed us to classify the input sequence in the time and frequency domains at the same time. Our new proposed approach is suitable also for non-stationary input sequences where the NIST tests fail. In addition, this new proposed algorithm has the ability to indicate on suspicious places of cyclic sections in the tested sequence. Thus, the option to repair or to remove the suspicious places of cyclic sections in the tested input sequence is given with this new approach which was not available until now. Simulation results have confirmed the effectiveness of our new proposed method for estimating the probability of signal randomness degree for non-stationary input sequences. It should be pointed out here that the values for the four parameters (“Power”, “Distance”, “Density” and “Highest”) were not optimized. Thus, it is possible to get even better results in identifying if the tested sequence is random or not.

The authors would like to thank the Israeli Innovation Authority and Defender Cyber Technologies LTD for their support for research under the Academic Knowledge Guidance Program (Nofar) File No. 63907.

A Patent Application incorporating this paper has been filed.

The authors declare no conflicts of interest regarding the publication of this paper.

Avraham, Y. and Pinchas, M. (2021) A New Approach for the DFT NIST Test Applicable for Non- Stationary Input Sequences. Journal of Signal and Information Processing, 12, 1-41. https://doi.org/10.4236/jsip.2021.121001

The mathematical description for g ˜ [ n ] and g ^ [ n ] with an input sequence length of 2048 and 4096 respectively is:

g ˜ [ n ] = [ a 0 , a 8 q , a 16 q , a 24 q , ⋯ , a N − 8 q ] ( time domain )

g ^ [ n ] = [ a ^ 0 , a ^ 8 q , a ^ 16 q , a ^ 24 q , ⋯ , a ^ N − 8 q ] ( freguency domain )

a j and a ^ j where

j = 0 , 8 q , 16 q , ⋯ , N − 8 q .

For q = 2 :

a j = [ 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] , 1 16 ∑ i = 1 i = 16 G [ i + j ] ]

a ^ j = [ 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] , 1 16 ∑ i = 1 i = 16 G ^ [ i + j ] ]

For q = 4 :

a j = [ 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] ,

1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] , 1 32 ∑ i = 1 i = 32 G [ i + j ] ]

a ^ j = [ 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] ,

1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] , 1 32 ∑ i = 1 i = 32 G ^ [ i + j ] ]