Averaging the signals

Hello, I wanted to know how to average the signal if my signal is varying from (-0.5 to +0.5) and i want to consider it to be zero. How do we make use of derivative. I get to see compilation error when i used derivative for averaging the signal.

Thanks & Regards shivashankar

Averaging values

Hello Everybody,

The solution of using Mean smooth block is not working out even in real time embedded operation as the averaging window is of limited value with respect to Stack & heap memory which while compiling it shows an error.

Also using filters is a tricky one because we never know, what would be the noise on variables exactly in real time embedded operation. Cant we have a simple averaging of values say 100 values added together & divide it by 100 & then consider the value by setting a counter of 100. Thus averaging those values & then consider it further in the code. This can be easily done in C. How can it be done in Vissim.

Please suggest. Thanks.

Please send us your C code to

Please send us your C code to average 100 values that does not require a buffer of 100 elements and we will use it.

You can use a low-pass IIR

You can use a low-pass IIR filter, or you can use the Matrix Operation > meanSmooth block.
The derivative block should compile fine, but is not recommended for real-time embedded operation, especially not for averaging. You can use a 1/Z block to subtract previous value from current to get derivative. This tends to give poor results in the presence of noise. Better is the transfer function tf(t) = s/(Tc*s + 1), where Tc is the time constant of the fastest signal you want to take the derivative of.