function fid_con

% FID_CON Show the help for the functions in this toolbox.

% This file is automatically generated.  Matthew Simoneau, 09-04-98
% Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
% $Revision: 1.13 $ $Date: 1998/10/16 23:19:15 $

helpwin('fid_con/Contents');

function Contents
%MATLAB Tour Partial Function Help:  fid_con
%
%Double click on any function for more information
%
%  Frequency Domain Identification Toolbox.
%  Version 2.0.3 (R11) 29-Sep-1998
% 
%  New Features.
%    Readme      - Important release information about the Frequency Domain
%                  Identification Toolbox (double click on Readme, or type
%                  "whatsnew directoryname", i.e. "whatsnew fdident" to
%                  display this file).
% 
%  Excitation Signal Design
%    dibs        - Discrete interval binary system design.
%    dibsimpr    - Improve discrete interval binary sequence.
%    lin2qlog    - Quasi-logarithmic frequency set from linear grid
%    log2qlog    - Quasi-logarithmic frequency set from logarithmic grid
%    mlbs        - Maximum length binary sequence
%    msinclip    - Crest factor minimization of a multisine
%    msinprep    - Time domain multisine for downloading
%    optexcit    - Excitation signal with optimum power spectrum
% 
%  Preprocessing of Data
%    modifyfv    - Prefiltering of data by inverse of known partial tf
%    tim2fou     - Time domain to frequency domain conversion
%    varanal     - Variance analysis
% 
%  Estimation
%    elis        - General parameter estimation routine
%    eliscost    - Value of the elis cost function
%    elisml      - Simple interface to elis for common estimation problems
%    elistper    - Identify system, starting from time domain periodic i/o data
%    elisqa      - Generate run parameter settings for elis
%    elrpf2v     - List run parameter file or convert to run parameter vectors
%    elrpv2f     - List run parameter vectors or convert to run parameter file
%    gmean       - Geometric mean of complex vectors and numbers
% 
%  Presentation of Results
%    expvect     - Export vectors to ASCII files for plotting etc.
%    gmean       - Geometric mean of complex vectors and numbers
%    ploteltf    - Plot transfer functions and confidence intervals
%    plotelpz    - Plot pole/zero patterns with uncertainty ellipses
%    tfcalc      - Calculate transfer function values in different domains
% 
%  Model Validation
%    fdcovpzp    - Transfer function parameters and covariances from poles/zeros
%    simfou      - Simulate frequency domain data
%    simtime     - Simulate time domain data
%    rdueelis    - Residuals after identification
%    stdpz       - Standard deviations of poles and zeros of tf
%    stdtf       - Standard deviations of magnitude and phase of tf
%    stdtfm      - Empirical standard deviations of Y/X points
% 
%  Data Vector and File Read/Write
%    elisfcnv    - Conversion between different file formats
%    expcov      - Write data to covariance vector or file
%    expfou      - Write data to Fourier vector or file
%    exppar      - Write data to parameter vector or file
%    exptim      - Write data to time domain data vector or file
%    expvar      - Write data to variance vector or file
%    expvect     - Export vectors to ASCII files for plotting etc.
%    impcov      - Read data from covariance vector or file
%    impfou      - Read data from Fourier vector or file
%    imppar      - Read data from parameter vector or file
%    imptim      - Read data from time domain data vector or file
%    impvar      - Read data from variance vector or file
%    loadasc     - Load contents of ASCII file into variable
% 
%  Model Conversions
%    elis2tha    - ELiS to theta format conversion (Identification Toolbox)
%    tha2elis    - Theta format to ELiS conversion
% 
%  Other
%    digitnum    - Number of mantissa digits necessary to represent numbers
%    fdiddemo    - Demonstrations for the toolbox
%    gmean       - Geometric mean of complex vectors and numbers
%    iterctrl    - Iteration control using pull-down menu
%    loadvar     - Load value of single variable from mat file
%    pairs       - Find closest point pairs in two complex vectors
%    savevar     - Save variable into existing mat file
%    yesinput    - "Intelligent" input function with default value
%    ywalk       - yulewalk without windowing
% 
%  For more information, visit the FDIDENT User Page at
%    http://www.mathworks.com/support/updates/fdident/index.shtml
%-------------------------------------------
%
%  Demonstrations for the FDIDENT Toolbox
% 
%  Main demonstration routines
%    bookdemo    - Frame of demonstrations based on measured data
%    demos       - Matlab V5 demonstration interface 
%    fddems1     - subroutine for 'demos': list of general demonstrations
%    fddems2     - subroutine for 'demos': list of book demonstrations
%    fdiddemo    - Frame program to call all demonstrations
% 
%  General demonstrations 
%    dibsdemo    - Discrete interval binary sequence design
%    eltpexpl    - Sample file for identification based on periodic i/o data
%    fdcourse    - "Course": problems for self-study
%    fdsynchr    - Sample file for experiment synchronization
%    gmeandem    - Geometric mean of complex numbers
%    mscldemo    - Crest factor minimization               
%    msprdemo    - Time function preparation     
%    mlbsdemo    - Maximum length binary sequence design
%    optexdem    - Optimal excitation signal design (calls optexde1, optexde2)
%    pairsdem    - Optimal one-by-one pairing of two point sets
%    pzdemo      - Plot pole/zero pattern with confidence ellipses
%    simudemo    - Simulation and estimation example of the usage of the Toolbox
%    tfdemo      - Plot transfer functions with confidence intervals
%    varandem    - Variance analysis and synchronization of data
% 
%  Demonstrations with measured data
%    alupldem    - Identification of a system - glued aluminum plates
%    bandpdem    - Identification of a system - passive bandpass filter
%    bpcordem    - Phase correction of a bandpass filter
%    cabledem    - Cable fault location
%    crankdem    - Identification of a system - crankcase
%    emachdem    - Identification of a system - electrical machine
%    glfibdem    - Identification of a system - rectangular glass fiber plate
%    inpchdem    - Compensation of an input channel
%    lowpdemo    - Identification of a system - active lowpass filter
%    lpelabex    - Elaborated example of the system identification procedure
%    rarmdemo    - Identification of a system - flexible robot arm
% 
%  Plot and print measured data
%    fdidpaus    - Stop to show messages in Command Window
%    grapause    - Save graph, pause, handle messages
%    plotcabl    - Plot time records of cable measurements
%    plotfou     - Plot Fourier data from *.fbn files
%    plotvar     - Plot variance data from *.vbn files
%    plotrarm    - Plot time domain data from robotarm.mat
%

function Readme
%MATLAB Tour Partial Function Help:  fid_con
%
% README info, Frequency Domain System Identification Toolbox
% Last modified: 29-Sep-1998
% 
% Most changes are mere additions, and do not influence the running of old
% M-files. Exceptions are the modified calls of plotelpz and maybe exppar,
% imppar and tim2fou, further the substitution of the output argument Cp of
% elis by the numerically more robust CR.
%   - The latest findings show that CR is somewhat more reliable than Cp,
%   - so in the place of Cp, CR is exported.
% 
% New file elistper
%   Identification starting from time domain data
% 
% New file elisml
%   A simple, user-friendly interface to elis, the main estimation routine.
% 
% New file tfcalc
%   Calculation of transfer function values from different models
% 
% New file iterctrl
%   Pull-down menu to request early termination, pause, etc, for elis
% 
% New file digitnum
%   Number of mantissa digits necessary to represent numbers
% 
% New file eliscost
%   Value of the elis cost function
% 
% Extended functionality of elis
%   - additional new way of setting the initial fit (approximate LS)
%   - possibility of early termination/pause/abortion through GUI (see iterctrl)
%   - possibility of scaling mag/phase plots in radHz, to match pole/zero plot
% 
% Slightly modified user calls of plotelpz, tim2fou, exppar and imppar
%   New:
%        [rnum,rdenom]=plotelpz(pdat,cdat,Pc,axv,ntx,Znum,Zdenom,domain,da,dp,plm)
%        [Fdat,dt]=tim2fou(tdat,freqv,expi,fmod)
%        pvect=exppar(domain,num,denom,delay,fs,Znum,Zdenom,fname,cmts,fdate)
%        [domain,num,denom,delay,fs,Znum,Zdenom,comments,fdate]=imppar(pdat,fsc)
%   Old:
%        [rnum,rdenom]=plotelpz(pdat,axv,cdat,Pc,ntx,Znum,Zdenom,domain,da,dp,plm)
%        [x,y,fv,dt]=tim2fou(tdat,freqv,expi,fmod)
%        pvect=exppar(domain,num,denom,delay,fs,fname,comments,fdate)
%        [domain,num,denom,delay,fs,comments,fdate]=imppar(pdat,fsc)
% 
% Modified plots of ploteltf
%   Magnitude/phase plots are now wide, rather than tall
%   msc allows now '*' (default) for complex errors, and '=' for both 
%     amplitude and phase
% 
% Extended functionality of loadasc
%   loadasc can read now arrays from a file with comments
%   it can also return the comments from a file, and the header of the file,
%     along with the line numbers of the data and the comments
% 
% Improvement of the suggested scaling frequency in EXPPAR
%   In the routine  EXPPAR  an improved formula is implemented for the
%   calculation of the suggested scaling frequency. This formula is different
%   from that given in page 2-31 of the manual.
%   In Matlab-notations the improved formula is:
%       fs = 2/3/(nn+nd) * ( sum( abs(b(0:nn-1)/b(nn)).^(1.0./(nn:-1:1)) ) + ...
%                      sum( abs(a(0:nd-1)/a(nd)).^(1.0./(nd:-1:1)) ) )
%   The above expression describes the structure of the formula
%   rather than representing a valid Matlab expression.
%   The null indexes will not work in Matlab, furthermore the coefficients
%   of the s-domain polynomials are stored in descending order of the powers
%   in Matlab.
% 
% Extended functionality of msinclip
%   Two options, 'ZOHd' or 'ZOHc' in gmod, define now how to exactly understand
%   the desired amplitudes. 'ZOHd' means that the spectrum is just the DFT
%   of the time sequence, while 'ZOHc' assigns the desired amplitudes
%   to the spectrum of the output of the zero-order hold.
% 
% New input argument in log2qlog
%   The new input argument df0 allows to slightly rescale the frequency
%   vector in order to allow fit to the FFT grid when the number of data
%   in a record and the sampling frequency are given.
% 
% For more information, visit the FDIDENT User Page at
%   http://www.mathworks.com/support/updates/fdident/index.shtml

function dibs
%MATLAB Tour Partial Function Help:  fid_con
%
% DIBS   Discrete interval binary sequence with given amplitude distribution.
% 
%        [bitser,ampopt,Puf,Ptot]=DIBS(N,dt,freqv,ampv,trialno,graphmod,model)
% 
%        The iterations are based on signum operations in the time domain. The
%        output is the generated series for which the minimum ratio of designed
%        and desired amplitudes is maximal.
% 
%        Output arguments:
%        bitser = generated bit series (values +1,-1)
%        ampopt = complex amplitudes of the optimal series (coefficients of the
%            complex Fourier series) at frequencies in freqv.
%            The amplitudes are scaled in such a way that the total
%            power of the designed signal is set to be equal to the total
%            desired power, prescribed by ampv.
%        Puf = useful power (as a fraction of the total power)
%        Ptot = total desired signal power
% 
%        Input arguments:
%        N = length of the bit series to be generated, minimum: 2
%        dt = time interval between successive bits (seconds)
%        freqv = vector of frequencies where the amplitudes are given:
%            the elements must be integer multiples of 1/(N*dt),
%            0 <= freqv <= 0.5/dt, minimum length: 1.
%        ampv = absolute values of the desired complex amplitudes
%            (coefficients of the complex Fourier series)
%            at the corresponding frequencies.
%            If any element of ampv is complex, one trial will be made using
%            the phases of ampv as starting value.
%            Default: ampv=ones(length(freqv),1)
%        trialno = number of iteration loops, default: 25.
%            (each loop starting from a random phase multisine)
%        graphmod = if this is given with the value 'nograph', iteration
%            results will not be plotted, otherwise they will be plotted.
%        model = 'discr' or 'd' for discrete-time, 'cont' or 'c' for
%            continuous-time modeling. In the latter case, the amplitudes
%            are predistorted by reciprocal of the transfer function of the
%            zero-order hold, nothing special is done for discrete time.
%            Default: 'c'.  tf_ZOH = sin(pi*freqv*dt)./(pi*freqv*dt).
% 
%        Usage:
%          [bitser,ampopt,Puf,Ptot]=dibs(N,dt,freqv,ampv,trialno,graphmod,model);
%        Example: bits0=dibs(16,1e-3,[2:5]/1e-3/16,[1,1,1,.5]);
% 
%        

function dibsimpr
%MATLAB Tour Partial Function Help:  fid_con
%
% DIBSIMPR Improve discrete interval binary sequence.
% 
%        [bitser,ampopt,Puf,Ptot]=DIBSIMPR(bits0,dt,freqv,ampv,itno,gmod,model)
% 
%        Output arguments:
%        bitser = generated bit series (values +1,-1)
%        ampopt = complex amplitudes of the optimal series (coefficients of the
%            complex Fourier series) at frequencies in freqv).
%            The amplitudes are scaled in such a way that the total
%            power of the designed signal is set to be equal to the total
%            desired power, prescribed by ampv.
%        Puf = useful power (as a fraction of the total power)
%        Ptot = total desired signal power
% 
%        Input arguments:
%        bits0 = previously designed bit sequence
%        dt = time interval between successive bits (seconds)
%        freqv = vector of frequencies where the amplitudes are given:
%                the elements must be integer multiples of 1/(N*dt),
%                0 <= freqv <= 0.5/dt, minimum length: 1.
%        ampv = absolute values of the desired complex amplitudes
%            (coefficients of the complex Fourier series)
%            at the corresponding frequencies.
%            Default: ampv=ones(length(freqv),1)
%        itno = maximum number of iteration loops, default: 1
%        gmod = if this is given with the value 'nograph', iteration
%            results will not be plotted, otherwise they will be plotted.
%        model = 'discr' or 'd' for discrete-time, 'cont' or 'c' for
%            continuous-time modeling. In the latter case, the amplitudes
%            are predistorted by reciprocal of the transfer function of the
%            zero-order hold, nothing special is done for discrete time.
%            Default: 'c'.  tf_ZOH = sin(pi*freqv*dt)./(pi*freqv*dt).
% 
%        Usage:
%         [bitser,ampopt,Puf,Ptot]=dibsimpr(bits0,dt,freqv,ampv,itno,gmod,model);
%        Example: bits0=dibs(16,1e-3,[2:5]/1e-3/16,[1,1,1,.5]);
%                 [bitser,ampopt]=dibsimpr(bits0,1e-3,[2:5]/1e-3/16,[1,1,1,.5]);
% 
%        

function lin2qlog
%MATLAB Tour Partial Function Help:  fid_con
%
% LIN2QLOG Quasilogarithmic subset of a linear frequency grid.
% 
%        [fqlog,df,cdmax,freqind]=LIN2QLOG(freqv,rf)
% 
%        The routine starts from a linear frequency grid, given in freqv, and
%        selects a quasi-logarithmic set, providing that the ratio of successive
%        frequencies is about  rf (or larger, if the frequency vector is not
%        dense enough).
% 
%        Algorithm: starting from the first non-zero frequency point, the next
%        point f2 will be the one in freqv, closest to f1*rf, and larger than
%        f1. The points between f1 and f2 are deleted. This is repeated until
%        the end of the file: the last point will only be taken if the last
%        frequency is larger than f(n-1)*sqrt(rf).
% 
%        Output arguments:
%        fqlog = quasi-log frequency vector (column vector)
%        df = minimum common divider of the values in freqv
%            The harmonic numbers in fqlog can be calculated as
%            harmno=round(fqlog/df);
%        cdmax = maximum common divider of the harmonic numbers
%        freqind = column vector, indices of the selected
%            frequency points in freqv
% 
%        Input arguments:
%        freqv = strictly monotonic increasing frequency vector
%            (usually with constant increments)
%        rf = desired frequency ratio
% 
%        Usage: [fqlog,df,cdmax,freqind]=lin2qlog(freqv,rf);
%        Example: fqlog=lin2qlog([1:128],sqrt(2));
% 
%        

function log2qlog
%MATLAB Tour Partial Function Help:  fid_con
%
% LOG2QLOG Quasilogarithmic approximation of a logarithmic set of points.
% 
%        [fqlog,df,cdmax,freqind]=LOG2QLOG(freqv,mhno,df0)
% 
%        The routine starts from the given, supposedly logarithmic frequency set
%        freqv, and rounds these frequencies to values of the linear (DFT)
%        frequency grid. The harmonic number mhno will be associated to the
%        highest frequency. If df0 is given, the frequency vector will be scaled
%        to make the maximum frequency equal to mhno*df0.
% 
%        Algorithm: the points of fqlog will be the points of the grid
%        max(freqv)*[1:mhno]/mhno,  closest to any of the points of freqv.
% 
%        Output arguments:
%        fqlog = quasi-log frequency vector (column vector)
%        df = (optional) minimum common divider of the values in freqv
%            The harmonic numbers in fqlog can be calculated as
%            harmno=round(fqlog/df);
%        cdmax = maximum common divider of the harmonic numbers
%        freqind = (optional) column vector, indices of the selected
%            frequency points in freqv
% 
%        Input arguments:
%        freqv = logarithmic frequency vector
%            (the algorithm works also for non-logarithmic inputs)
%        mhno = maximum harmonic number (harmonic number of the highest
%            frequency).
%        df0 = frequency steps in the FFT grid (optional).
%            df0 is typically given as fs/N, with N being the FFT point length,
%            and fs the sampling frequency.
% 
%        Usage: [fqlog,df,cdmax,freqind]=log2qlog(freqv,mhno,df0);
%        Example: [fqlog,df]=log2qlog(logspace(log10(1),log10(256),17),256);
% 
%        

function mlbs
%MATLAB Tour Partial Function Help:  fid_con
%
% MLBS   Maximum length binary sequence (pseudo-random binary sequence, PRBS).
% 
%        [bitseries,nextstnum]=MLBS(log2N,bitno,startnum)
% 
%        Output arguments:
%        bitseries = generated bit series (values +1,-1).
%            Column vector, length: bitno, default length: 2^log2N-1
%        nextstnum = startnum to be used if continued sequence generation
%            follows.
% 
%        Input arguments:
%        log2N = bit length of the shift register: integer number 2<=log2N<=30
%        bitno = number of bits to be generated (length of bitseries)
%            default: 2^log2N-1
%        startnum = (optional) digital equivalent of the start value of the
%            shift register, considered as a regular binary number containing
%            0-s and 1-s.  1<=startnum<2^log2N
% 
%        Usage: [bitseries,nextstnum]=mlbs(log2N,bitno,startnum);
%        Example: bitseries=mlbs(10);
% 
%        

function msinclip
%MATLAB Tour Partial Function Help:  fid_con
%
% MSINCLIP Multisine design with mimimum crest factor.
% 
%        [cx,crx,crxmax,cry,crymax]=MSINCLIP(fv,ampv,tf,gmod,itno,ovs,N,cl0,sr)
% 
%        Algorithm: time domain <--> frequency domain swapping, clipping in time
%        domain.
% 
%        Output arguments:
%        cx = complex amplitudes of the multisine (coefficients of the complex
%            Fourier series: the absolute values are equal to halves of
%            the real amplitudes). For the ZOHc case, the coefficients are those
%            of the ZOH-generated excitation signal, that is, for generation of
%            the signal the function msinprep is recommended with dev='DAC'.
%        crx = crest factor of the generated multisine, calculated with the
%            given oversampling factor.
%        crxmax = worst case crest factor of the multisine
%        cry = crest factor of the multisine at the output of the linear
%            system, calculated with the given oversampling factor.
%        crymax = worst case output crest factor of the multisine
% 
%        Input arguments:
%        fv = vector of frequencies where the nonzero amplitudes are given:
%            the elements must be integer multiples of a df value, minimum
%            number of sines: 2.  fv must be strictly monotonously increasing.
%        ampv = absolute values of the desired nonzero complex amplitudes
%            (coefficients of the complex Fourier series at the corresponding
%            frequencies: halves of the real coefficients).
%            If any element of ampv is complex, the phases of ampv will be used
%            as starting values, otherwise the Schroeder multisine is used.
%            For elements given with value NaN, auxiliary sine amplitudes are
%            returned in cx ("snowing"): these are not included into the
%            calculation of the effective value of the useful excitation
%            signal, only help to decrease the peak value.
%            Default for ampv: ones(length(fv),1)
%            Initial values for the snowing case can be given by a special
%            coding, by multiplying the corresponding frequency values by (-1).
%        tf = (optional) complex transfer function values at the given
%            frequencies. If tf is given, input-output optimization will be
%            performed.
%        gmod = (optional) if this is given with the value 'nograph',
%            iteration results will not be plotted, if with the value
%            'lastgraph', the result of the last iteration only, if with
%            'graph10', of every 10th iteration, if with 'graph100', every 100th
%            iteration, if with 'graph', a graph in every iteration will be
%            plotted. Default: 'graph10'
%            If any of the strings 'ZOHd' or 'ZOHc' is contained in gmod,
%            a zero-order hold design will be performed, otherwise a bandlimited
%            one. 'ZOHc' means that a continuous-time correspondence is used
%            between the spectrum and the time function, that is, the
%            desired amplitudes are predistorted by the reciprocal of the ZOH tf.
%            tf_ZOH = sin(pi*fv*dt)./(pi*fv*dt).
%            For 'ZOHd' no such predistortion is used.
%        itno = (optional) number of iteration cycles, default: 200. If itno=0,
%            the starting values will be returned (Schroeder or external)
%        ovs = (optional) minimal oversampling factor: the sampling frequency
%            will be   fs>=ovs*2*fmax,  default: 16 for BL design, 1 for ZOH
%        N = minimum number of points in the time series (even number)
%        cl0 = (optional) initial clipping level, 0<cl0<1
%        sr = (optional) maximum slew rate (maximum steepness of waveform).
%            After each clipping, the routine limits the slew rate of the signal
%            to the given value. This does not guarantee that the slew rate
%            stays below the limit after restoration of the amplitudes, but
%            usually drives the desigh towards a lower slew rate than it would
%            be without slew rate limitation.
% 
%        Usage: [cx,crx,crxmax,cry,crymax]=...
%                       msinclip(fv,ampv,tf,gmod,itno,ovs,N,cl0,sr);
%        Examples:
%          [cx,crestx]=msinclip([1:15]'/256,ones(15,1));
%          %random starting phases:
%          cx=msinclip(4:15,ones(1,12).*exp(j*2*pi*rand(1,12)));
%          %ZOH design:
%          cx=msinclip([0.2:0.01:0.4]',ones(21,1)/sqrt(42),[],'ZOHd',250,1,100);
% 
%        

function msinprep
%MATLAB Tour Partial Function Help:  fid_con
%
% MSINPREP Generate time series from complex amplitudes (multisine).
% 
%        [xtim,df]=MSINPREP(freqv,cx,N,fs,dev)
% 
%        It is assumed that the frequencies are harmonically related, and an
%        integer number of periods is to be generated. The function can be
%        asked to introduce a predistortion to compensate a zero order hold.
% 
%        Output arguments:
%        xtim = generated time series
%        df = calculated common divider of frequencies
% 
%        Input arguments:
%        freqv = frequency vector, where the complex amplitudes are given
%        cx = vector of complex amplitudes: fft of xtim gives back cx values
%             at appropriate frequencies (approximately only for dev='DAC')
%        N = length of the time series. If it is not given or empty, it will
%            be defined as fs/df, where df is the maximal common divider of
%            frequencies in freqv
%        fs = sampling frequency. If it is not given, it will be chosen
%            as N*df, where df is the maximal common divider of the frequencies
%            in freqv. If N is not given, either, fs=df*2*(max(freqv)/df+1)
%        dev = device for which the series is prepared. Possibilities:
%            'screen': for plotting etc, no modification
%            'DAC': for D/A converter, the amplitudes will be predistorted by
%                 the inverse tf of the zero order hold
%            default: 'DAC'
% 
%        Usage: [xtim,df]=msinprep(freqv,cx,N,fs,dev);
%        Example: [cx,crestx]=msinclip([1:15]'/256,ones(15,1));
%                 arbitgen=msinprep([1:15]'/256,cx,512,1,'DAC');
% 
%        

function optexcit
%MATLAB Tour Partial Function Help:  fid_con
%
% OPTEXCIT Iterate towards an excitation signal with optimal power spectrum.
% 
%        [X,CR,fsv,vXwdev,Fiw]=...
%                    OPTEXCIT(pdat,freqv,vdat,fixpind,X0,Ncyc,Fiw,pd,td,fsc)
% 
%        The transfer function of the system is given in a parameter vector or
%        parameter file.
% 
%        Output arguments:
%        X = generated amplitudes (absolute values of complex Fourier
%            coefficients)
%        CR = Cramer-Rao lower bound of the covariance matrix of the
%            parameter estimates with the amplitude set, preceding the
%            calculated one
%        fsv = suggested scaling vector for the Cramer-Rao bound:
%            CRs=CR.*(fsv*fsv')
%        vXwdev = 2xN array of the maximum and minimum values of the
%            dispersion function minus np at the beginning of each cycle
%        Fiw = array for the next run for the same system, with the same fixed
%            parameters and same frequency vector, formed of scaled Fisher
%            information matrices for each frequency, assuming X(k)=1.
% 
%        Input arguments:
%        pdat = 'parameter' vector or name of the parameter file (see EXPPAR)
%        freqv = vector of frequencies where the optimal amplitudes will be
%                determined
%        vdat = variances: if this is a string or a column vector, the
%            variances will be obtained via IMPVAR; if this is an array
%            (Nx2 or N=3, N>1), this is supposed to consist of the input and
%            output variance vectors and maybe the input-output covariance
%            vector; in the case of an 1x2 or 1x3 vector, these values mean
%            the constant input and output variances and the covariances.
%            Default value: [1,1].
%        fixpind = indices of fixed parameters in the total parameter vector,
%            defined as: [num,denom,delay]', where the coefficients are in
%            descending order in the s-domain, and in ascending order in the
%            z-domain. If fixpind is missing, or is given as fixpind=0, the
%            coefficient of the denominator which belongs to s^0 or z^0,
%            respectively, and the delay will be fixed (fixpind=[nn+nd,nn+nd+1]
%            in the s-domain, or fixpind=[nn+1,nn+nd+1] in the z-domain, with
%            nn and nd the number of parameters in the numerator or the
%            denominator, respectively). fixpind='n' means that no fixed
%            parameters are given at all.
%        X0 = starting values of X. If X0 is empty or missing, the amplitudes
%            will be uniform. X0 will be scaled internally to set the total
%            signal power to 1.
%        Ncyc = number of iterations to be performed, default: Ncyc=1
%        Fiw = array determined in a previous run for the same system, with
%            the same fixed parameters and same frequency vector, formed of
%            scaled Fisher information matrices for each frequency, assuming
%            X(k)=1.
%        pd = plot density: plot results in every pd'th cycle
%        td = text displaying density: type out results in every td'th cycle
%        fsc = scaling frequency for better conditioning (optional)
% 
%        Usage:
%        [X,CR,fsv,vXwdev,Fiw]=...
%               optexcit(pdat,fv,vdat,fixpind,X0,Ncyc,Fiw,pd,td,fsc);
%        Example: X=optexcit('inpchans.pbn',[1:50]/50*3e4);
% 
%        

function modifyfv
%MATLAB Tour Partial Function Help:  fid_con
%
% MODIFYFV Modify Fourier (maybe also variance) data by given transfer function.
% 
%        [Fdatm,vdatm]=MODIFYFV(pdat,Fdat,vdat,plotmode)
% 
%        'Remove' the effect of a given transfer function (fix poles/zeros) from
%        Fourier amplitudes and variances.
% 
%        Output arguments:
%        Fdatm = modified 'Fourier' vector (see expfou), or
%            array: [freqv,x,y], if Fdat is also an array
%        vdatm = modified 'variance' vector (see expvar), or array:
%            [varx,vary,covxy] or [varx,vary], if vdat is also an array
% 
%        Input arguments:
%        pdat = 'parameter' vector, or name of the parameter file (see exppar)
%        Fdat = 'Fourier' vector, or name of the input Fourier file,
%            or array: [freqv,x,y]
%        vdat = 'variance' vector, or name of the input variance file,
%            or array: [varx,vary,covxy] or [varx,vary]
%            (may be omitted, if only a Fourier file is to be modified)
%        plotmode = frequency axis on plot: 'lin' or 'log', maybe extended by
%            pb (not to plot the zeros of the transfer function).
%            Default: 'linpb'.
%            If plotmode has any other value, no plot will be shown.
% 
%        Usage: [Fdatm,vdatm]=modifyfv(pdat,Fdat,vdat,plotmode);
%        Example: Fdatm=modifyfv('inpchanz.pbn','inpchan.fbn');

function tim2fou
%MATLAB Tour Partial Function Help:  fid_con
%
% TIM2FOU Convert time domain data to frequency domain for elis.
% 
%        [Fdat,dt]=TIM2FOU(tdat,freqv,expi,fmod)
% 
%        Output arguments:
%        Fdat = frequency domain data (see expfou)
%        dt = time distance between subsequent samples in tdat
% 
%        Input arguments:
%        tdat = a time vector or an (N*n)x3 array [timevl,x,y], with the time
%           vector repeated N times in timevl, or the name of the elis time file
%           (see EXPTIM; an extension is obligatory, in order to distinguish it
%           from a function name), or a string with the name of the function
%           which produces for every call the data of an experiment.
%           The sampling instants must be equidistant in each experiment.
%        freqv = frequency vector; possibly each element of freqv should be a
%           divider of fs, but the algorithm works even if this is not true.
%           If freqv is empty, all possible frequencies will be used from 0 to
%           fs/2, in fs/n grid.
%        expi = vector of serial numbers of the experiments to be processed:
%           if i is an element of expi, and tdat is a function name 'gettim',
%                [timev,x,y]=gettim(i);
%           must produce the results of experiment i, where the vertical sizes
%           of all the the vectors (arrays) are all n
%        fmod = modifier for the handling of the frequencies.
%           default (fmod is empty or missing): the sampling instants and freqv
%                are precisely given, and n*freqv/fs consists of integers,
%                that is, fft may be used
%                This is the only option currently implemented.
% 
%        Algorithm: an LS fit is performed (possibly the DFT is evaluated, by
%        using FFT), for each input, output and experiment.
% 
%        Usage: [Fdat,dt]=tim2fou(tdat,freqv,expi,fmod);
%        Example: Fdat=tim2fou([[0:63]',cos([0:63]'/64*2*pi*3)]);
% 
%        

function varanal
%MATLAB Tour Partial Function Help:  fid_con
%
% VARANAL Estimate input/output variances from several experiments.
% 
%        [vx,vy,cxy,mx,my,Na,Np,cfl,dv,sd]=VARANAL(Fdat,expi,synch,T,inp,outp)
% 
%        Output arguments:
%        vx = estimated variances of the real (and also of the imaginary)
%            parts of the complex input amplitudes in x
%            The variances of mx can be obtained by vx/Na
%        vy = estimated variances of the real (and also of the imaginary)
%            parts of the complex output amplitudes in y
%            The variances of my can be obtained by vy/Na
%        cxy = estimated input/output covariances: 0.5*E{conj(nx)*ny}
%            For MIMO data, the cxy is an array: [cx1y1,cx1y2,...,cx2y1,...]
%            The covariances between mx and my can be obtained by cxy/Na
%        mx = mean value of the input amplitudes
%        my = mean value of the output amplitudes
%        Na = number of averaged experiments
%            (those not counted for which the synchronization attempt failed)
%        Np = total number of processed experiments
%        cfl = 1x2 vector, multiplicative constants to obtain lower and higher
%            bounds of 95% confidence intervals of variances in the Gaussian
%            case. For the covariances, (cfl(1)-1)*sqrt(vx(k)*vy(k)) can be used
%            as additive error bound for the real and imaginary parts.
%        dv = calculated delays of experiments, relative to the first one
%            (in 'synch' mode only). The delays for the non-synchronizable
%            experiments will be equal to NaN.
%            The amplitude vector can be turned back to in-phase position by
%            executing   exp(j*2*pi*freqv*tau(i)).*Xi
%        sd = CR bound of the standard deviation of the estimated delay values,
%            calculated using the empirical variances vx, and the averaged input
%            amplitudes mx.
% 
%        Input arguments:
%        Fdat = a Fourier vector or an (N*F)x3 array [freqvl,x,y], with the
%            frequency vector repeated N times in freqvl, or the name of the
%            Fourier file (an extension is obligatory, in order to distinguish
%            it from a function name), or a string with the name of the
%            function which produces for every call the data of an experiment.
%            If the frequency vector is repeated in an array, the smallest
%            frequency may be present only once in each repetition.
%        expi = vector of serial numbers of the experiments to be processed:
%            if i is an element of expi, and Fdat is a function name 'getfou',
%            then  [freqv,x,y]=getfou(i);  must produce the results of
%            experiment i, where the vertical sizes of all the the vectors
%            (arrays) are all F. If Fdat is a Fourier vector of the name of
%            a Fourier file, the experiments selected by expi will only be used.
%        synch = (optional) if this is given with value 'synch', varanal
%            will try to 'synchronize' the input vectors (assuming that they
%            resulted from FFT-s of the same length), minimising the phase
%            differences by using a delay.
%        T = if synchronization is requested, [-T/2,T/2] is the interval where
%            the initial value of the deviation in time of the excitation
%            signals from each other is sought (e.g. the period length for
%            periodic signals)
%            If T is not given, it will be calculated from freqv
%        inp = (optional) number(s) of the input port(s),
%            default: all ports in the Fourier file(s)
%        outp = (optional) number(s) of the output port(s),
%              default: all ports in the Fourier file(s)
% 
%        Usage:
%          [vx,vy,cxy,mx,my,Na,Np,cfl,dv,sd]=varanal(Fdat,expi,synch,T,inp,outp);
%        Examples: [vx,vy,cxy,mx,my]=varanal('bandpass.fbn',[1:6],'synch');
%                  [vx,vy,cxy]=varanal('lowpass1.fbn',[1:5],'synch');
% 
%        

function elis
%MATLAB Tour Partial Function Help:  fid_con
%
% ELIS   Parameter estimation of linear systems.
% 
%        [pvect,fit,Cp,CR,cfv]=ELIS(Fdat,vdat,rppar,fixp,rpalg,rppl,initp,rpfs)
% 
%        Output arguments:
%        pvect = parameters in vector form (for imppar)
%        fit = informative column vector about the fit:
%            fit(1) = cost function
%            fit(2) = theoretical value of the cost function (chi^2/2)
%            fit(3) = 95% point of the theoretical distribution of the cf
%            fit(4) = number of frequencies
%            fit(5) = number of free parameters
%            fit(6) = performed iterations
%            fit(7) = last change of the cost function
%            fit(8) = last maximum of the relative changes of parameters
%            fit(9) = last lambda value (for Levenberg-Marquardt, otherwise NaN)
%            fit(10) = approximate mean model error
%            fit(11) = mean absolute value of the transfer function
%            fit(12) = Akaike information criterion (AIC)
%            fit(13) = condition number of the matrix actually decomposed
%                or inverted in the last cycle
%            fit(14) = condition number of J in the last cycle
%            fit(15) = condition number of Q=d^2C/dP^2, inverted when calculating
%               the approximate covariance matrix (see Eq. (2.23) in the manual).
%            fit(16) = scaling frequency for internal calculations
%            fit(17) = cause of termination: 1 for iteration number limit,
%               2 for small dcf, 3 for small dp, 4 for GUI request
%        Cp = approximate covariance matrix of the parameters: identical to CR
%        CR = approximate Cramer-Rao bound of the covariance matrix (inv(JTJ))
%        cfv = vector of the cost function values in the iteration steps; for
%             the LM algorithm, the second column contains the lambda values.
% 
%        Input arguments:
%        Among the input arguments, there are a few run parameter vectors.
%        These prescribe the running of the algorithm, by elements that are
%        either letters or numbers. It does not matter whether the vectors are
%        strings or a numerical vectors, ELIS will take care of the proper
%        meanings. The vectors may be shorter than their maximum length, or
%        may contain NaN elements; in such a case the default values will be
%        assigned to the corresponding run parameters.
%        Fdat = Fourier data ([freq,x,y], Fx3 array), or Fourier vector (see
%            expfou), or name of Fourier file
%        vdat = variance data: Fx2 variance array or Fx3 covariance array
%            ([varx,vary,covxy]), or row vector of variances (and maybe of
%            covariance), or variance vector (see expvar) or variance file name
%            For either Fdat or vdat the name of a run parameter file may also 
%            be given: this must be a string which ends by '.ebn', and may not
%            contain any other period, and the run parameter file must define
%            the Fourier or the variance data, respectively.
%        rppar = vector of the basic model descriptors:
%            1 - domain ('z' or 's')
%            2 - order of the numerator
%            3 - order of the denominator
%            4 - sampling frequency or internal scaling frequency
%            5 - 'a' if allpass design is required, 'n' if not
%            Default: ['s',1,2,1,'n','n']
%        fixp = definition of fixed parameters. 
%            nx2 array: fixed parameters, indices and values of fixed
%            parameters in the vector [num,denom,delay]'; e.g. if num=[1,1] and
%            denom=[4,3,2,1], the delay and the last coefficient of the
%            denominator can be fixed with fixp=[6,1;7,0]
%            Other possibilities:
%            '0': fixed delay and zero-order coeff of denominator set to 1
%            'v' for variable, 'f' for fixed delay; other parameters remain
%              as defined in a run parameter file.
%            'n' for no fixed parameters at all
%            if fixp is empty, the previously defined fixed parameters remain
%            For allpass design, the numerator coefficients may be fixed.
%            Default: no fixed coefficient, fixed delay
%        rpalg = vector of basic algorithm descriptors
%            1 - algorithm: 'g' (Newton-Gauss), 'l' (Levenberg-Marquardt),
%               'm' (LM with svd), 's' (singular value decomposition), 
%               'r' (Newton-Raphson)
%            2 - setting of starting (initial) values: 'l' (least squares),
%               'w' (weighted least squares, weight: vary), 'v' (eqvar-WLS),
%               's' (svd), 'y' (vary-WLS with svd), 'a' (approximate-ML WLS),
%               'f' (file, see initp), 'e' (equation error method)
%            3 - maximum number of iterations
%            4 - stop if rel. variation of cost function smaller than this value
%            5 - stop if rel. variation of parameters smaller than this value
%            Levenberg-Marquardt settings:
%            6 - number of consecutive decreases of the cost function before
%               trial with lambda=0. A negative value means that this is never
%               done, with the absolute value used as a lower bound for lambda
%            7 - starting value of lambda
%            8 - maximum value of lambda which allows stopping of iteration
%            Default: ['g','w',50,1e-6,0,10,0.1,1e-10]
%        rppl = vector of plot modifiers
%            1 - n: plot for every nth iteration; inf for no plot,
%               neg for no 0th
%            2:5 - axis vector for magnitude plots
%            6 - 'i' for linear, 'o' for logarithmic frequency axis
%            7 - 'c' to calculate zeros, 'n' for don't calculate
%            8 - 'c' to calculate poles, 'n' for don't calculate
%            9:12 - axis vector for pole/zero plot (or 'p   ' for the same
%               vertical and horizontal scaling, all poles/zeros shown;
%               'a   ' for all poles/zeros just shown; [n,n,n,n] for all zeros
%               and poles with limit n*fvmax in s-domain, limit 2 in z-domain)
%            13 - number of consecutive zero/pole sets shown at the same time
%            14 - display messages during run, 'y', 'n', 'b' (burst),
%               'c' (collect only), or 's' (short)
%            15 - frequency axis in frequency 'f' or radian frequency 'r'
%            Default: [1,0,NaN,NaN,NaN,'i','c','c','a   ',1,'yf']
%        initp = vector or string: parameter vector (see exppar) or file name
%            scalar value: new value of the delay in s (s-domain) or
%            in taps (z-domain)
%            Default: delay=0
%        rpfs = names of files to be generated (shorter lines extended by
%            spaces, the order is not bound): 
%            - report file (*.rep)
%            - parameter file (*.par or *.pbn or *.pnt)
%            - covariance file (*.cov or *.cbn or *.cnt)
%        WARNING! In Matlab5, strings are represented as 2-byte numbers, and
%        concatenation of strings with numbers results strings. Therefore, in
%        the setting the run parameters as rppar, rpalg, rppl, the strings
%        used in them must be converted first to numbers.
%        E.g. rppar=['s'+0,4,6,1e6]
% 
%        Usage:
%          [pvect,fit,Cp,CR,cfv]=elis(Fdat,vdat,rppar,fixp,rpalg,rppl,initp,rpf);
%        Examples: [freqv,x,y]=impfou('bandpass.fbn',1);
%            elis([freqv,x,y],3.4e-4*[1,1],['s',4,6]);
%            elis('inpchans.ebn');
%            elis('inpchanz.ebn',[],['z',16,16],[35,0]); %fixing the delay
% 
%        

function eliscost
%MATLAB Tour Partial Function Help:  fid_con
%
% ELISCOST Calculate value of elis cost function
% 
%        costf=ELISCOST(pdat,Fdat,vdat)
% 
%        Output arguments:
%        costf = value of cost function
% 
%        Input arguments:
%        pdat = parameters of model (see exppar)
%        Fdat = Fourier data (see expfou)
%        vdat = variance data (see expvar)
% 
%        

function elisml
%MATLAB Tour Partial Function Help:  fid_con
%
% ELISML Maximum likelihood estimation of transfer function H(s)
% 
%        [pvect,fit,Cp]=ELISML(Fdat,vdat,nord,dord,delay,dfx)
% 
%        elisml calls elis with default run parameters, thus providing a simple
%        calling interface. If nonstandard run parameters are required, elis
%        can still be directly invoked.
% 
%        Output arguments:
%        pvect = parameters in vector form (for imppar)
%        fit = informative column vector about the fit (see elis for details)
%        Cp = approximate covariance matrix of the parameters
% 
%        Input arguments:
%        Fdat = Fourier data ([freq,x,y], Fx3 array)
%        vdat = variance data: Fx2 variance array ([varx,vary]) or
%            Fx3 covariance array ([varx,vary,covxy]), or
%            1x2 row vector of variances ([vx0,vy0]), or
%            1x3 row vector of variances and covariance ([vx0,vy0,cxy0])
%        nord = order of numerator
%        dord = order of denominator
%        delay = delay in seconds (optional, default: 0)
%            for dfx='v', delay is the starting value for the iterations
%        dfx = 'f' for fixed delay, 'v' for variable delay (default: 'f')
% 
%        Usage: [pvect,fit,Cp]=elisml(Fdat,vdat,nord,dord,delay,dfx);
%        Example: [freqv,x,y]=impfou('bandpass.fbn',1);
%                 pv=elisml([freqv,x,y],[3.4e-4,3.4e-4],4,6);
%        

function elistper
%MATLAB Tour Partial Function Help:  fid_con
%
% ELISTPER Identify H(s), starting from time domain periodic input-output data.
% 
%        [pvect,fit,Cp,Fdat,vdat]=ELISTPER(xt,yt,fs,fv,nord,dord,dly,dfix,mr,pd)
% 
%        Output arguments:
%        pvect = parameters in vector form (for imppar)
%        fit = informative column vector about the fit (see elis for details)
%        Cp = approximate covariance matrix of the parameters
%        Fdat = calculated Fourier data
%               (for new identification runs, see elisml or elis)
%        vdat = calculated variance data (for new identification runs)
% 
%        Input arguments:
%        xt = vector of samples of the time domain input signal
%        yt = vector of samples of the time domain output signal
%        fs = sampling frequency in signal acquisition
%        fv = vector of frequencies of harmonic components
%        nord = order of numerator
%        dord = order of denominator
%        dly = delay in seconds (optional, default: 0)
%            for dfix=='v', dly is the starting value for the iterations
%        dfix = 'f' for fixed delay, 'v' for variable delay (default: 'f')
%        mr = (optional) run modifier for different nonideal situations
%           (only the default meaning and 'leak' are implemented at this moment)
%           - the default is when generator and sampling clocks are well
%             synchronized, and exactly N periods were measured.
%             This is set if mr is not given, or if it is empty.
%           Warning! The options below may only be used if anti-alias filters
%           were used in both data acquisition channels.
%           - 'leak' means that fs and fv are exact, but fs is not an 
%             integer multiple of the elements of fv.
%           - 'slip' means that fs and/or fv may slightly differ from the
%             given values (the two clocks slowly slip with respect to each
%             other), and correction for this is requested.
%           - 'approx' means that fs and/or fv is only approximate, and
%             their ratio is to be estimated from the data.
%        pd = plot density, default: only last one (100)
% 
%        Algorithm: tim2fou, varanal and elis are invoked with appropriately
%        prepared data.
% 
%        Usage:
%        [pvect,fit,Cp,Fdat,vdat]=elistper(xt,yt,fs,fv,nord,dord,dly,dfix,mr,pd);
% 
%        

function elisqa
%MATLAB Tour Partial Function Help:  fid_con
%
% ELISQA Question/answer procedure to generate run parameter file for elis.
% 
%        ELISQA(rpf,defaults)
% 
%        Input arguments:
%        rpf = name of the mat-file of the run parameters to be generated
%                default extension: .ebn
%        defaults = name of the mat-file of the default run parameters
% 
%        Usage: elisqa(rpf,defaults);
%        Example: elisqa('elisqtst.ebn','inpchans.ebn');
% 
%        

function elrpf2v
%MATLAB Tour Partial Function Help:  fid_con
%
% ELRPF2V Conversion of elis run parameter file into run parameter vectors.
% 
%        [rppar,fixp,rpalg,rppl,initp,rpfs]=ELRPF2V(rpfile)
% 
%        Input argument:
%        rpfile = name of run parameter file (*.ebn)
% 
%        Output arguments (see ELIS for details):
%          When there are no output arguments, the run parameters will be listed
%          to the screen.
%        rppar = vector of the basic model descriptors
%        fixp = definition of fixed parameters.
%        rpalg = vector of basic algorithm descriptors
%        rppl = vector of plot modifiers
%        initp = initial parameter values
%        rpfs = names of files to be generated
% 
%        Usage: [rppar,fixp,rpalg,rppl,initp,rpfs]=elrpf2v(rpfile);
%        Example: [rppar,fixp,rpalg,rppl,initp,prfs]=elrpf2v('inpchans.ebn');
%                 elrpf2v('inpchans.ebn')
% 
%        

function elrpv2f
%MATLAB Tour Partial Function Help:  fid_con
%
% ELRPV2F Conversion of elis run parameter vectors to run parameter file.
% 
%        ELRPV2F(rpfile,rppar,fixp,rpalg,rppl,initp,rpfs)
% 
%        Input arguments (see ELIS for details):
%        rpfile = name of the run parameter file to be generated
%            If rpfile is empty, the values of the internal run parameters will
%            be listed to the screen.
%        rppar = vector of the basic model descriptors
%        fixp = definition of fixed parameters.
%        rpalg = vector of basic algorithm descriptors
%        rppl = vector of plot modifiers
%        initp = initial parameter values
%        rpfs = names of files to be generated
% 
%        Usage: elrpv2f(rpfile,rppar,fixp,rpalg,rppl,initp,rpfs)
%        Example: elrpv2f('newfile.ebn',['z',12,12],[0],'r');
%                 elrpv2f('',['z',12,12],'0','r');
% 
%        

function gmean
%MATLAB Tour Partial Function Help:  fid_con
%
% GMEAN  Geometric mean value of complex vectors/matrices.
% 
%        For vectors, GMEAN(X) is the geometric mean value of the elements in
%        vector X.  For matrices, GMEAN(X) is a row vector containing the mean
%        value of each column.
%        Attention is paid to avoid phase wrapping for complex elements.
% 
%        Example: x=-ones(100,2)+0.1*randn(100,2)+j*0.01*randn(100,2);
%                 mx=gmean(x)
%                 mfalse1=prod(x).^(1/100), mfalse2=prod(x.^(1/100))

function expvect
%MATLAB Tour Partial Function Help:  fid_con
%
% EXPVECT Export vectors to flat ASCII file for external graphing purposes.
% 
%        EXPVECT(file,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,digitnum)
% 
%        Prepare a ASCII file for graphing programs.
%        The file will be created in the active subdirectory or folder.
%        Format: digitnum digits + exponent. If digitnum is not given,
%        the default value is 7.
%        Between columns there will be tab characters.
%        The last character in the file is an <end of line> after the last
%        number.
% 
%        Input arguments:
%        file: the name of the file (string)
%        v1...v12: vectors to be sent
%            At least 1 vector must be given, the minimum length is 2.
%            The vectors must be of the same length.
%        digitnum (optional): number of digits (1<=digitnum<=16)
% 
%        Usage: expvect(file,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,digitnum)
%        Examples:
%          t=[1:100]; x=100*ones(100,2)+rand(100,2)+j*rand(100,2);
%          expvect('data.txt',t,real(x(:,2)),imag(x(:,2)),8)
% 
%        

function ploteltf
%MATLAB Tour Partial Function Help:  fid_con
%
% PLOTELTF Plot transfer function(s), measured data and confidence intervals.
% 
%        [ha1,ha2,fsc]=PLOTELTF(pd1,pd2,Fdat,fscale,msc,cd1,cc,cn,rec,expi,ntx)
% 
%        The transfer function, defined by the parameter vector or file pd1 is
%        plotted with mark '-', the one defined by pd2 is plotted with ':',
%        and the measured data in Fdat with '+'. The magnitude is on the upper
%        half of the screen, in deciBels, the phase is on the lower one, in
%        degrees. Two of pd1, pd2, Fdat may be empty. If cd1 is also
%        given containing covariance data, the two-sigma confidence intervals of
%        tf1 will also be shown, at 32 points. These numbers can be changed
%        by cc and cn. If cd1 contains variance data, the confidence
%        intervals of the tf points defined by Fdat are plotted for all
%        frequencies, if not otherwise requested by cn.
% 
%        Output arguments:
%        ha1 = handle of magnitude plot
%        ha2 = handle of phase plot
%        fsc = scaling frequency for plots
% 
%        Input arguments:
%        pd1 = first parameter vector (see exppar) or the name of the first
%            parameter file
%        pd2 = second parameter vector (see exppar) or the name of the
%            second parameter file
%        Fdat = Fourier vector or the name of the Fourier file, or the array
%            [freqvect,x,y]
%        fscale = scaling of the frequency axis. Possible values:
%            'lin': linear, from 0 to either higher sampling frequency in
%            parameter sets (if any), or maximal frequency in Fourier file.
%            'linF': linear, from 0 to maximal frequency in Fourier file.
%            ['lin',f1,f2]: linear from f1 to f2, [f1,f2]: scale linearly
%            'log': logarithmic, between 1e-3*fs/2 to fs/2 (fs is the higher
%               sampling frequency in files, if any), or from 1e-3*maxf to maxf
%               (maximal frequency in Fourier file). For s-domain parameter
%               files with no Fourier file, plot from 1e-2*fscale to 10*fscale.
%            'logF': logarithmic, from minimal nonzero frequency to maximal
%               frequency in Fourier file.
%            ['log',f1,f2]: logarithmic from f1 to f2
%            default: 'lin'
%        msc = scaling of amplitude plot: 'full' to scale to all points,
%            'passb' to scale to passband only (defined by the minimum and
%            maximum of frequencies, for which y is not zero in Fdat).
%            If a '+' is appended to this parameter, only the amplitudes are
%            plotted, if a '-', only the phases, and if '*', with cd1 also
%            given, the amplitudes and the complex errors in dB. '=' allows to
%            show both the amplitude and the phase.
%        cd1 = covariance matrix or covariance vector or name of file
%            belonging to pd1 (cd1 may be empty). If cd1 contains variance
%            data belonging to Fdat, the confidence intervals of Ym./Xm will
%            be plotted.
%        cc = coefficient for setting the confidence bound. It is the
%            multiplier of the standard deviation.
%        cn = number of plotted confidence intervals
%        rec = 'abc', where each letter refers to pd1, pd2, Fdat,
%            respectively: 's' means straight (no reciprocal building is
%            necessary), 'r' means reciprocal before plotting
%        expi = number of the experiment(s) to be plotted: if empty, all the
%            experiments in the file will be plotted
%        ntx = if this is 'notext', the file names etc. will not be shown.
%        Most of the input parameters maybe omitted.
%        Default values:
%            pd2=''; Fdat=''; fscale='lin'; msc='full='; cd1='';
%            cc=2; (cc=1 for complex error), cn=32; rec='sss'; expi=[]; ntx='';
% 
%        Usage:
%           [ha1,ha2,fsc]=...
%                ploteltf(pd1,pd2,Fdat,fscale,msc,cd1,cc,cn,rec,expi,ntx);
%        Examples:
%            ploteltf('inpchans.pbn','','inpchan.fbn','linF','full+');
%            [ha1,ha2,fsc]=ploteltf(exppar('z',[1.1,1],[4,3,2,1],0));
% 
%        

function plotelpz
%MATLAB Tour Partial Function Help:  fid_con
%
% PLOTELPZ Plot poles/zeros of a transfer function with confidence ellipses.
% 
%        [rnum,rdenom]=PLOTELPZ(pdat,cdat,Pc,axv,ntx,zarr,parr,domain,da,dp,plm)
% 
%        Output arguments:
%        rnum = roots of the numerator (in terms of s or z), column vector
%        rdenom = roots of the denominator (in terms of s or z), column vector
% 
%        Input arguments:
%        pdat = the parameter vector (see EXPPAR) or the name of the file.
%            pdat may be empty; in this case parr, zarr and domain are used.
%        cdat = covariance matrix (array) or covariance vector (see EXPCOV) or
%            name of the covariance file of the parameters in pdat.
%            If this is empty, the uncertainty ellipses will not be shown.
%        Pc = confidence level of pole/zero uncertainty ellipses. If Pc>=1,
%            this value becomes the multiplier of sigma on the contour. For
%            Pc=0, no ellipses will be drawn.
%        axv = optional 4-element vector to be passed through 'axis'
%            if axv is omitted, the plot will be scaled to just show all poles
%            and zeros, except if it is 'z', when the axis will be [-2,2,-2,2],
%            or if it is 'p', the plot will show all poles and zeros, and the
%            x and y axes have the same scaling.
%            A valid axv may be appended by a number, the stability margin for 
%            counting the unstable poles / nonminimum phase zeros.
%        ntx = string which inhibits any texts from being written to the
%            screen if given as 'notext', and inhibits warning messages only
%            if given as 'nomsg'. If ntx is not empty, the previous
%            subplot or axes command remains in force.
%        zarr = an array of zeros to be plotted too
%        parr = an array of poles to be plotted too
%        domain = 's' or 'z', domain of the zeros/poles
%        da = algorithm of derivative calculation, 'anal' for analytical,
%            'num' for numerical. Default: 'anal'
%        dp = perturbation of parameter vector during numerical derivation in 
%            the directions of the eigenvectors of the covariance matrix
%        plm = if its value is 'mc', in the case of numerical derivation the
%            'movie' will be shown, how the poles/zeros are paired to each
%            other. 'mp' is the same, but with pause after each plot.
%        Default values: axv=[]; cdat=''; ntx='';
% 
%        Usage: [rnum,rdenom]=...
%                   plotelpz(pdat,cdat,Pc,axv,ntx,zarr,parr,domain,da,dp,plm);
%        Examples:
%            plotelpz('inpchanz.pbn');
%            [rnum,rdenom]=plotelpz('inpchans.pbn','inpchans.cbn');
% 
%        

function tfcalc
%MATLAB Tour Partial Function Help:  fid_con
%
% TFCALC Calculate transfer function values from parameters
% 
%        tf=TFCALC(pdat,freqv)
% 
%        Output arguments:
%        tf = transfer function values
% 
%        Input arguments:
%        pdat = parameter vector (see expfou)
%        freqv = frequency vector
% 
%        Usage: tf=tfcalc(pdat,freqv);

function fdcovpzp
%MATLAB Tour Partial Function Help:  fid_con
%
% FDCOVPZP Parameters and covariances of transfer function from poles/zeros.
% 
%        [pvect,Cp]=FDCOVPZP(zv,stdz,pv,stdp,rzp,g,stdg,domain,fs,da,dzp)
% 
%        The approximate "inverse" of STDPZ.
% 
%        Output arguments:
%        pvect = parameter vector (numerator, denominator, delay), see EXPPAR
%        Cp = covariance matrix of pvect
% 
%        Input arguments:
%        zv = column vector of zeros
%        stdz = array of standard deviations of the zeros; the three columns
%            contain the std-s of the real parts, std-s of the imaginary
%            parts, and their correlation coefficients, respectively.
%        pv = column vector of poles
%        stdp = array of standard deviations of the poles; the three columns
%            contain the std-s of the real parts, std-s of the imaginary
%            parts, and their correlation coefficients, respectively
%        rzp = correlation coefficient matrix (normalized covariance matrix)
%            of the vector which contains real and imaginary parts of each
%            zero and pole, and the leading coefficients of the numerator
%            and the denominator, like:
%            [z1r;z1i;z2r;...;p1r;p1i;p2r;...;n1,d1]
%            If rzp is empty or missing, the random variables will be assumed
%            to be independent, except for the complex conjugate pairs
%        g = gain, the leading coefficients in the Matlab
%            representation of the numerator and the denominator.
%            If g is a two-element vector, it contains the leading
%            coefficients of the numerator and the denominator, respectively
%        stdg = standard deviations of the gain; stdg has three elements:
%            the two std-s, and the correlation coefficient
%        domain = 's' or 'z'
%        fs = sampling frequency for z-domain parameter vector
%        da = derivation algorithm for sensitivity calculations:
%            'anal' or 'num'; at present, only 'anal' is implemented.
%        dzp = amount of perturbation of zeros and poles in the directions
%            of the eigenvectors of the covariance matrix (multiplier
%            of the eigenvalues)
%        Default values: g=[1;1]; stdg=[0;0;0]; domain='s'; fs=1; da='num'; dzp=1
% 
%        Usage: [pvect,Cp]=fdcovpzp(zv,stdz,pv,stdp,rzp,g,stdg,domain,fs,da,dzp)
%        Example:
%            [zv,stdz,pv,stdp,rzp,g,stdg]=stdpz('inpchans.pbn','inpchans.cbn');
%            [pvectn,Cpn]=fdcovpzp(zv,stdz,pv,stdp,rzp,g,stdg);
%            subplot(121)
%            plotelpz('inpchans.pbn','inpchans.cbn',10,[-6,2,-4,4]*1e5,'nomsg')
%            subplot(122),plotelpz(pvectn,Cpn,10,[-6,2,-4,4]*1e5,'nomsg')
% 
%        

function simfou
%MATLAB Tour Partial Function Help:  fid_con
%
% SIMFOU Generate simulated Fourier amplitudes.
% 
%        [x,y]=SIMFOU(pdat,freqv,x0,vdat,expno)
% 
%        Output arguments:
%        x = complex input column vector
%        y = complex output column vector
% 
%        Input arguments:
%        pdat = the parameter vector (see EXPPAR) or the name of the parameter
%            file
%        freqv = frequency vector
%        x0 = input complex amplitude vector; if it is empty, the input
%            amplitudes will be all chosen equal to 1.
%        vdat = variance: if this is a string or a column vector, the
%            variances will be obtained via IMPVAR; if this is an array
%            (Nx2 or Nx3, N>1), this is supposed to consist of the input and
%            output variance vectors (and maybe the input/output covariance
%            vector; in the case of an 1x2 or 1x3 vector, these values mean
%            the constant input and output variances and maybe the covariance.
%        expno = (optional) number of experiments to be generated;
%            if omitted or empty, the default is 1.
% 
%        Usage: [x,y]=simfou(pdat,freqv,x0,vdat,expno);
%        Example: [x,y]=simfou('inpchans.pbn',400*[1:49],[],1e-9*[1,1]);
% 
%        

function simtime
%MATLAB Tour Partial Function Help:  fid_con
%
% SIMTIME Generate simulated input and output time series.
% 
%        [xt,yt]=SIMTIME(pdat,u,numi,denomi,numo,denomo,mode)
% 
%        Output arguments:
%        xt = input column vector
%        yt = output column vector
% 
%        Input arguments:
%        pdat = parameter vector (see EXPPAR) or the name of the
%            parameter file; the delay must not be negative, and if mode is
%            'transient', it will be rounded to the nearest integer.
%        u = vector of input time series. dt=1/fs, where fs is the sampling
%            frequency, defined in pdat or by mode; it is the responsibility of
%            the user, to sample the desired excitation signal properly.
%        numi = numerator of the input observation noise shaping filter
%        denomi = denominator of the input observation noise shaping filter
%        numo = numerator of the output observation noise shaping filter
%        denomo = denominator of the output observation noise shaping filter
%            The sampling frequency for the noise shaping filters is the same as
%            that of the parameter vector. The noise applied to the noise
%            shaping filters is assumed to have unity standard deviation (std).
%            This means that the variances of the real and imaginary parts of
%            the Fourier amplitudes (required by elis) are
%            (N/2)*(num(f_k)/denom(f_k))^2
%        mode = simulation mode: if the system given in pdat is a z-domain
%            one, 'transient' means response to transient input,
%            starting with energyless filter; 'periodic' means periodic
%            excitation, u is just one period. Default: 'periodic'
%            For s-domain systems, mode contains the sampling frequency, and
%            a periodic excitation is simulated for the stationary state.
% 
%        Usage: [xt,yt]=simtime(pdat,u,numi,denomi,numo,denomo,mode);
%        Example: f=400*[1:49];u=msinprep(f,msinclip(f,[],[],'',0),256,51200);
%                 [xt,yt]=simtime('inpchanz.pbn',u,3e-5,1,3e-5,1);
%                 [xtr,ytr]=simtime('inpchanz.pbn',u,3e-5,1,3e-5,1,'transient');
% 
%        

function rdueelis
%MATLAB Tour Partial Function Help:  fid_con
%
% RDUEELIS Residuals of an estimation, made by ELIS.
% 
%        [rx,ry,ryx,vryx,xe,ye]=RDUEELIS(pdat,cdat,Fdat,vdat,expi,inp,outp)
% 
%        Output arguments:
%        rx = complex residuals of the input amplitude vector
%        ry = complex residuals of the output amplitude vector
%        ryx = complex residuals of ym./xm vs. the estimated tf
%        vryx = variance vector of the real (and of the imaginary) parts
%            of ryx
%        xe = estimate of the complex input vector
%        ye = estimate of the complex output vector
% 
%        Input arguments:
%        pdat = parameter vector (see EXPPAR) or the name of the parameter
%            file
%        cdat = covariance array or vector or file name; covariance matrix
%            of pdat. If empty, the uncertainty of pdat will not be
%            considered in vryx.
%        Fdat = Fx3 array: [freqv,x,y], or Fourier vector (see EXPFOU), or
%            the name of the Fourier file
%        vdat = variances: if this is a string or a column vector, the
%            variances will be obtained via IMPVAR; if this is an array
%            (Nx2 or N=3, N>1), this is supposed to consist of the input and
%            output variance vectors and maybe the covariance vector; in the
%            case of an 1x2 or 1x3 vector, these values mean the constant
%            input and output variances and maybe the covariances.
%        expi = number(s) of the experiment(s) in Fdat for which the residuals
%            are to be calculated; if Fdat is an array, expi=[1]
%        inp = (optional) number of the input port, default: 1
%        outp = (optional) number of the output port, default: 1
% 
%        Usage:
%          [rx,ry,ryx,vryx,xe,ye]=rdueelis(pdat,cdat,Fdat,vdat,expi,inp,outp)
%        Example:
%          [rx,ry,ryx,vryx]=rdueelis('inpchans.pbn','inpchans.cbn',...
%                        'inpchan.fbn',[9.61e-12,9.61e-10]);
% 
%        

function stdpz
%MATLAB Tour Partial Function Help:  fid_con
%
% STDPZ  Calculate standard deviations and covariances of poles and zeros of tf.
% 
%        [zv,stdz,pv,stdp,rzp,g,stdg,dps]=STDPZ(pdat,cdat,zv0,pv0,da,dp,plm,axv)
% 
%        Output arguments:
%        zv = column vector of zeros
%        stdz = array of standard deviations of the zeros; the three columns
%            contain the std-s of the real parts, std-s of the imaginary
%            parts, and their correlation coefficients, respectively.
%            For multiple zeros NaN-s are returned if da is 'anal'.
%        pv = column vector of poles
%        stdp = array of standard deviations of the poles; the three columns
%            contain the std-s of the real parts, std-s of the imaginary
%            parts, and their correlation coefficients, respectively
%            For multiple poles NaN-s are returned if da is 'anal'.
%        rzp = correlation coefficient matrix (normalized covariance matrix)
%            of the vector which contains real and imaginary parts of each
%            zero and pole, and the leading coefficients of the numerator
%            and the denominator, like:
%            [z1r;z1i;z2r;...;p1r;p1i;p2r;...;n1;d1]
%        g = gain, the leading coefficients in the Matlab representation
%            of the numerator and the denominator.
%        stdg = 3x1 vector of standard deviations of g and their correlation
%            coefficient
%        dps = if during the numerical derivations the perturbations are too
%            large (nearest neighbors cannot pair pole/zero sets properly),
%            dps contains a suggested value for dp.
%            otherwise dps is empty.
% 
%        Input arguments:
%        pdat = parameter vector (see EXPPAR) or the name of parameter file
%        cdat = covariance matrix of parameters or covariance vector
%            (see EXPCOV) or name of covariance file
%        zv0  = vector of zeros (this vector determines the order in the
%            vector zv), optional, may be empty
%        pv0  = vector of poles (this vector determines the order in the
%            vector pv), optional, may be empty
%        da = mode of derivative calculation.
%            For 'anal' (the default value), root/coefficient
%            sensitivities are calculated by analytical differentiation
%            of the polynomials.
%            For 'num', small perturbations and numerical differentiation
%            are used. The perturbations are introduced in the directions
%            of the eigenvectors of the covariance matrix, the amount is
%            the corresponding eigenvector. The perturbations can be
%            multiplied by a constant factor dp.
%            Default value: 'anal'
%        dp = amount of perturbation of parameter vector in the directions
%            of the eigenvectors of the covariance matrix (multiplier
%            of the eigenvalues)
%        plm = plotmode: if plm is given with value 'mc', the perturbed
%            sets and the pairing will be shown on the screen, one after
%            other; when with value 'mp', a statement pause will be
%            executed after each pairing.
%        axv = axis vector (optional) to influence plotted range in movie
% 
%        Usage:
%            [zv,stdz,pv,stdp,rzp,g,stdg,dps]=...
%                                 stdpz(pdat,cdat,zv0,pv0,da,dp,plm,axv);
%        Example:
%            [pvect,fit,Cp]=elis('inpchans.ebn');
%            [zv,stdz,pv,stdp,rzp]=stdpz(pvect,Cp);
% 
%        

function stdtf
%MATLAB Tour Partial Function Help:  fid_con
%
% STDTF  Calculate standard deviations of amplitude and phase values of tf.
% 
%        [tf,stda,stdph,stdri,rtf]=STDTF(freqv,pdat,cdat)
% 
%        Output arguments:
%        tf = complex transfer function values at the given frequencies
%        stda  = standard deviations of amplitude values
%        stdph = standard deviations of phase values (in radians)
%        stdri = array of standard deviations of the transfer function
%            values; the three columns contain the std-s of the real
%            parts, std-s of the imaginary parts, and their correlation
%            coefficients, respectively
%        rtf = normalized covariance matrix (= correlation coefficients) of
%            the vector which contains real and imaginary parts of each
%            transfer function point, like: [Re(tf1);Im(tf1);Re(tf2);...]
% 
%        Input arguments:
%        freqv = frequency vector
%        pdat = parameter vector (see EXPPAR) or the name of parameter file
%        cdat = covariance matrix of parameters or covariance vector
%            (see EXPCOV) or name of covariance file
% 
%        Usage:
%            [tf,stda,stdph,stdri,rtf]=stdtf(freqv,pdat,cdat);
%        Example:
%            [pvect,fit,Cp]=elis('inpchans.ebn');
%            [tf,stda,stdph,stdri,rtf]=stdtf([400:400:19600],pvect,Cp);
% 
%        

function stdtfm
%MATLAB Tour Partial Function Help:  fid_con
%
% STDTFM Empirical standard deviations of transfer function values.
% 
%        [tfm,stdAm,stdphm]=STDTFM(Fdat,vdat)
% 
%        Output arguments:
%        tfm = nonparametric transfer function estimate
%        stdAm = standard deviations of the absolute values of the transfer
%            function points (that is, standard deviations of the real and
%            imaginary parts)
%        stdph = standard deviations of the phases of the transfer
%            function points, in radians
% 
%        Input arguments:
%        Fdat = Fourier data ([freq,x,y]), or Fourier vector (see EXPFOU),
%            or name of Fourier file
%        vdat = variance data: Nx2 variance array or Nx3 covariance array
%            ([varx,vary,covxy]), or row vector of variances (and maybe
%            covariance), or variance vector (see EXPVAR) or variance file name
% 
%        Usage: [tfm,stdAm,stdphm]=stdtfm(Fdat,vdat);
%        Example:  [tfm,stdAm,stdphm]=stdtfm('emachine.fbn','emachine.vbn');
% 
%        

function elisfcnv
%MATLAB Tour Partial Function Help:  fid_con
%
% ELISFCNV Convert ELiS data files from one format to the other.
% 
%        ELISFCNV(fromfile,tofile)
% 
%        Files may be binary, flat ASCII or ASCII with textual comments.
%        File type: covariance, Fourier, parameter, time, variance.
%        Possible file name extensions: .cbn, .cnt, .cov, .fbn, .fnt, .fou,
%          .pbn, .pnt, .par, .tbn, .tnt, .tim, .vbn, .vnt, .var
% 
%        Input arguments:
%          fromfile = name of the file to be converted (maybe with path)
%          tofile = name of the output file
% 
%        Usage: elisfcnv(fromfile,tofile)
%        Example: elisfcnv('inpchans.pbn','inpchans.par')
% 
%        

function expcov
%MATLAB Tour Partial Function Help:  fid_con
%
% EXPCOV Write covariances to a 'covariance' vector or file (for use by ELIS).
% 
%        [cvect,Cp]=EXPCOV(coeffcovar,fixpind,filename,comments,fdate)
% 
%        Output arguments:
%        cvect = vector, containing the same data as a .cnt file
%        Cp = total covariance matrix (for variable and fixed parameters) 
% 
%        Input arguments:
%        coeffcovar = nxn array, covariance matrix of the coefficients
%            if fixpind is not given, n must be equal to the number of the
%            numerator coefficients plus the number of the denominator
%            coefficients plus one (for the delay). If fixpind is not empty,
%            coeffcovar may not contain the rows and columns belonging to fixed
%            coefficients. 
%        fixpind = indices of fixed parameters in the total parameter vector,
%            defined as: [num,denom,delay]', where the coefficients are in
%            descending order in the s-domain, and in ascending order in the
%            z-domain. If both fixpind is given with indices, and there are
%            zero rows and columns in coeffcovar, they must correspond to each
%            other.
%        filename = name of the output file
%            If filename is empty or missing, no file will be generated.
%            If the name has no extension, this function extends it by '.cbn'.
%            If the extension is .cbn, the result will be a binary file, else
%            an ASCII file. If the extension is '.cnt', no text is sent to the
%            ASCII file, only data.
%        comments = string with eventual comments (optional)
%        fdate = date (and time) string (optional). If fdate is missing or
%            empty, an actual date string will be generated.
% 
%        If a file is generated, the most important values will be displayed
%        on the screen, unless a global variable 'expimpmessages' with value
%        'no' is defined. 
%        The file will be created in the active subdirectory or folder.
% 
%        Usage: [cvect,Cp]=expcov(coeffcovar,fixpind,filename,comments,fdate);
%        Example: coeffcovar=eye(5); expcov(coeffcovar,[],'data.cbn');
% 
%        

function expfou
%MATLAB Tour Partial Function Help:  fid_con
%
% EXPFOU Write data to a Fourier vector or a (maybe existing) file (for ELIS).
% 
%        Fvect=EXPFOU(freqvect,x,y,i,expno,filename,comments,fdate,digitnum)
% 
%        Output argument:
%        Fvect = vector, containing the same data as a .fnt file
% 
%        Input arguments:
%        freqvect = vector of frequency points
%        x = complex input amplitude vector (or array for multiple inputs)
%        y = complex output amplitude vector (or array for multiple outputs)
%            Each vector must be a column vector; x or y may be empty.
%            Results of different experiments must be given below each other,
%            as e.g. [xexp1;xexp2;xexp3]
%        i = Number(s) of the actual experiment(s). If several experiments are
%            given, they must be denoted by successive numbers. If i is empty or
%            missing, the default is  i=[1:length(x(:,1))/length(freqvect)].
%        expno = Total number of experiments: if missing, max(i) is assigned.
%        filename = name of the output file (string)
%            If the name has no extension, EXPFOU extends it by '.fbn'. If the
%            extension is .fbn, the result will be a binary file, else an ASCII
%            one. If the extension is '.fnt', no text is sent to the ASCII file,
%            only data. If filename is empty, no file will be generated.
%        comments = string with eventual comments (optional)
%        fdate = date (and time) string (optional). If fdate is missing or
%            empty, an actual date string will be generated.
%        digitnum (optional) = number of digits sent to ASCII files,
%            default: 5.   1<=digitnum<=16
% 
%        When exporting the data of the first experiment, any file with the same
%        name will be deleted.
%        The file will be created in the active subdirectory or folder.
%        If a file is generated, the most important values will be displayed on
%        the screen, unless a global variable 'expimpmessages' with value 'no'
%        is defined. When exporting the data of the first experiment, any file
%        with the same name will be deleted.
% 
%        Usage: Fvect=expfou(freqvect,x,y,i,expno,filename,comments,fdate,dign);
%        Example: expfou([1:20],ones(100,1),0.1*ones(100,1),[1:5],5,'data.fbn');
% 
%        

function exppar
%MATLAB Tour Partial Function Help:  fid_con
%
% EXPPAR Write parameters to a parameter vector or file (for use by ELIS).
% 
%        pvect=EXPPAR(domain,num,denom,delay,fs,Znum,Zdenom,fname,cmts,fdate)
% 
%        Output argument:
%        pvect = vector, containing the same data as the .pnt file
% 
%        Input arguments:
%        domain = 's' or 'z', depending on the domain;
%        num = numerator vector, coefficients of 1/z in ascending order,
%            or coefficients of s in descending order
%            for domain=='p', Znum contains the weights to calculate
%                the numerator polynomial, but this is should be avoided
%                because it is usually very badly conditioned
%        denom = denominator vector, coefficients of 1/z in ascending order,
%            or coefficients of s in descending order
%            for domain=='p', Zdenom contains the weights to calculate
%                the numerator polynomial, but this is should be avoided
%                because it is usually very badly conditioned
%        delay = additional delay
%        fs = sampling frequency in the z-domain
%            In the s-domain fs is the scaling frequency between the internal
%            representation, and the parameter file, given in Hz.
%            In p-domain, this is the scaling frequency for the orthogonal 
%                representation.
%        Two arguments for orthogonal polynomial representation,
%        for regular polynomial coefficients, they are empty:
%        Znum = orthogonal polynomial weights for numerator (see orthopol)
%        Zdenom = orthogonal polynomial weights for denominator (see orthopol)
%        fname = the name of the file (string)
%            If the name has no extension, this function extends it by '.pbn'.
%            If the extension is .pbn, the result will be a binary file,
%            else an ASCII text file. If the extension is '.pnt', no comment
%            is sent to the ASCII file, only data.
%            If fname is empty, no file will be generated.
%        cmts = string with eventual comments (optional)
%        fdate = date (and time) string (optional). If fdate is missing or
%            empty, an actual date string will be generated.
%        ntr = numerator belonging to the transient response
%        Zntr = orthogonal polynomial weights for the transient numerator
% 
%        If a file is generated, the most important values will be displayed on
%        the screen, unless a global variable 'expimpmessages' with value 'no'
%        is defined. 
%        The file will be created in the active subdirectory or folder.
% 
%        Usage: pvect=exppar(domain,num,denom,delay,fs,Zn,Zd,fname,cmts,fdate,ntr,Zntr);
%        Examples:
%           pvect=exppar('s',[1,1],[1,2,3,4]);
%           exppar('z',[1,1],[4,3,2,1],0,1,[],[],'filter.pnt','Trial',date);
% 
%        

function exptim
%MATLAB Tour Partial Function Help:  fid_con
%
% EXPTIM Write time data to a vector or a (maybe existing) file (for ELIS).
% 
%        tvect=EXPTIM(timevect,xt,yt,i,expno,filename,comments,fdate,digitnum)
% 
%        Output argument:
%        tvect = vector, containing the same data as would be sent to
%            a .tnt file.
% 
%        Input argument:
%        timevect = vector of time points
%        xt = input vector (or array for multiple inputs)
%        yt = output vector (or array for multiple outputs)
%            Each vector must be a column vector; xt or yt may be empty.
%            Results of different experiments must be given below each other,
%            as e.g. [xexp1;xexp2;xexp3]
%        i = Number(s) of the actual experiment(s). If several experiments are
%            given, they must be denoted by successive numbers. If i is empty or
%            missing, the default is  i=[1:length(xt(:,1))/length(timevect)].
%        expno = Total number of experiments, if empty, max(i) is assigned.
%        filename = name of the output file (string)
%            If the name has no extension, EXPTIM extends it by '.tbn'. If the
%            extension is .tbn, the result will be a binary file, else an ASCII
%            file. If the extension is '.tnt', no text is sent to the ASCII
%            file, only data.
%            If filename is empty, no file will be generated.
%        comments = string with eventual comments (optional)
%        fdate = date (and time) string (optional). If fdate is missing or
%            empty, an actual date string will be generated.
%        digitnum (optional) = number of digits sent to ASCII files,
%            default: 5.   1<=digitnum<=16
% 
%        When exporting the data of the first experiment, any file with the
%        same name will be deleted.
%        The file will be created in the active subdirectory or folder.
%        If a file is generated, the most important values will be displayed
%        on the screen, unless a global variable 'expimpmessages' with value
%        'no' is defined. When exporting the data of the first experiment, any
%        file with the same name will be deleted.
% 
%        Usage:
%             tvect=exptim(timevect,xt,yt,i,expno,filename,comments,fdate,dign);
%        Example: exptim([1:10],ones(50,1),0.1*ones(50,1),[1:5],5,'data.tbn');
% 
%        

function expvar
%MATLAB Tour Partial Function Help:  fid_con
%
% EXPVAR Write variance data to a 'variance' vector or file (for ELIS).
% 
%        vvect=EXPVAR(varx,vary,covxy,filename,comments,fdate,Ffile)
% 
%        Output argument:
%        vvect = vector, containing the same data as the .pnt file
% 
%        Input arguments:
%        varx = column, vector containing the variances of the real part (that
%            is, also of the imaginary part) of the input Fourier coefficients;
%            varx may be an array for multiple inputs
%        vary = column vector, containing the variances of the real part (that
%            is, also of the imaginary part) of the output Fourier coefficients;
%            vary may be an array for multiple outputs.
%        covxy = column vector of the complex input-output covariances
%            (0.5*E{conj(Nx)*Ny}). covxy may be empty. In the MIMO case covxy
%            contains either the covariances between input1 and output1, or
%            all the covariances beside each other, as [ci1o1,ci1o2,...ci2o1...]
%        filename = name of the output file
%            If the name has no extension, this function extends it by '.vbn'.
%            If the extension is .vbn, the result will be a binary file, else an
%            ASCII file. If the extension is '.vnt', no text is sent to the
%            ASCII file, but data. If filename is empty, no file will be
%            generated. The number of digits in ASCII files: digitnum=4
%        comments = string with eventual comments (optional)
%        fdate = date (and time) string (optional). If fdate is missing or
%            empty, an actual date string will be generated.
%        Ffile = associated Fourier file, readable for impfou (optional,
%              for cross-checking)
% 
%        If a file is generated, the most important values will be displayed on
%        the screen, unless a global variable 'expimpmessages' with value 'no'
%        is defined.
%        The file will be created in the active subdirectory or folder.
% 
%        Usage: vvect=expvar(varx,vary,covxy,filename,comments,fdate,Ffile)
%        Example: expvar(ones(20,1),0.1*ones(20,1),[],'data.vbn');
% 
%        

function impcov
%MATLAB Tour Partial Function Help:  fid_con
%
% IMPCOV Read covariance matrices from a covariance vector or a file.
% 
%        [coeffcovar,fixpind,comments,fdate]=IMPCOV(cdat,nofixp)
% 
%        Output arguments:
%        coeffcovar = covariance matrix (array), 

function impfou
%MATLAB Tour Partial Function Help:  fid_con
%
% IMPFOU Read complex amplitudes from a Fourier vector or file (used by ELIS).
% 
%        [freqvect,x,y,expno,comments,fdate]=IMPFOU(Fdat,expi)
% 
%        Output arguments:
%        freqvect = vector of frequency points
%        x = complex input amplitudes (column vector or array)
%        y = complex output amplitudes (column vector or array)
%        expno = Total number of experiments in Fdat
%        comments = optional, comment string in the input file (if any)
%        fdate = optional, comment string in the input file (if any)
% 
%        Input arguments:
%        Fdat = data vector or the name of the file, maybe an array
%            [freqvect,x,y]; the data vector contains
%            the data in the same order as a .fnt file.
%        expi = number(s) of the experiment(s) to be read (integer vector)
%            optional; if omitted or empty, all the experiments will be read.
% 
%        The file may be an ASCII file with comments (usual extension: .fou),
%        an ASCII file without comments (.fnt), or a binary file (.fbn).
%        The file has to be somewhere within the path of matlab, or the
%        path is to be explicitly given. Default extension: .fbn.
%        If a file is read, the most important values will be displayed on the
%        screen, unless a global variable 'expimpmessages' with value 'no' is
%        defined.
% 
%        Usage: [freqvect,x,y,expno,comments,fdate]=impfou(Fdat,expi);
%        Example: [freqvect,x,y,expno]=impfou('inpchan.fbn',[]);
% 
%        

function imppar
%MATLAB Tour Partial Function Help:  fid_con
%
% IMPPAR Read system parameters from a parameter vector or file (used by ELIS).
% 
%        [domain,num,denom,delay,fs,Znum,Zdenom,comments,fdate,ntr,Zntr]=IMPPAR(pdat,fsc)
% 
%        Output arguments:
%        domain = 's' or 'z', depending on the domain;
%        num = numerator vector,
%            coefficients of 1/z in ascending order
%            or coefficients of s in descending order
%            for domain=='p', Znum contains the weights to calculate
%                the numerator polynomial, but this is should be avoided
%                because it is usually very badly conditioned
%        denom = denominator vector,
%            coefficients of 1/z in ascending order
%            or coefficients of s in descending order
%            for domain=='p', Zdenom contains the weights to calculate
%                the numerator polynomial, but this is should be avoided
%                because it is usually very badly conditioned
%        delay = additional delay
%        fs = sampling frequency in the z-domain.
%            In p-domain, this is the scaling frequency for the orthogonal 
%                representation.
%            In the s-domain fs is the scaling frequency between
%            the internal representation, and the parameter file, given in Hz.
%        Two arguments for orthogonal polynomial representation,
%        for regular polynomial coefficients, they are empty:
%        Znum = orthogonal polynomial weights for numerator (see orthopol)
%        Zdenom = orthogonal polynomial weights for denominator (see orthopol)
%        comments = optional, comment string in the input file
%        fdate = optional, comment string in the input file (if any)
%        ntr = trnsient numerator vector
%        Zntr = orthogonal polynomial weights for transient numerator
% 
%        Input arguments:
%        pdat = data vector or the name of the file; the data vector contains
%            the data in the same order as a .pnt file.
%        fsc = scaling frequency between the s-domain internal representation,
%            and the parameter file. fsc is optional. 
%            If it is not given, for p-domain the scaling will be equal to the
%            one given in the file, otherwise no scaling will be done (fsc=1);
%            if it is empty (fsc=[]), the value in the file is used.
%            In the case of z-domain files, fsc is neglected.
% 
%        The file may be an ASCII file with comments (usual extension: .par),
%        an ASCII file without comments (.pnt) or a binary file (.pbn).
%        The file has to be somewhere within the path of matlab, or the
%        path is to be explicitly given. Default extension: .pbn.
%        If a file is read, the most important values will be displayed on the
%        screen, unless a global variable 'expimpmessages' with value 'no' is
%        defined. 
% 
%        Usage:
%        [domain,num,denom,delay,fs,Znum,Zdenom,comments,fdate,ntr,Zntr]=...
%                        imppar(pdat,fsc);
%        Example: [domain,num,denom,delay,fsc]=imppar('inpchans.pbn',[]);
% 
%        

function imptim
%MATLAB Tour Partial Function Help:  fid_con
%
% IMPTIM Read amplitudes from a time vector or file (used by ELIS).
% 
%        [timevect,xt,yt,expno,comments,fdate]=IMPTIM(tdat,expi)
% 
%        Output arguments:
%        timevect = vector of time instants
%        xt = complex input amplitudes (column vector or array)
%        yt = complex output amplitudes (column vector or array)
%        expno = Number of experiments
%        comments = optional, comment string in the input file (if any)
%        fdate = optional, comment string in the input file (if any)
% 
%        Input arguments:
%        tdat = data vector or the name of the file, maybe an array
%            [timevect,xt,yt]; ; the data vector contains
%            the data in the same order as a .tnt file.
%        expi = number(s) of the experiment(s) to be read (integer vector)
%            optional; if omitted or empty, all the experiments will be read
% 
%        The file may be an ASCII file with comments (usual extension: .tim),
%        an ASCII file without comments (.tnt), or a binary file (.tbn).
%        The file has to be somewhere within the path of matlab, or the
%        path is to be explicitly given. Default extension: .tbn.
%        If a file is read, the most important values will be displayed on the
%        screen, unless a global variable 'expimpmessages' with value 'no' is
%        defined.
% 
%        Usage: [timevect,xt,yt,expno,comments,fdate]=imptim(tdat,expi);
%        Example: [timevect,xt]=imptim('cable1.tbn');
% 
%        

function impvar
%MATLAB Tour Partial Function Help:  fid_con
%
% IMPVAR Read variances from a variance vector or file (used by ELIS).
% 
%        [varx,vary,covxy,comments,fdate]=IMPVAR(vdat)
% 
%        Output arguments:
%        varx = variance vector (array) of the real part (that is,
%            also of the imaginary part) of the complex input amplitudes.
%        vary = variance vector (array) of the real part (that is,
%            also of the imaginary part) of the complex output amplitudes.
%        covxy = column vector of the complex input-output covariances
%            (0.5*E{conj(Nx)*Ny}). covxy may be empty. In the MIMO case covxy
%            contains either the covariances between input1 and output1, or
%            all the covariances beside each other, as [i1o1,i1o2,...i2o1...]
%        comments = optional, comment string in the input file
%        fdate = optional, comment string in the input file (if any)
% 
%        Input arguments:
%        vdat = data vector or the name of the file, or maybe an array
%                [varx,vary] or [varx,vary,covxy]; the data vector contains
%                the data in the same order as a .vnt file.
% 
%        The file may be an ASCII file with comments (usual extension: .var),
%        an ASCII file without comments (.vnt), or a binary file (.vbn).
%        The file has to be somewhere within the path of matlab, or the
%        path is to be explicitly given. Default extension: .vbn.
%        If a file is read, the most important values will be displayed on the
%        screen, unless a global variable 'expimpmessages' with value 'no' is
%        defined.
% 
%        Usage: [varx,vary,covxy,comments,fdate]=impvar(vdat);
%        Example: [varx,vary]=impvar('emachine.vbn');
% 
%        

function loadasc
%MATLAB Tour Partial Function Help:  fid_con
%
% LOADASC Load data from an ASCII file into a variable with given name.
% 
%        [data,datline,header,comments,comline]=LOADASC(filename,ASCIItype)
% 
%        Output arguments:
%        data = data vector or array
%            If in the file each number is in a separate line, data will be a
%            vector. If each line contains several numbers (the number of
%            elements in each line must be the same), separated by spaces or
%            tabs, and ASCIItype is 'flat', data will be a corresponding matrix.
%            If ASCIItype is 'array', and each array line contains the same
%            number of elements, comments are filtered out, and the array of
%            numbers will be assigned to data.
%        datline = lines in ASCII file, which contain corresponding rows of data
%        header = first comment lines until first noncomment line (string array)
%        comments = comments as a string array
%        comline = lines in ASCII file, which contain the corresponding comment
%                  lines 
% 
%        Input arguments:
%        filename = name of the file
%        ASCIItype = type of the file
%            If the value of ASCIItype is 'flat', the ASCII file may contain
%            no text, if it is 'text' or 'array', then comments may be included,
%            preceded in each line by the character %.
%            For 'string', data contains an array of the strings of the numbers,
%            rather than the vector of their values.
%        Default value of ASCIItype: 'text'.
% 
%        The file has to be somewhere within the path of MATLAB.
% 
%        Usage: 
%            [data,datline,header,comments,comline]=loadasc(filename,ASCIItype);
%        Example: fprintf('lasctest.txt','%.0f %%N\n%.4e, %.4e %%amp1\n',1,5,6)
%                 type lasctest.txt, v3=loadasc('lasctest.txt')
% 
%        

function elis2tha
%MATLAB Tour Partial Function Help:  fid_con
%
% ELIS2THA Convert data to theta-format (System Identification Toolbox).
% 
%        theta=ELIS2THA(pdat,cdat,varet,numn,denomn)
% 
%        Output argument:
%        theta = theta matrix
%            Entries filled in with zeros:
%            theta(2,1) = Final Prediction Error
%            theta(3+nb+[1:nc+nd],nb+[1:nc+nd]) =
%                       covariances of the coefficients of C and D
% 
%        Input arguments:
%        pdat = the parameter vector (see EXPPAR) or the name of the parameter
%            file; the delay must not be negative, and it will be rounded to the
%            nearest integer.
%        cdat = the covariance matrix as an array, or in vector form (see
%            EXPCOV) or the name of the covariance file: it may be empty, if the
%            covariances are not available.
%        varet = variance of the time domain noise (before noise shaping).
%            If the variance of the real and of the imaginary parts of the
%            complex amplitudes is uniformly vary in the N-point spectrum,
%            calculate varet as follows:  varet=2/N*vary
%        numn = numerator of the observation noise shaping filter
%        denomn = denominator of the observation noise shaping filter
%            The sampling frequency for the noise shaping filters is the
%            same as that of the parameter vector.
%        Default values: numn=1, denomn=1
% 
%        Usage: theta=elis2tha(pdat,cdat,varet,numn,denomn);
%        Example: theta=elis2tha('inpchanz.pbn','inpchanz.cbn',2/256*1e-9);
% 
%        

function tha2elis
%MATLAB Tour Partial Function Help:  fid_con
%
% THA2ELIS Generates ELiS-format from the theta-format.
% 
%        [num,denom,delay,fs,vary,ccovar,domain]=THA2ELIS(theta,N,freqv)
% 
%        Output arguments:
%        num = numerator of the transfer function
%        denom = denominator of the transfer function
%        delay = additional delay in the model
%        fs = sampling frequency
%        vary = frequency domain variances at the frequencies in freqv
%        ccovar = covariance matrix of the vector [num,denom,delay]
%        domain = 's' or 'z'
% 
%        Input arguments:
%        theta = the theta-format to be converted.
%        N = length of the data record (number of FFT points)
%        freqv = vector of frequencies where the variance is to be calculated
%            If vary is not required, freqv is not necessary
% 
%        Usage: [num,denom,delay,fs,vary,ccovar,domain]=tha2elis(theta,N,freqv);
%        Example: theta=elis2tha('inpchanz.pbn','inpchanz.cbn',2/256*1e-9);
%                 [num,denom,delay,fs]=tha2elis(theta);
% 
%        

function digitnum
%MATLAB Tour Partial Function Help:  fid_con
%
% DIGITNUM Number of mantissa digits necessary to exactly represent numbers
% 
%        Usage: dignum=digitnum(x)
%        Example: digitnum(5.62)

function fdiddemo
%MATLAB Tour Partial Function Help:  fid_con
%
% FDIDDEMO Demonstrations of the Frequency Domain System Identification Toolbox
% 
%        Further: generation of the results and of some figures of the book:
%        Johan Schoukens and Rik Pintelon, Estimation of Linear Systems,
%        London, Pergamon Press, 1991.
%        This frame program calls several demo files, provided in the
%        fddemos subdirectory or folder.

function iterctrl
%MATLAB Tour Partial Function Help:  fid_con
%
% ITERCTRL Iteration control function using pull-down menu.
% 
%        checked=ITERCTRL(action,parent,items,visibility)
% 
%        ITERCTRL provides means to influence the iteration of functions
%        like elis, using a pull-down menu. The control is only effective
%        if the iterative function is programmed to obey.
%        ITERCTRL allows to pause iteration, keep the last graph, modify the
%        graph from the command line, print it, and to request finishing
%        of the iteration after the currect cycle, with proper output arguments,
%        even if the iteration termination criteria are otherwise not met.
%        Activate menu by iterctrl('initialize') or simply iterctrl;
%        select item from program by iterctrl(item-label);
%        look for selected item from program by iterctrl('checked').
%        Calling iterctrl('initialize',parent,'Abort|Finish','off') creates
%        an invisible menu in figure with handle given in parent, with
%        selectable options Abort and Finish. items may be empty or 'all' in
%        order to have all menu options.
% 
%        Output argument:
%        checked = checked menu item (string)
%            If action='Iteration', checked is the status of the Iteration
%                menu item: 'selected' or 'not selected'
%                Warning! This latter information depends on handling of the
%                event que, and may become valid with a significant delay only.
%            checked is empty if the uimenu is not defined.
%            For 'initialize', iterctrl returns the uimenu handle of checked
%                item.
% 
%        Input argument:
%        action = type of action to be performed:
%            'initialize': create and initialize menu (this is the default)
%            'checked': return label of checked menu item
%            'Iteration': get info if menu item is selected
%            'Abort','Cancel','Continue','Finish','Hold graph','Keyboard',
%            'Matlab prompt','Pause','Plot','Print','Zoom':
%                select corresponding item
%            'delete': delete menu
%        The following arguments are only used with action='initialize':
%        parent = handle of parent figure (default: gcf)
%        items = list of submenu items to be displayed. 'all' creates all
%            possible menu items
%        visibility = 'on' or 'off', used with action set to 'initialize';
%            set visibility of Iteration menu. Default: 'on'
% 
%        Usage: checked=iterctrl(action,parent,items,visibility);
%        Examples: iterctrl; iterctrl('Pause'); iterctrl('checked')

function loadvar
%MATLAB Tour Partial Function Help:  fid_con
%
% LOADVAR Read the value of a single variable from a mat-file.
% 
%        variable=LOADVAR(matfile,varname)
% 
%        Output argument:
%        variable = the variable to take the value of the loaded one
% 
%        Input arguments:
%        matfile = name of the mat-file. Default extension: .mat
%        varname = name of the variable in the mat-file
%            if varname is 'who' or 'whos', the command will be executed.
% 
%        The file has to be somewhere within the path of matlab, or the
%        path is to be explicitly given.
% 
%        Usage: variable=loadvar(matfile,varname);
%        Example: itlimit=loadvar('inpchans.ebn','itmax');
% 
%        

function pairs
%MATLAB Tour Partial Function Help:  fid_con
%
% PAIRS  Closest pairs between elements of complex vectors.
% 
%        [indab,cycle,digits]=PAIRS(a,b,p,maxcycle,digitsreq,D)
% 
%        Minimize sum(D(i,indab(i))) or sum(abs(a(i)-b(indab(i)))^p), using the
%        Hungarian method.
% 
%        Output arguments:
%        indab = indices of the elements of b, belonging to the corresponding
%            elements of a
%        cycle = number of performed iterative cycles; cycle is 0 if simple
%            nearest neighbors give optimum.
%        digits = number of digits used in the last step of iterative
%            minimization.
% 
%        Input arguments:
%        a = first complex vector
%        b = second complex vector, length(b)>=length(a)
%        p = exponent of the distance (if D is not given), default=2.
%        maxcycle=maximum number of weight distribution cycles; if optimum is
%            not reached within the given number of cycles, indab contains at
%            least one zero index. default: maxcycle=inf.
%        digitsreq = digits to be used in the weighting iteration; if
%            digitsreq is not given and maxcycle is finite, digits will be
%            adjusted to provide convergence within specified number of cycles,
%            but digits will not be set smaller than 2.
%            default value: floor(log10(1/eps)).
%        D = matrix of edge weights; if not given, the pth power of distances
%            will be used.
% 
%        Usage: [indab,cycle,digits]=pairs(a,b,p,maxcycle,digitsreq,D)
%        Examples: indab=pairs(roots([1,2,3,4]),roots([1.01,2,3,4]),2);
%                  pind=pairs([-0.1-1.5*j,-0.1+1.5*j],roots([1,2,3,4]));
% 
%        

function savevar
%MATLAB Tour Partial Function Help:  fid_con
%
% SAVEVAR Save a single variable to an existing mat-file.
% 
%        SAVEVAR(matfile,varname,varvalue)
% 
%        Side effects: string variable in the file: donotusethisnamefns,
%        variables in the file: donotusethisnamevns,donotusethisnamevvs
% 
%        Input arguments:
%        matfile = full name of the mat-file
%        varname = name of the variable in the mat-file
%        varvalue = the desired value of the variable. If varvalue is not
%            given, the variable will be deleted from the file.
% 
%        Usage: savevar(matfile,varname,varvalue)
%        Example: x=1; save savevtst.mat x, savevar('savevtst.mat','x',10)
%                 savevar('savevtst.mat','y',20)
% 
%        

function yesinput
%MATLAB Tour Partial Function Help:  fid_con
%
% YESINPUT 'intelligent' input with default and possible answers.
% 
%        answer=YESINPUT(question,default,possib)
% 
%        YESINPUT prompts for input from the keyboard, displaying the string
%        'question' and the default value of the answer.
%        If the answer is <Enter> or <Return>, the 'default' value is assigned.
%        The answer is checked for correctness.
% 
%        Input arguments:
%        question = string to be displayed as a question
%        default = default value of the variable to be read in; the function
%            checks if this is a string or not, to decide the type of the
%            variable to be read in. If default is empty, this may not help,
%            in this case the type of possib will decide, otherwise string
%            answer is returned. The default answer will be automatically
%            accepted (that is, no key has to be pressed) if a global variable
%            is defined with the name  yesinpacceptdef  and the value 'yes'
%        possib = (optional) possibilities for the answer:
%            if the type of the desired answer is string, 'possib' may be either
%            a string array, where the rows contain the acceptable answers, or
%            a string containing the acceptable answers, separated by | ('or')
%            characters.
%            If a number is desired, 'possib' may be an 1x2 vector, containing
%            the lower and higher limits for the input:
%            possib(1)<=answer<=possib(2)
%            For incorrect answers, the question is repeated.
% 
%        Output argument:
%        answer = accepted answer
% 
%        Usage: answer=yesinput(question,default,possib);
%        Examples:
%           order=yesinput('Order of the filter',10,[0,12]);
%           color=yesinput('Color used on the plot','red','red|blue|green');
% 
%        

function ywalk
%MATLAB Tour Partial Function Help:  fid_con
%
% YWALK  Recursive filter design using a least-squares method.
% 
%        [B,A] = YWALK(N,F,M) finds the N-th order recursive filter
%        coefficients B and A such that the filter:
%                                      -1             -(n-1)
%                   B(z)   b(1) + b(2)z + .... + b(n)z
%                   ---- = ---------------------------
%                                      -1             -(n-1)
%                   A(z)    1   + a(1)z + .... + a(n)z
% 
%        matches the magnitude frequency response given by vectors F and M.
%        Vectors F and M specify the frequency and magnitude breakpoints for
%        the filter such that PLOT(F,M) would show a plot of the desired
%        frequency response. The frequencies in F must be between 0.0 and 1.0,
%        with 1.0 corresponding to half the sample rate. They must be in
%        increasing order and start with 0.0 and end with 1.0.
% 
%        

function bookdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% BOOKDEMO Demonstrations of the FDIDENT Toolbox using measured data.
%        The data are the same as used in the following book:
%        J. Schoukens and Rik Pintelon, Identification of Linear Systems.
%        London, Pergamon Press, 1991.

function demos
%MATLAB Tour Partial Function Help:  fid_con
%
%  Examples and demonstrations.
% 
%    Type 'demo' at the command line to browse more demos of
%    MATLAB, the Toolboxes, and SIMULINK.
% 
% 
%  MATLAB/Introduction.
%    demo        - Browse demos for MATLAB, Toolboxes, and SIMULINK
% 
%  MATLAB/Matrices.
%    intro       - Introduction to basic matrix operations in MATLAB.
%    inverter    - Demonstrate the inversion of a matrix.
%    buckydem    - Connectivity graph of the Buckminster Fuller geodesic dome.
%    sparsity    - Demonstrate effect of sparsity orderings.
%    matmanip    - Introduction to matrix manipulation.
%    eigmovie    - Symmetric eigenvalue movie.
%    rrefmovie   - Computation of Reduced Row Echelon Form.
%    delsqdemo   - Finite difference Laplacian on various domains.
%    sepdemo     - Separators for a finite element mesh.
%    airfoil     - Display sparse matrix from NASA airfoil.
%    eigshow     - Graphical demonstration of matrix eigenvalues.
%    svdshow     - Graphical demonstration of matrix singular values.
% 
%  MATLAB/Numerics.
%    funfuns     - Demonstrate functions that operate on other functions.
%    fitdemo     - Nonlinear curve fit with simplex algorithm.
%    sunspots    - FFT: the answer is 11.08, what is the question?
%    e2pi        - 2D visual solutions: Which is greater, e^pi or pi^e?
%    bench       - MATLAB Benchmark.
%    fftdemo     - Use of the fast finite Fourier transform.
%    census      - Try to predict the US population in the year 2000.
%    spline2d    - Demonstrate GINPUT and SPLINE in two dimensions.
%    lotkademo   - An example of ordinary differential equation solution.
%    quaddemo    - Adaptive quadrature.
%    zerodemo    - Zerofinding with fzero.
%    fplotdemo   - Plot a function.
%    quake       - Loma Prieta Earthquake.
% 
%  MATLAB/Visualization.
%    graf2d      - 2D Plots: Demonstrate XY plots in MATLAB.
%    graf2d2     - 3D Plots: Demonstrate XYZ plots in MATLAB.
%    grafcplx    - Demonstrate complex function plots in MATLAB.
%    lorenz      - Plot the orbit around the Lorenz chaotic attractor.
%    imageext    - Image colormaps: changing and rotating colormaps.
%    xpklein     - Klein bottle demo.
%    vibes       - Vibration movie: Vibrating L-shaped membrane.
%    xpsound     - Visualizing sound: Demonstrate MATLAB's sound capability.
%    imagedemo   - Demonstrate MATLAB's image capability.
%    penny       - Several views of the penny data.
%    earthmap    - View Earth's topography.
%    xfourier    - Graphic demo of Fourier series expansion.
%    colormenu   - Select color map.
%    cplxdemo    - Maps of functions of a complex variable.
% 
%  MATLAB/Language.
%    xplang      - Introduction to the MATLAB language.
%    hndlgraf    - Demonstrate Handle Graphics for line plots.
%    graf3d      - Demonstrate Handle Graphics for surface plots.
%    hndlaxis    - Demonstrate Handle Graphics for axes.
% 
%  MATLAB/ODE Suite.
%    odedemo     - Demo for the ODE suite integrators.
%    a2ode       - Stiff problem, linear with real eigenvalues (A2 of EHL).
%    a3ode       - Stiff problem, linear with real eigenvalues (A3 of EHL).
%    b5ode       - Stiff problem, linear with complex eigenvalues (B5 of EHL).
%    ballode     - Equations of motion for a bouncing ball used by BALLDEMO.
%    besslode    - Bessel's equation of order 0 used by BESSLDEMO.
%    brussode    - Stiff problem modelling a chemical reaction (Brusselator).
%    buiode      - Stiff problem with analytical solution due to Bui.
%    chm6ode     - Stiff problem CHM6 from Enright and Hull.
%    chm7ode     - Stiff problem CHM7 from Enright and Hull.
%    chm9ode     - Stiff problem CHM9 from Enright and Hull.
%    d1ode       - Stiff problem, nonlinear with real eigenvalues (D1 of EHL).
%    fem1ode     - Stiff problem with a time-dependent mass matrix.
%    fem2ode     - Stiff problem with a time-independent mass matrix.
%    gearode     - Stiff problem due to Gear as quoted by van der Houwen.
%    hb1ode      - Stiff problem 1 of Hindmarsh and Byrne.
%    hb2ode      - Stiff problem 2 of Hindmarsh and Byrne.
%    hb3ode      - Stiff problem 3 of Hindmarsh and Byrne.
%    orbitode    - Restricted 3 body problem used by ORBITDEMO.
%    orbt2ode    - Non-stiff problem D5 of Hull et al.
%    rigidode    - Euler equations of a rigid body without external forces.
%    sticode     - A spring-driven mass stuck to surface, used by STICDEMO.
%    vdpode      - Parameterizable van der Pol equation (stiff for large mu).
% 
%  Extras/Gallery.
%    knot        - Tube surrounding a three-dimensional knot.
%    quivdemo    - Demonstrate the quiver function.
%    klein1      - Construct a Klein bottle.
%    cruller     - Construct cruller.
%    tori4       - Hoops: Construct four linked tori.
%    spharm2     - Construct spherical surface harmonic.
%    modes       - Plot 12 modes of the L-shaped membrane.
%    logo        - Display the MATLAB L-shaped membrane logo.
% 
%  Extras/Games.
%    fifteen     - Sliding puzzle.
%    xpbombs     - Minesweeper game.
%    life        - Conway's Game of Life.
%    soma        - Soma cube.
% 
%  Extras/Miscellaneous.
%    truss       - Animation of a bending bridge truss.
%    travel      - Traveling salesman problem.
%    spinner     - Colorful lines spinning through space.
%    xpquad      - Superquadrics plotting demonstration.
%    codec       - Alphabet transposition coder/decoder.
%    xphide      - Visual perception of objects in motion.
%    makevase    - Generate and plot a surface of revolution.
%    wrldtrv     - Great circle flight routes around the globe.
%    logospin    - Movie of The MathWorks' logo spinning.
%    crulspin    - Spinning cruller movie.
%    quatdemo    - Quaternion rotation.
% 
%  General Demo/Helper functions.
%    cmdlnwin    - An Demo gateway routine for playing command line demos.
%    cmdlnbgn    - Set up for command line demos.
%    cmdlnend    - clean up after command line demos.
%    finddemo    - Finds demos available for individual toolboxes.
%    helpfun     - Utility function for displaying help text conveniently.
%    pltmat      - Display a matrix in a figure window.
% 
%  MATLAB/Helper functions.
%    bucky       - The graph of the Buckminster Fuller geodesic dome.
%    peaks       - A sample function of two variables.
%    membrane    - Generate MathWorks' logo.
% 
% 
%  

function fddems1
%MATLAB Tour Partial Function Help:  fid_con
%
% FDDEMS1  Return fdident demo information to the MATLAB Demo: general demos.

function fddems2
%MATLAB Tour Partial Function Help:  fid_con
%
% FDDEMS2   Return fdident demo information to the MATLAB Demo: book demos.

function dibsdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% DIBSDEMO Demonstration of dibs and dibsimpr

function eltpexpl
%MATLAB Tour Partial Function Help:  fid_con
%
% ELTPEXPL An example for the use of elistper

function fdcourse
%MATLAB Tour Partial Function Help:  fid_con
%
% FDCOURSE Course sequence for self-study
%        of the Frequency Domain System Identification Toolbox

function fdsynchr
%MATLAB Tour Partial Function Help:  fid_con
%
% FDSYNCHR Sample script file for synchronization of experiments
%        The experiments are given in a Fourier file.
%        Synchronized experiments are also put at the end into a file.
%        For general applications, the use of files is not necessary.

function gmeandem
%MATLAB Tour Partial Function Help:  fid_con
%
% GMEANDEM Demonstration of gmean (geometric mean of complex numbers)

function mscldemo
%MATLAB Tour Partial Function Help:  fid_con
%
% MSCLDEMO Demonstration of msinclip

function msprdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% MSPRDEMO Demonstration of msinprep

function mlbsdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% MLBSDEMO Demonstration of mlbs

function optexdem
%MATLAB Tour Partial Function Help:  fid_con
%
% OPTEXDEM Demonstration of optexcit

function pairsdem
%MATLAB Tour Partial Function Help:  fid_con
%
% PAIRSDEM Demonstration of pairs (geometric mean of complex numbers)

function pzdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% PZDEMO Demonstration of plotelpz

function simudemo
%MATLAB Tour Partial Function Help:  fid_con
%
% SIMUDEMO Demonstration: usage of FDIDENT Toolbox with simulated data
%        Simulation of frequency domain data from user-defined s-domain system
%        parameters and noise variances, followed by identification (using
%        elis). The usage of a few functions of the Frequency Domain System
%        Identification Toolbox is illustrated in a generated simple m-file. 

function tfdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% TFDEMO Demonstration of ploteltf

function varandem
%MATLAB Tour Partial Function Help:  fid_con
%
% VARANDEM Demonstration of varanal

function alupldem
%MATLAB Tour Partial Function Help:  fid_con
%
% ALUPLDEM Demonstration - system identification: two aluminum plates

function bandpdem
%MATLAB Tour Partial Function Help:  fid_con
%
% BANDPDEM: Demonstration - system identification: passive bandpass filter

function bpcordem
%MATLAB Tour Partial Function Help:  fid_con
%
% BPCORDEM Demonstration - phase correction of a bandpass filter

function cabledem
%MATLAB Tour Partial Function Help:  fid_con
%
% CABLEDEM Demonstration - processing of cable measurements

function crankdem
%MATLAB Tour Partial Function Help:  fid_con
%
% CRANKDEM Demonstration - system identification: crankcase

function emachdem
%MATLAB Tour Partial Function Help:  fid_con
%
% EMACHDEM Demonstration - system identification: electrical machine

function glfibdem
%MATLAB Tour Partial Function Help:  fid_con
%
% GLFIBDEM Demonstration - system identification: rectangular glass fiber plate

function inpchdem
%MATLAB Tour Partial Function Help:  fid_con
%
% INPCHDEM Demonstration - compensation of an input channel

function lowpdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% LOWPDEMO Demonstration - system identification: active lowpass filter

function lpelabex
%MATLAB Tour Partial Function Help:  fid_con
%
% LPELABEX Demonstration - an elaborated example of transfer function estimation

function rarmdemo
%MATLAB Tour Partial Function Help:  fid_con
%
% RARMDEMO Demonstration - system identification: flexible robot arm

function fdidpaus
%MATLAB Tour Partial Function Help:  fid_con
%
% FDIDPAUS Utility to stop in demontrations to show messages in Command Window
% 
%        Input argument:
%        mode = 'y' or empty: stop with message in command window
%               'n': don't stop
%               'p': allow switch to command window by pressing a key
%        ypos = vertical position of text
%        tim  = time to wait in seconds
% 
%        Usage: fdidpaus(mode,ypos,tim)

function grapause
%MATLAB Tour Partial Function Help:  fid_con
%
% GRAPAUSE Utility to stop at graphs, save plot etc.
% 
%         The name of the calling file (tfile) is shown if yesinput is
%         automatic, or printstm contains the string 'print' in any form.
% 
%        Input arguments:
%        tfile = name of the test file
%        grnoin = actual value of graph number
%        printstm = print statement
%        xp,yp = position of pause message in absolute coordinates
% 
%        Usage: grnoout=grapause(tfile,grnoin,printstm,xp,yp);
% 
%        Last modified: 10-Mar-1997

function plotcabl
%MATLAB Tour Partial Function Help:  fid_con
%
% PLOTCABL Plot cable measurement data

function plotfou
%MATLAB Tour Partial Function Help:  fid_con
%
% PLOTFOU Plot contents of Fourier files

function plotvar
%MATLAB Tour Partial Function Help:  fid_con
%
% PLOTVAR Plot contents of variance file
%        freqvect vector must exist in the workspace

function plotrarm
%MATLAB Tour Partial Function Help:  fid_con
%
% PLOTRARM  Plot time domain data from file robotarm.mat

