#define UNIT e3_normalize #include "test_main.cpp" signal_t normalize( const signal_t &s ) { double m = 0; signal_t out; for ( double x : s ) m = std::max( m, x ); if ( m == 0 ) m = 1; for ( double x : s ) out.push_back( x / m ); return out; }