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: generate_synth.m
    path of file: ./repos/fieldtrip/external/lagextraction/data/synth
    
    the code of the file until where you have to start completion: function [EEG,ref,latency,snr] = generate_synth(EEG,options)
%   GENERATE_SYNTH   
%       [EEG,REF,LATENCY,SNR] = GENERATE_SYNTH(EEG,OPTIONS)

    
function [EEG,ref,latency,snr] = generate_synth(EEG,options)
%   GENERATE_SYNTH   
%       [EEG,REF,LATENCY,SNR] = GENERATE_SYNTH(EEG,OPTIONS)
% 
%   Created by Alexandre Gramfort on 2009-05-10.
%   Copyright (c)  Alexandre Gramfort. All rights reserved.

% $Id: generate_synth.m 2 2009-06-16 19:24:10Z gramfort $
% $LastChangedBy: gramfort $
% $LastChangedDate: 2009-06-16 15:24:10 -0400 (Mar, 16 jui 2009) $
% $Revision: 2 $

if nargin<2
    options.null = 0;
end