function c = daub_coefficients ( n )

%*****************************************************************************80
%
%% daub_coefficients() returns a set of Daubechies coefficients.
%
%  Discussion:
%
%    Often, the uses to which these coefficients are applied require that they
%    be rescaled, by being multiplied by sqrt ( 2 ).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 August 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of the coefficient set.
%    2 <= N <= 20, and N must be even.
%
%  Output:
%
%    real C(N), the coefficients.
%
  if ( n == 2 )

    c = [ ...
      7.071067811865475E-01, ...
      7.071067811865475E-01 ]';

  elseif ( n == 4 )

    c = [ ...
      0.4829629131445341E+00, ...
      0.8365163037378079E+00, ...
      0.2241438680420133E+00, ...
    - 0.1294095225512603E+00 ]';

  elseif ( n == 6 )

    c = [ ...
      0.3326705529500826E+00, ...
      0.8068915093110925E+00, ...
      0.4598775021184915E+00, ...
    - 0.1350110200102545E+00, ...
    - 0.8544127388202666E-01, ...
      0.3522629188570953E-01 ]';

  elseif ( n == 8 )

    c = [ ...
      0.2303778133088965E+00, ...
      0.7148465705529156E+00, ...
      0.6308807679298589E+00, ...
     -0.2798376941685985E-01, ...
     -0.1870348117190930E+00, ...
      0.3084138183556076E-01, ...
      0.3288301166688519E-01, ...
     -0.1059740178506903E-01 ]';

  elseif ( n == 10 )

    c = [ ...
      0.1601023979741929E+00, ...
      0.6038292697971896E+00, ...
      0.7243085284377729E+00, ...
      0.1384281459013207E+00, ...
     -0.2422948870663820E+00, ...
     -0.3224486958463837E-01, ...
      0.7757149384004571E-01, ...
     -0.6241490212798274E-02, ...
     -0.1258075199908199E-01, ...
      0.3335725285473771E-02 ]';;

  elseif ( n == 12 )

    c = [ ...
      0.1115407433501094E+00, ...
      0.4946238903984530E+00, ...
      0.7511339080210953E+00, ...
      0.3152503517091976E+00, ...
     -0.2262646939654398E+00, ...
     -0.1297668675672619E+00, ...
      0.9750160558732304E-01, ...
      0.2752286553030572E-01, ...
     -0.3158203931748602E-01, ...
      0.5538422011614961E-03, ...
      0.4777257510945510E-02, ...
     -0.1077301085308479E-02 ]';

  elseif ( n == 14 )

    c = [ ...
       7.785205408500917E-02, ...
       3.965393194819173E-01, ...
       7.291320908462351E-01, ...
       4.697822874051931E-01, ...
      -1.439060039285649E-01, ...
      -2.240361849938749E-01, ...
       7.130921926683026E-02, ...
       8.061260915108307E-02, ...
      -3.802993693501441E-02, ...
      -1.657454163066688E-02, ...
       1.255099855609984E-02, ...
       4.295779729213665E-04, ...
      -1.801640704047490E-03, ...
       3.537137999745202E-04 ]';

  elseif ( n == 16 )

    c = [ ...
       5.441584224310400E-02, ...
       3.128715909142999E-01, ...
       6.756307362972898E-01, ...
       5.853546836542067E-01, ...
      -1.582910525634930E-02, ...
      -2.840155429615469E-01, ...
       4.724845739132827E-04, ...
       1.287474266204784E-01, ...
      -1.736930100180754E-02, ...
      -4.408825393079475E-02, ...
       1.398102791739828E-02, ...
       8.746094047405776E-03, ...
      -4.870352993451574E-03, ...
      -3.917403733769470E-04, ...
       6.754494064505693E-04, ...
      -1.174767841247695E-04 ]';

  elseif ( n == 18 )

    c = [ ...
       3.807794736387834E-02, ...
       2.438346746125903E-01, ...
       6.048231236901111E-01, ...
       6.572880780513005E-01, ...
       1.331973858250075E-01, ...
      -2.932737832791749E-01, ...
      -9.684078322297646E-02, ...
       1.485407493381063E-01, ...
       3.072568147933337E-02, ...
      -6.763282906132997E-02, ...
       2.509471148314519E-04, ...
       2.236166212367909E-02, ...
      -4.723204757751397E-03, ...
      -4.281503682463429E-03, ...
       1.847646883056226E-03, ...
       2.303857635231959E-04, ...
      -2.519631889427101E-04, ...
       3.934732031627159E-05 ]';

  elseif ( n == 20 )

    c = [ ...
       2.667005790055555E-02, ...
       1.881768000776914E-01, ...
       5.272011889317255E-01, ...
       6.884590394536035E-01, ...
       2.811723436605774E-01, ...
      -2.498464243273153E-01, ...
      -1.959462743773770E-01, ...
       1.273693403357932E-01, ...
       9.305736460357235E-02, ...
      -7.139414716639708E-02, ...
      -2.945753682187581E-02, ...
       3.321267405934100E-02, ...
       3.606553566956169E-03, ...
      -1.073317548333057E-02, ...
       1.395351747052901E-03, ...
       1.992405295185056E-03, ...
      -6.858566949597116E-04, ...
      -1.164668551292854E-04, ...
       9.358867032006959E-05, ...
      -1.326420289452124E-05 ]';

  else

    fprintf ( 1, '\n' );
    fprintf ( 1, 'DAUB_COEFFICIENTS - Fatal error!\n' );
    fprintf ( 1, '  Value of N = %d\n', n );
    fprintf ( 1, '  Legal values are 2, 4, 6, 8, 10, 12, 14, 16, 18, 20.\n' );
    error ( 'DAUB_COEFFICIENTS - Fatal error!' );

  end

  return
end
