Skip to content
  • Henry Weller's avatar
    Function1Types::Square: New square-wave Function1 with the same controls as Sine · 60281da4
    Henry Weller authored
    with optional specification of the mark/space ratio
    
        Templated square-wave function with support for an offset level.
    
            \f[
                a square(f (t - t_0)) s + l
            \f]
    
        where
    
        \f$ square(t) \f$ is the square-wave function in range \f$ [-1, 1] \f$
        with a mark/space ratio of \f$ r \f$
    
        \vartable
            symbol  | Description       | Data type         | Default
            a       | Amplitude         | Function1<scalar> |
            f       | Frequency [1/s]   | Function1<scalar> |
            s       | Type scale factor | Function1<Type>   |
            l       | Type offset level | Function1<Type>   |
            t_0     | Start time [s]    | scalar            | 0
            r       | mark/space ratio  | scalar            | 1
            t       | Time [s]          | scalar
        \endvartable
    
        Example for a scalar:
        \verbatim
            <entryName> square;
            <entryName>Coeffs
            {
                frequency 10;
                amplitude 0.1;
                scale     2e-6;
                level     2e-6;
            }
        \endverbatim
    60281da4