Average trace

Added the option to apply an average on a trace