# doc-cache created by Octave 4.4.0
# name: cache
# type: cell
# rows: 3
# columns: 12
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
cohere


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 377
 Usage:
   [Pxx,freq] = cohere(x,y,Nfft,Fs,window,overlap,range,plot_type,detrend)

     Estimate (mean square) coherence of signals "x" and "y".
     Use the Welch (1967) periodogram/FFT method.
     Compatible with Matlab R11 cohere and earlier.
     See "help pwelch" for description of arguments, hints and references
     --- especially hint (7) for Matlab R11 defaults.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Usage:
   [Pxx,freq] = cohere(x,y,Nfft,Fs,window,overlap,range,plot_type,detren



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
csd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 358
 Usage:
   [Pxx,freq] = csd(x,y,Nfft,Fs,window,overlap,range,plot_type,detrend)

     Estimate cross power spectrum of data "x" and "y" by the Welch (1967)
     periodogram/FFT method.  Compatible with Matlab R11 csd and earlier.
     See "help pwelch" for description of arguments, hints and references
     --- especially hint (7) for Matlab R11 defaults.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 79
 Usage:
   [Pxx,freq] = csd(x,y,Nfft,Fs,window,overlap,range,plot_type,detrend)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
iirlp2mb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1305
 IIR Low Pass Filter to Multiband Filter Transformation

 [Num,Den,AllpassNum,AllpassDen] = iirlp2mb(B,A,Wo,Wt)
 [Num,Den,AllpassNum,AllpassDen] = iirlp2mb(B,A,Wo,Wt,Pass)

 Num,Den:               numerator,denominator of the transformed filter
 AllpassNum,AllpassDen: numerator,denominator of allpass transform,
 B,A:                   numerator,denominator of prototype low pass filter
 Wo:                    normalized_angular_frequency/pi to be transformed
 Wt:                    [phi=normalized_angular_frequencies]/pi target vector
 Pass:                  This parameter may have values 'pass' or 'stop'.  If
                        not given, it defaults to the value of 'pass'.

 With normalized ang. freq. targets 0 < phi(1) <  ... < phi(n) < pi radians

 for Pass == 'pass', the target multiband magnitude will be:
       --------       ----------        -----------...
      /        \     /          \      /            .
 0   phi(1) phi(2)  phi(3)   phi(4)   phi(5)   (phi(6))    pi

 for Pass == 'stop', the target multiband magnitude will be:
 -------      ---------        ----------...
        \    /         \      /           .
 0   phi(1) phi(2)  phi(3)   phi(4)  (phi(5))              pi

 Example of use:
 [B, A] = butter(6, 0.5);
 [Num, Den] = iirlp2mb(B, A, 0.5, [.2 .4 .6 .8]);



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
 IIR Low Pass Filter to Multiband Filter Transformation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
invfreq


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1689
 usage: [B,A] = invfreq(H,F,nB,nA)
        [B,A] = invfreq(H,F,nB,nA,W)
        [B,A] = invfreq(H,F,nB,nA,W,[],[],plane)
        [B,A] = invfreq(H,F,nB,nA,W,iter,tol,plane)

 Fit filter B(z)/A(z) or B(s)/A(s) to complex frequency response at
 frequency points F. A and B are real polynomial coefficients of order
 nA and nB respectively.  Optionally, the fit-errors can be weighted vs
 frequency according to the weights W. Also, the transform plane can be
 specified as either 's' for continuous time or 'z' for discrete time. 'z'
 is chosen by default.  Eventually, Steiglitz-McBride iterations will be
 specified by iter and tol.

 H: desired complex frequency response
     It is assumed that A and B are real polynomials, hence H is one-sided.
 F: vector of frequency samples in radians
 nA: order of denominator polynomial A
 nB: order of numerator polynomial B
 plane='z': F on unit circle (discrete-time spectra, z-plane design)
 plane='s': F on jw axis     (continuous-time spectra, s-plane design)
 H(k) = spectral samples of filter frequency response at points zk,
  where zk=exp(sqrt(-1)*F(k)) when plane='z' (F(k) in [0,.5])
     and zk=(sqrt(-1)*F(k)) when plane='s' (F(k) nonnegative)
 Example:
     [B,A] = butter(12,1/4);
     [H,w] = freqz(B,A,128);
     [Bh,Ah] = invfreq(H,F,4,4);
     Hh = freqz(Bh,Ah);
     disp(sprintf('||frequency response error|| = %f',norm(H-Hh)));

 References: J. O. Smith, "Techniques for Digital Filter Design and System
      Identification with Application to the Violin, Ph.D. Dissertation,
      Elec. Eng. Dept., Stanford University, June 1983, page 50; or,

 http://ccrma.stanford.edu/~jos/filters/FFT_Based_Equation_Error_Method.html



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 usage: [B,A] = invfreq(H,F,nB,nA)
        [B,A] = invfreq(H,F,nB,nA,W)
        



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
invfreqs


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 943
 Usage: [B,A] = invfreqs(H,F,nB,nA)
        [B,A] = invfreqs(H,F,nB,nA,W)
        [B,A] = invfreqs(H,F,nB,nA,W,iter,tol,'trace')

 Fit filter B(s)/A(s)to the complex frequency response H at frequency
 points F.  A and B are real polynomial coefficients of order nA and nB.
 Optionally, the fit-errors can be weighted vs frequency according to
 the weights W.
 Note: all the guts are in invfreq.m

 H: desired complex frequency response
 F: frequency (must be same length as H)
 nA: order of the denominator polynomial A
 nB: order of the numerator polynomial B
 W: vector of weights (must be same length as F)

 Example:
       B = [1/2 1];
       A = [1 1];
       w = linspace(0,4,128);
       H = freqs(B,A,w);
       [Bh,Ah] = invfreqs(H,w,1,1);
       Hh = freqs(Bh,Ah,w);
       plot(w,[abs(H);abs(Hh)])
       legend('Original','Measured');
       err = norm(H-Hh);
       disp(sprintf('L2 norm of frequency response error = %f',err));



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Usage: [B,A] = invfreqs(H,F,nB,nA)
        [B,A] = invfreqs(H,F,nB,nA,W)
      



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
invfreqz


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 820
 usage: [B,A] = invfreqz(H,F,nB,nA)
        [B,A] = invfreqz(H,F,nB,nA,W)
        [B,A] = invfreqz(H,F,nB,nA,W,iter,tol,'trace')

 Fit filter B(z)/A(z)to the complex frequency response H at frequency
 points F.  A and B are real polynomial coefficients of order nA and nB.
 Optionally, the fit-errors can be weighted vs frequency according to
 the weights W.
 Note: all the guts are in invfreq.m

 H: desired complex frequency response
 F: normalized frequency (0 to pi) (must be same length as H)
 nA: order of the denominator polynomial A
 nB: order of the numerator polynomial B
 W: vector of weights (must be same length as F)

 Example:
     [B,A] = butter(4,1/4);
     [H,F] = freqz(B,A);
     [Bh,Ah] = invfreq(H,F,4,4);
     Hh = freqz(Bh,Ah);
     disp(sprintf('||frequency response error|| = %f',norm(H-Hh)));



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 usage: [B,A] = invfreqz(H,F,nB,nA)
        [B,A] = invfreqz(H,F,nB,nA,W)
      



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
ncauer


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 380
 usage: [Zz, Zp, Zg] = ncauer(Rp, Rs, n)

 Analog prototype for Cauer filter.
 [z, p, g]=ncauer(Rp, Rs, ws)
 Rp = Passband ripple
 Rs = Stopband ripple
 Ws = Desired order

 References:

 - Serra, Celso Penteado, Teoria e Projeto de Filtros, Campinas: CARTGRAF,
   1983.
 - Lamar, Marcus Vinicius, Notas de aula da disciplina TE 456 - Circuitos
   Analogicos II, UFPR, 2001/2002.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
 usage: [Zz, Zp, Zg] = ncauer(Rp, Rs, n)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
pburg


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3777
 usage:
    [psd,f_out] = pburg(x,poles,freq,Fs,range,method,plot_type,criterion)

 Calculate Burg maximum-entropy power spectral density.
 The functions "arburg" and "ar_psd" do all the work.
 See "help arburg" and "help ar_psd" for further details.

 ARGUMENTS:
     All but the first two arguments are optional and may be empty.
   x       %% [vector] sampled data

   poles   %% [integer scalar] required number of poles of the AR model

   freq    %% [real vector] frequencies at which power spectral density
           %%               is calculated
           %% [integer scalar] number of uniformly distributed frequency
           %%          values at which spectral density is calculated.
           %%          [default=256]

   Fs      %% [real scalar] sampling frequency (Hertz) [default=1]


 CONTROL-STRING ARGUMENTS -- each of these arguments is a character string.
   Control-string arguments can be in any order after the other arguments.


   range   %% 'half',  'onesided' : frequency range of the spectrum is
           %%       from zero up to but not including sample_f/2.  Power
           %%       from negative frequencies is added to the positive
           %%       side of the spectrum.
           %% 'whole', 'twosided' : frequency range of the spectrum is
           %%       -sample_f/2 to sample_f/2, with negative frequencies
           %%       stored in "wrap around" order after the positive
           %%       frequencies; e.g. frequencies for a 10-point 'twosided'
           %%       spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1
           %% 'shift', 'centerdc' : same as 'whole' but with the first half
           %%       of the spectrum swapped with second half to put the
           %%       zero-frequency value in the middle. (See "help
           %%       fftshift". If "freq" is vector, 'shift' is ignored.
           %% If model coefficients "ar_coeffs" are real, the default
           %% range is 'half', otherwise default range is 'whole'.

   method  %% 'fft':  use FFT to calculate power spectral density.
           %% 'poly': calculate spectral density as a polynomial of 1/z
           %% N.B. this argument is ignored if the "freq" argument is a
           %%      vector.  The default is 'poly' unless the "freq"
           %%      argument is an integer power of 2.

 plot_type %% 'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db':
           %% specifies the type of plot.  The default is 'plot', which
           %% means linear-linear axes. 'squared' is the same as 'plot'.
           %% 'dB' plots "10*log10(psd)".  This argument is ignored and a
           %% spectrum is not plotted if the caller requires a returned
           %% value.

 criterion %% [optional string arg]  model-selection criterion.  Limits
           %%       the number of poles so that spurious poles are not
           %%       added when the whitened data has no more information
           %%       in it (see Kay & Marple, 1981). Recognized values are
           %%  'AKICc' -- approximate corrected Kullback information
           %%             criterion (recommended),
           %%   'KIC'  -- Kullback information criterion
           %%   'AICc' -- corrected Akaike information criterion
           %%   'AIC'  -- Akaike information criterion
           %%   'FPE'  -- final prediction error" criterion
           %% The default is to NOT use a model-selection criterion

 RETURNED VALUES:
     If return values are not required by the caller, the spectrum
     is plotted and nothing is returned.
   psd       %% [real vector] power-spectral density estimate
   f_out     %% [real vector] frequency values

 HINTS
   This function is a wrapper for arburg and ar_psd.
   See "help arburg", "help ar_psd".



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 usage:
    [psd,f_out] = pburg(x,poles,freq,Fs,range,method,plot_type,criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
polystab


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 156
 b = polystab(a)

 Stabilize the polynomial transfer function by replacing all roots
 outside the unit circle with their reflection inside the unit circle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
 b = polystab(a)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
pwelch


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7135
 USAGE:
   [spectra,freq] = pwelch(x,window,overlap,Nfft,Fs,
                           range,plot_type,detrend,sloppy)
     Estimate power spectral density of data "x" by the Welch (1967)
     periodogram/FFT method.  All arguments except "x" are optional.
         The data is divided into segments.  If "window" is a vector, each
     segment has the same length as "window" and is multiplied by "window"
     before (optional) zero-padding and calculation of its periodogram. If
     "window" is a scalar, each segment has a length of "window" and a
     Hamming window is used.
         The spectral density is the mean of the periodograms, scaled so that
     area under the spectrum is the same as the mean square of the
     data.  This equivalence is supposed to be exact, but in practice there
     is a mismatch of up to 0.5% when comparing area under a periodogram
     with the mean square of the data.

  [spectra,freq] = pwelch(x,y,window,overlap,Nfft,Fs,
                          range,plot_type,detrend,sloppy,results)
     Two-channel spectrum analyser.  Estimate power spectral density, cross-
     spectral density, transfer function and/or coherence functions of time-
     series input data "x" and output data "y" by the Welch (1967)
     periodogram/FFT method.
       pwelch treats the second argument as "y" if there is a control-string
     argument "cross", "trans", "coher" or "ypower"; "power" does not force
     the 2nd argument to be treated as "y".  All other arguments are
     optional.  All spectra are returned in matrix "spectra".

  [spectra,Pxx_ci,freq] = pwelch(x,window,overlap,Nfft,Fs,conf,
                                 range,plot_type,detrend,sloppy)
  [spectra,Pxx_ci,freq] = pwelch(x,y,window,overlap,Nfft,Fs,conf,
                                 range,plot_type,detrend,sloppy,results)
     Estimates confidence intervals for the spectral density.
     See Hint (7) below for compatibility options.  Confidence level "conf"
     is the 6th or 7th numeric argument.  If "results" control-string
     arguments are used, one of them must be "power" when the "conf"
     argument is present; pwelch can estimate confidence intervals only for
     the power spectrum of the "x" data.  It does not know how to estimate
     confidence intervals of the cross-power spectrum, transfer function or
     coherence; if you can suggest a good method, please send a bug report.

 ARGUMENTS
 All but the first argument are optional and may be empty, except that
 the "results" argument may require the second argument to be "y".

 x           %% [non-empty vector] system-input time-series data
 y           %% [non-empty vector] system-output time-series data

 window      %% [real vector] of window-function values between 0 and 1; the
             %%       data segment has the same length as the window.
             %%       Default window shape is Hamming.
             %% [integer scalar] length of each data segment.  The default
             %%       value is window=sqrt(length(x)) rounded up to the
             %%       nearest integer power of 2; see 'sloppy' argument.

 overlap     %% [real scalar] segment overlap expressed as a multiple of
             %%       window or segment length.   0 <= overlap < 1,
             %%       The default is overlap=0.5 .

 Nfft        %% [integer scalar] Length of FFT.  The default is the length
             %%       of the "window" vector or has the same value as the
             %%       scalar "window" argument.  If Nfft is larger than the
             %%       segment length, "seg_len", the data segment is padded
             %%       with "Nfft-seg_len" zeros.  The default is no padding.
             %%       Nfft values smaller than the length of the data
             %%       segment (or window) are ignored silently.

 Fs          %% [real scalar] sampling frequency (Hertz); default=1.0

 conf        %% [real scalar] confidence level between 0 and 1.  Confidence
             %%       intervals of the spectral density are estimated from
             %%       scatter in the periodograms and are returned as Pxx_ci.
             %%       Pxx_ci(:,1) is the lower bound of the confidence
             %%       interval and Pxx_ci(:,2) is the upper bound.  If there
             %%       are three return values, or conf is an empty matrix,
             %%       confidence intervals are calculated for conf=0.95 .
             %%       If conf is zero or is not given, confidence intervals
             %%       are not calculated. Confidence intervals can be
             %%       obtained only for the power spectral density of x;
             %%       nothing else.

 CONTROL-STRING ARGUMENTS -- each of these arguments is a character string.
   Control-string arguments must be after the other arguments but can be in
   any order.

 range     %% 'half',  'onesided' : frequency range of the spectrum is
           %%       zero up to but not including Fs/2.  Power from
           %%       negative frequencies is added to the positive side of
           %%       the spectrum, but not at zero or Nyquist (Fs/2)
           %%       frequencies.  This keeps power equal in time and
           %%       spectral domains.  See reference [2].
           %% 'whole', 'twosided' : frequency range of the spectrum is
           %%       -Fs/2 to Fs/2, with negative frequencies
           %%       stored in "wrap around" order after the positive
           %%       frequencies; e.g. frequencies for a 10-point 'twosided'
           %%       spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1
           %% 'shift', 'centerdc' : same as 'whole' but with the first half
           %%       of the spectrum swapped with second half to put the
           %%       zero-frequency value in the middle. (See "help
           %%       fftshift".
           %% If data (x and y) are real, the default range is 'half',
           %% otherwise default range is 'whole'.

 plot_type %% 'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db':
           %% specifies the type of plot.  The default is 'plot', which
           %% means linear-linear axes. 'squared' is the same as 'plot'.
           %% 'dB' plots "10*log10(psd)".  This argument is ignored and a
           %% spectrum is not plotted if the caller requires a returned
           %% value.

 detrend   %% 'no-strip', 'none' -- do NOT remove mean value from the data
           %% 'short', 'mean' -- remove the mean value of each segment from
           %%                    each segment of the data.
           %% 'linear',       -- remove linear trend from each segment of
           %%                    the data.
           %% 'long-mean'     -- remove the mean value from the data before
           %%              splitting it into segments.  This is the default.

   sloppy  %% 'sloppy': FFT length is rounded up to the nearest integer
           %%       power of 2 by zero padding.  FFT length is adjusted
           %%       after addition of padding by explicit Nfft argument.
           %%       The default is to use exactly the FFT and window/



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 USAGE:
   [spectra,freq] = pwelch(x,window,overlap,Nfft,Fs,
                   



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
pyulear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3135
 usage:
    [psd,f_out] = pyulear(x,poles,freq,Fs,range,method,plot_type)

 Calculates a Yule-Walker autoregressive (all-pole) model of the data "x"
 and computes the power spectrum of the model.  This is a wrapper for
 functions "aryule" and "ar_psd" which perform the argument checking.
 See "help aryule" and "help ar_psd" for further details.

 ARGUMENTS:
     All but the first two arguments are optional and may be empty.
   x       %% [vector] sampled data

   poles   %% [integer scalar] required number of poles of the AR model

   freq    %% [real vector] frequencies at which power spectral density
           %%               is calculated
           %% [integer scalar] number of uniformly distributed frequency
           %%          values at which spectral density is calculated.
           %%          [default=256]

   Fs      %% [real scalar] sampling frequency (Hertz) [default=1]


 CONTROL-STRING ARGUMENTS -- each of these arguments is a character string.
   Control-string arguments can be in any order after the other arguments.


   range   %% 'half',  'onesided' : frequency range of the spectrum is
           %%       from zero up to but not including sample_f/2.  Power
           %%       from negative frequencies is added to the positive
           %%       side of the spectrum.
           %% 'whole', 'twosided' : frequency range of the spectrum is
           %%       -sample_f/2 to sample_f/2, with negative frequencies
           %%       stored in "wrap around" order after the positive
           %%       frequencies; e.g. frequencies for a 10-point 'twosided'
           %%       spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1
           %% 'shift', 'centerdc' : same as 'whole' but with the first half
           %%       of the spectrum swapped with second half to put the
           %%       zero-frequency value in the middle. (See "help
           %%       fftshift". If "freq" is vector, 'shift' is ignored.
           %% If model coefficients "ar_coeffs" are real, the default
           %% range is 'half', otherwise default range is 'whole'.

   method  %% 'fft':  use FFT to calculate power spectrum.
           %% 'poly': calculate power spectrum as a polynomial of 1/z
           %% N.B. this argument is ignored if the "freq" argument is a
           %%      vector.  The default is 'poly' unless the "freq"
           %%      argument is an integer power of 2.

 plot_type %% 'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db':
           %% specifies the type of plot.  The default is 'plot', which
           %% means linear-linear axes. 'squared' is the same as 'plot'.
           %% 'dB' plots "10*log10(psd)".  This argument is ignored and a
           %% spectrum is not plotted if the caller requires a returned
           %% value.

 RETURNED VALUES:
     If return values are not required by the caller, the spectrum
     is plotted and nothing is returned.
   psd     %% [real vector] power-spectrum estimate
   f_out   %% [real vector] frequency values

 HINTS
   This function is a wrapper for aryule and ar_psd.
   See "help aryule", "help ar_psd".



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
 usage:
    [psd,f_out] = pyulear(x,poles,freq,Fs,range,method,plot_type)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
tfe


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 381
 Usage:
   [Pxx,freq] = tfe(x,y,Nfft,Fs,window,overlap,range,plot_type,detrend)

     Estimate transfer function of system with input "x" and output "y".
     Use the Welch (1967) periodogram/FFT method.
     Compatible with Matlab R11 tfe and earlier.
     See "help pwelch" for description of arguments, hints and references
     --- especially hint (7) for Matlab R11 defaults.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 79
 Usage:
   [Pxx,freq] = tfe(x,y,Nfft,Fs,window,overlap,range,plot_type,detrend)





