Engee documentation

Mean

Calculates the average value of the signal.

mean

Description

The Mean block calculates the average value of the input signal. The average value is calculated using a moving average window over a period defined by the fundamental frequency .

where

  • - input signal;

  • - period, is defined as .

Since this block uses a moving average window, one simulation cycle must pass before the correct value is obtained at the output. For the first simulation cycle, the output value is kept constant and matches the given initial input value.

Ports

Input

# Port_1 - input signal
scalar | vector

Details

The input signal for which the unit calculates the average value.

Output

# X - average value of the input signal
scalar | vector

Details

The average value of the input signal.

Parameters

Main group

# Fundamental frequency (Hz) — fundamental frequency

Details

Specify the fundamental frequency in Hz. This value defines the size (1/ ) of the moving average window.

Default value

50

Program usage name

f

Evaluatable

Yes

# Initial input (DC component) — input value for the first simulation cycle

Details

Specify the input value for the first simulation cycle.

Default value

0

Program usage name

V_start

Evaluatable

Yes

# Sample time — sampling period

Details

Specify the sampling period of the block in seconds. Set to 0 to realise a continuous block.

Default value

0

Program usage name

sample_time

Evaluatable

Yes

Additional options

C code generation: Yes