# Noise design¶

SLiCAP has a number of built-in scripts to support circuit designers with the analysis and design of the stationary noise behavior of electronic circuits. These functions can be used to process the result of the execution of an instruction with the data type set to NOISE. These functions are listed below and discussed in detail in the following sections.

Please notice that some of these functions use symbolic integration which may fail if the frequency dependency of the spectra becomes too complex.

In the brief descriptions below, we assume that a noise simulation comprising j runs (j-1 steps), has been performed.

## Correlated double sampling¶

Correlated double sampling is a popular technique to reduce the influence of low-frequency noise and switching noise of sample and hold circuits. The post processing function doCDS.m can be used for this purpose. This function requires one argument $$\tau$$ which represents the time delay between the two samples. CDS is implemented as a continuous-time post-processing function. The sampling itself is not modeled. The CDS post processor returns the spectra of the difference between the signal and its delayed copy (delayed over $$\tau$$ seconds). The squared magnitude of the frequency-domain transfer $$| H\left(f\right) |^2$$ of this operation can be written as:

$| H\left(f\right) |^2=| 1 - \exp{(-2 \pi f \tau)} |^2$

which can alternatively be written as:

$| H\left(f\right) |^2=(2 \sin(\pi f \tau))^2$

The doCDS function replaces all detector-referred spectral density results $$S_{x}$$ in the .results field with $$(2 \sin(\pi f \tau))^2 S_{x}$$. It also replaces both the lists with the source-referred noises pectral density contributions and the total source referred noise spectra in the .results field with the MuPAD boolean FALSE. It returns the modified execution result with its .postProc field set to 'CDS'.

sym('tau');
dataType('noise');
result            = execute();
CDSresult         = doCDS(result, tau);

## Extract source-referred noise¶

The function getInoise.m extracts and returns the j source-referred noise spectra from the .results field. If a second, optional argument sourceName is given, it returns the contribution to the source-referred noise spectrum of the noise source sourceName only.

dataType('noise');
result            = execute();
iNoiseSpectrum    = getInoise(result);       % Spectrum of the total source-referred noise
iNoiseContribV1   = getInoise(result, 'V1'); % Contribution of the noise source V1
% in the source-referred noise spectrum

## Extract detector-referred noise¶

The function getOnoise.m extracts and returns the j detector-referred noise spectra from .results field. If a second, optional argument sourceName is given, it returns the contribution to the source-referred noise spectrum of the noise source sourceName only.

dataType('noise');
result            = execute();
oNoiseSpectrum    = getOnoise(result);
oNoiseContribV1   = getOnoise(result, 'V1'); % Contribution of the noise source 'V1'
% in the detector-referred noise sprectrum

## RMS noise¶

The function RMSnoise.m can be used to calculate the total RMS noise over a frequency range. The function requires two additional arguments $$f_{min}$$ and $$f_{max}$$ and returns the j RMS values:

$RMS_j=\sqrt{\int_{f_{min}}^{f_{max}} S_{source,j} df}$

If the noise spectra $$S_{source,j}$$ we obtained after application of correlated double sampling, a fourth optional argument tau which represents the delay dime in the sampler, can be given. This will easy the symbolic calculation of the integral $$\mathrm{Si}(\phi)=\int{\left(\frac{\sin{\phi}}{\phi}\right)^2d\phi}$$, where $$\phi=2\pi f\tau$$, and $$\tau$$ is the sampler delay.

Below the calculation of the total RMS source-referred noise over a frequency range from 10Hz to 10MHz, with and without CDS:

dataType('noise');
result            = execute();
soureRefNoiseRMS  = RMSnoise(getInoise(result), 10, 1E7);
tau               = 1E-6;
resultCDS         = doCDS(result, tau);
detRefRMSNoiseCDS = RMSnoise(getOnoise(resultCDS), 10, 1E7, tau);