You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_voice_onset.m
    path of file: ./repos/spm/toolbox/DEM
    
    the code of the file until where you have to start completion: function [i] = spm_voice_onset(Y,FS,u,v)
% Identify intervals containing acoustic energy and post onset minima
% FORMAT [i] = spm_voice_onset(Y,FS,u,v)
%
% Y    - timeseries
% FS   - sampling frequency
% u,v  - thresholds for onset and offset [default: 1/16]
%
% i    - intervals (time bins) containing spectral energy
%
% This routine identifies epochs constaining spectral energy in the power
% envelope, defined as the root mean square (RMS) power. The onset and

    
function [i] = spm_voice_onset(Y,FS,u,v)
% Identify intervals containing acoustic energy and post onset minima
% FORMAT [i] = spm_voice_onset(Y,FS,u,v)
%
% Y    - timeseries
% FS   - sampling frequency
% u,v  - thresholds for onset and offset [default: 1/16]
%
% i    - intervals (time bins) containing spectral energy
%
% This routine identifies epochs constaining spectral energy in the power
% envelope, defined as the root mean square (RMS) power. The onset and
% offset of words is evaluated in terms of the first and last threshold
% crossings.
%
% This routine is a simple version of spm_voice_onset and is retained for
% diagnostic purposes.
%
% see also: spm_voice_onsets.m
%__________________________________________________________________________

% Karl Friston
% Copyright (C) 2008-2022 Wellcome Centre for Human Neuroimaging
% find the interval that contains spectral energy
%==========================================================================

% thresholds for onsets and offsets
%--------------------------------------------------------------------------
if nargin < 3, u = 1/16; v = 1/16; end