function get_ltsaparams
%
% get parameters needed for generating LTSA's from user
%
% called by mk_ltsa
%
% stolen from neptune program get_psdsparams
% 060508 smw
% 060914 smw modified for wav files
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global PARAMS

if PARAMS.ltsa.ftype == 1    % wav file - Ishmael generated...
    prompt={'Enter Time Average Length [seconds] : ',...
        'Enter Frequency Bin Size [Hz] :'};
elseif PARAMS.ltsa.ftype == 2    % xwav file type
    prompt={'Enter Time Average Length [seconds] : ',...
        'Enter Frequency Bin Size [Hz] :',...
        'XWAV data recorded by HARP = 1, ARP = 2, OBS = 3 : '};
end


def={num2str(PARAMS.ltsa.tave),...
    num2str(PARAMS.ltsa.dfreq),...
    num2str(PARAMS.ltsa.dtype)};

dlgTitle='Set Long-Term Spectrogram Parameters';
lineNo=1;
AddOpts.Resize='on';
AddOpts.WindowStyle='normal';
AddOpts.Interpreter='tex';
% display input dialog box window
in=inputdlg(prompt,dlgTitle,lineNo,def,AddOpts);
if length(in) == 0	% if cancel button pushed
    PARAMS.ltsa.gen = 0;
    return
else
    PARAMS.ltsa.gen = 1;
end

PARAMS.ltsa.tave = str2num(deal(in{1}));

PARAMS.ltsa.dfreq = str2num(deal(in{2}));

if PARAMS.ltsa.ftype == 1        % wav file generated by Ishmael
    PARAMS.ltsa.dtype = 4;
elseif PARAMS.ltsa.ftype == 2    % xwav file
    PARAMS.ltsa.dtype = str2num(deal(in{3}));
    if PARAMS.ltsa.dtype ~= 1 & PARAMS.ltsa.dtype ~= 2 & PARAMS.ltsa.dtype ~= 3
        disp_msg(['Wrong XWAV data type : ',num2str(PARAMS.ltsa.dtype)])
        disp_msg('Should be 1, 2 or 3')
        get_ltsaparams
    end
end

% set LTSA version type for ARP XWAVs
if PARAMS.ltsa.dtype == 2
    PARAMS.ltsa.ver = 3;    % 32 bits (~ 4billon nave and nrftot allowed)
end

% choose channel to LTSA if there is more than one channel in data file(s)
if PARAMS.ltsa.nch(1) > 1

    prompt={['Enter which channel to LTSA from 1 to ',...
        num2str(PARAMS.ltsa.nch),' : ']};

    def={num2str(1)};

    dlgTitle='Choose Channel to LTSA';
    lineNo=1;
    AddOpts.Resize='on';
    AddOpts.WindowStyle='normal';
    AddOpts.Interpreter='tex';
    % display input dialog box window
    in2=inputdlg(prompt,dlgTitle,lineNo,def,AddOpts);
    if length(in2) == 0	% if cancel button pushed
        PARAMS.ltsa.ch = 1
    else
        PARAMS.ltsa.ch = str2num(deal(in2{1}));
    end

end