# Franklin noise-generator

The following sections gives an introduction to the generation of model noise using the noise generator implemented in LTPDA.

## Franklin's noise generator

Franklin's noise generator is a method to generate arbitrarily long time series with a prescribed spectral density. The algorithm is based on the following paper:

Franklin, Joel N.: Numerical simulation of stationary and non-stationary gaussian random processes , SIAM review, Volume { 7}, Issue 1, page 68--80, 1965.

The Document Generation of Random time series with prescribed spectra by Gerhard Heinzel (S2-AEI-TN-3034)
corrects a mistake in the aforesaid paper and describes the practical implementation.

See Generating model noise for more general information on this.

Franklin's method does not require any 'warm up' period. It starts with a transfer function given as ratio of two polynomials.
The generator operates on a real state vector y of length n which is maintained between invocations. It produces samples of the time series in equidistant steps T = 1/fs, where fs is the sampling frequency.

• y0 = Tinit * r, on initialization
• yi = E * yi-1 + Tprop * r, to propagate
• xi = a * yi , the sampled time series.
r is a vector of independent normal Gaussian random numbers Tinit, E, Tprop which are real matrices and a which is a real vector are determined once by the algorithm.

## Description

When an analysis object is constructed from a pole zero model Franklin's noise generator is called (compare Creating AOs from pole zero models).

## Inputs

for the function call the parameter list has to contain at least:
• nsecs - number of seconds (length of time series)
• fs - sampling frequency
• pzmodel with gain

## Outputs

• b - analysis object containing the resulting time series

## Usage

The analysis object constructor ao calls the following four functions when the input is a pzmodel.
• ngconv
• ngsetup
• nginit
• ngprop

First a parameter list of the input parameters is to be done. For further information on this look at Creating parameter lists from parameters.

## Starting from a given pole/zero model

The parameter list should contain the number of seconds the resulting time series should have nsecs and the sampling frequency fs.
The constructor call should look like this:

```    f1 = 5;
f2 = 10;
f3 = 1;
gain = 1;
fs = 10;  % sampling frequency
nsecs = 100; % number of seconds to be generated
p = [pz(f1) pz(f2)];
z = [pz(f3)];
pzm = pzmodel(gain, p, z);
a = ao(pzm, plist('nsecs', nsecs, 'fs', fs))

```
The output will be an analysis object a containing the time series with the spectrum described by the input pole-zero model.