# -*- coding: utf-8 -*-

fileTemplate = u"""
#########################################################################################################################
# Lossy filters synthesis parameter file.                                                                               #
# Synthesis of microwave lossy filters using pre-distortion and Prescribed Insertion Loss  techniques.                  #
# J.M. Rius, J. Mateu, D. Mateu, C. Collado, J. O'Callaghan                                                             #
# Dpt. Signal Theory and Communications, Universitat Politècnica de Catalunya (UPC)                                     #
#                                                                                                                       #
# Version 2.0.3                                                                                                         #
# Date June 11, 2013                                                                                                    #
# Copyright (c) 2009 Universitat Politècnica de Catalunya (UPC).                                                        #
#                                                                                                                       #
# This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License#
# as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. #
# This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied       #
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. #
# You should have received a copy of the GNU General Public License along with this file in file "LICENSE.GPL3";        #
# if not, download it from http://www.gnu.org/licenses/gpl-3.0.html  .                                                  #
#########################################################################################################################


#########################################################################################################################
# Help:                                                                                                                 #
#                                                                                                                       #
#    - Lines with a '=' character contain parameter values. Example:                                                    # 
#                                                                                                                       #
#               Return losses (dB)                            [chebyLr]  {float}        = 20                            #
#                                                                                                                       #
#      The value is after the '=' and is followed by the line end. Blank spaces are skipped.                            #
#      The text before the '=' contains a keyword in brackets '[ ]', and a parameter type in braces '{ }'.              #
#      The '[ ]' keyword must be before the '{ }' parameter type                                                        #
#      The keywod is used to identify the program variable related to this parameter value.                             #
#      DO NOT change the keyword or the variable type.                                                                  #
#      The rest of the text before the '=' and not enclosed in '[ ]' or '{ }' brackets is irrelevant                    #
#      and cannot contain any of the following characters: '='  ,  '['  ,  ']'  ,  '{'  and  '}'                        #
#                                                                                                                       #
#    - Allowed parameter types (with a example) are:                                                                    #
#      {int}     = 6                                                                                                    #
#      {float}   = 1.4e9                                                                                                #
#      {complex} = 1.0+2.0j                                                                                             #
#      {string}  = Quasieliptic                                                                                         #
#      {int}     = 2, 4, 1, 6                                                                                           #
#      {float}   = 0.25, 0.5, 0.75, 1, 0.75, 0.5, 0.25                                                                  #
#      {complex} = 1+2j, 3+4j, 10j                                                                                      #
#                                                                                                                       #
#      List elements separator is ','                                                                                   #
#                                                                                                                       #
#    - Lines without a '=' character and lines starting with '#' are comments.                                          #
#                                                                                                                       #
#    - Line indentation and tabulation is opcional.                                                                     #
#                                                                                                                       #
#    - This file uses UTF-8 encoding                                                                                    #
#                                                                                                                       #
#########################################################################################################################


1) General parameters

  Name of results output files [outName] {string} = 
  Output directory             [outDir] {string}  = 

2) Filter parameters

  Filter order               [N]                   {int}    = 
  Center Frequency (Hz)      [f0]                  {float}  = 
  Bandwidth (Hz)             [BW]                  {float}  = 
  Filter Transfer Function   [filterTransferFunc]  {string} = 

  2.1) Butterworth
    None

  2.2) Chebyshev
    Return losses (dB)                                      [chebyLr]  {float}    = 

  2.3) Quasieliptic
    Transmission zero position (Hz). Symmetric pair added.  [qeZero]   {float}    = 
    Return losses (dB)                                      [qeLr]     {float}    = 

  2.4) Generalized Chebyshev
# Lists of prescribed transmission zeros.
# Complex TZs have real part in normalized frequency units and imaginary part in Hz.
# A symmetric zero with opposite real part is automatically added for complex TX zeros.  
    Imaginary Transmission zeros position (Hz)           [transImagZeros]    {float}   = 
    Complex Transmission zeros position (norm, Hz)       [transComplexZeros] {complex} = 
    Return losses (dB)                                   [genChebyLr]        {float}   = 
    Linear phase equalization (0 -> False / 1 -> True)   [genChebyLP]        {int}     = 

    2.4.1) True
# Lists of transmission zeros initial values for linear phase optimization.
# Complex TZs have real part in normalized frequency units and imaginary part in Hz.
# A symmetric zero with opposite real part is automatically added for complex TX zeros.
      Optimization algorithm (FMIN)                         [LPalgor]        {string}  = 
      Maximum number of iterations or function evaluations  [LPmaxIter]      {int}     = 
      Number of sampling points for group delay computation [LPNsamples]     {int}     = 
      Complex transmission zeros initial values             [LPcomplexZeros] {complex} = 
      Real transmission zeros initial values                [LPrealZeros]    {float}   = 
      Fractional bandwidth for linear phase optimization    [LPfracBW]       {float}   = 
      Group delay optimization ripple (sec.)                [LPripple]       {float}   = 

3) Synthesis Parameters

  Synthesis Technique                                       [synthTech]     {string} = 

  3.1) Minimum Insertion Loss
    Implementation with finite Q (0 -> False / 1 -> True)   [finiteQo]      {int}    = 
    Quality factor of the implementation                    [Qo]            {float}  = 

  3.2) Predistortion
    Quality factor of the filter to implement Qo            [QoPredis]      {float}  = 
    Quality factor of the filter to emulate Qeff (>Qo)      [Qef]           {float}  = 
    Arrangement of the reflection zeros (1,2,3,4 or list)   [zerosArrang]   {int}    = 
#     1 -> All zeros in the left s-plane (strictly Hurvitz).
#     2 -> All zeros in the right s-plane.
#     3 -> Alternate zeros in the right s-plane with zeros in the left s-plane, in the order of decreasing imaginary part.
#     4 -> Alternate zeros in the left s-plane with zeros in the right s-plane, in the order of decreasing imaginary part.

    Adaptive predistorsion (0 -> False / 1 -> True)         [adapPredis]    {int}    = 

    3.2.1) True
# Weight function for the pole shifting (comma-separated list of floats: one value per each pole):
# The shift is equal to the weight times sigma: weight values equal one lead to the conventional pole shifting.
# The number of list elements must be equal to the order of the filter, except that if there is ony one element,
# the Ming-Yu sinusoidal funcion is applied with amplitude equal to that value.
# In that case the weight is one minus the sinusoidal function [Ming-Yu eq. (4) and (6)].    
      Weight function for the pole shifting                 [wFunc]         {float}  = 

  3.3) Prescribed Insertion Loss
      Prescribed Insertion Loss technique: 
      (kS21+kS11, kS21, kS21+pole/zero)                 [nuqTech]       {string} = 

    3.3.1) kS21+kS11
      Insertion losses K for S11 (dB)                       [nuqK11c1]      {float}  = 
      Insertion losses K for S22 (dB)                       [nuqK22c1]      {float}  = 
      Insertion losses K for S21 (dB)                       [nuqK21c1]      {float}  = 

    3.3.2) kS21
      Insertion losses K (dB)                               [nuqK21c2]      {float}  = 

    3.3.3) kS21+pole/zero
      Insertion losses K (dB)                               [nuqK21c3]      {float}  = 
      Value delta of the (s-delta)/(s+delta) zero/pole      [nuqDelta]      {float}  = 

4) Sweep parameters

  Minimum frequency (Hz)                                    [minFreq]       {float}  = 
  Maximum frequency (Hz)                                    [maxFreq]       {float}  = 
  Number of samples                                         [numFreq]       {int}    = 
"""
