**Description**

The Statistical Tests Suite was proposed by the National Institute of Standards and Technology (NIST) in 2001 and implemented in C. The Statistical_Tests class re-implements all tests in C++ using the code from NIST (v1.5) and GNU Scientific Library (GSL).

Each statistical test is implemented as a member function whose output is the vector of computed P-values. Computation details of each test can be written into an ASCII file.

A number of 16 statistical tests are implemented:

- Frequency (Monobit) Test (Statistical_Tests::Frequency)
- Frequency Test within a Block (Statistical_Tests::BlockFrequency)
- Cumulative Sums (Cusum) Test (Statistical_Tests::CumulativeSums)
- Runs Test (Statistical_Tests::Runs)
- Test for the Longest Run of Ones in a Block (Statistical_Tests::LongestRunOfOnes)
- Binary Matrix Rank Test (Statistical_Tests::Rank)
- Discrete Fourier Transform (Spectral) Test (Statistical_Tests::DiscreteFourierTransform)
- Non-overlapping Template Matching Test (Statistical_Tests::NonOverlappingTemplateMatchings)
- Overlapping Template Matching Test (Statistical_Tests::OverlappingTemplateMatchings)
- Maurer's ''Universal Statistical`` Test (Statistical_Tests::Universal)
- Approximate Entropy Test (Statistical_Tests::ApproximateEntropy)
- Random Excursions Test (Statistical_Tests::RandomExcursions)
- Random Excursions Variant Test (Statistical_Tests::RandomExcursionsVariant)
- Serial Test (Statistical_Tests::Serial)
- Lempel-Ziv Compression Test (Statistical_Tests::LempelZivCompression)
- Linear Complexity Test (Statistical_Tests::LinearComplexity)

**In order to use Statistical_Tests class, the GSL must be installed. For example, on a Linux platform, assuming that the GSL and its headers are installed, the compilation commands are (see README.md for further details):**

Usage

Usage

*build*

`mkdir `

*cd*build

*cmake*..

*make*

The compilation should work on Windows by using cmake for Windows, but it has not been tested yet.

Matlab Interface

Matlab Interface

It is possible to call Statistical_Tests class member functions from Matlab using an interface function between Matlab and C++ written in C++. The Matlab function must be called as follows:

```
[freq block_freq cum_sum runs longest_run rank dft non_overlap overlap
univ app_en rand_ex rand_ex_v serial lz_compression complexity] =
C_test(nb_bits, offset_bytes, input_file_name);
```

*mex*-lgsl src/StatisticalTests.cpp src/c_statisticaltests.cpp

The latest sources can be taken from github repository: https://github.com/cristeab/nist. Bug reports and feature requests should be made on github issue tracker: https://github.com/cristeab/nist/issues.