Variance

Calculates the empirical variance of its input signal

    Variance

Library

Blocks/Math

Description

This block calculates the empirical variance of its input signal. It is based on the formula (but implemented in a more reliable numerical way):

y = mean(  (u - mean(u))^2  )

The parameter t_eps is used to guard against division by zero (the variance computation starts at <simulation start time> + t_eps and before that time instant y = 0).

The variance of a signal is also equal to its mean power.

This block is demonstrated in the examples UniformNoiseProperties and NormalNoiseProperties.

Parameters

Variance_0

NameLabelDescriptionData TypeValid Values

mo_t_eps

t_eps

Variance calculation starts at startTime + t_eps

Scalar

mo_t_0

t_0

Start time

Scalar

Variance_1

NameLabelDescriptionData TypeValid Values

mo_u

u

u

Structure

mo_u/fixed

fixed

Cell of scalars

true
false

mo_u/start

start

Cell of scalars

mo_y

y

y

Structure

mo_y/fixed

fixed

Cell of scalars

true
false

mo_y/start

start

Cell of scalars

Ports

NameTypeDescriptionIO TypeNumber

u

implicit

Noisy input signal

input

1

y

implicit

Variance of the input signal

output

1