Implementation of Hilbert Spectrum in MATLAB
If $\omega$ is a vector with all the discrete elements $\omega_{j}$ over the descrete time steps $dt$ the correct formula would be dt*cumtrapz(omega); which is the same as cumtrapz(dt,omega) or alternatively if $dt$ isn't constant but $t$ is a vector with evaluation positions Omega=cumtrapz(t,omega,2). The &quot;2&quot; is needed to indicate that the 2nd vector should be integrated.