This is C++ library which provides set of opertions on transfer functions. Those are operations like:
- calculate transfer functions of series/parrallel/feedback connection,
- discretize transfer function,
- analyse stability,
- calculate step/impulse response,
- calculate Bode/Nyquist plot,
- simulation of discrete transfer function.
- Programming language:
- C++20 standard - g++10.3 or higher
- Build system:
- CMake 3.12 or higher
- Static code analysis:
- cppcheck 1.90 or higher
- pygments
- Test coverage:
- gcov
- lcov
- Coding style check
- cpplint 1.5.5 or higher
// Prepare num and den of TF, where tf_core::TransferFunction::CoefficientsVector = std::vector<float>
tf_core::TransferFunction::CoefficientsVector num = {1.0f};
tf_core::TransferFunction::CoefficientsVector den = {1.0f, 2.0f};
auto tf = tf_core::TransferFunction(num, den);
- Parallel
// Prepare TF
auto G = tf_core::TransferFunction(num_g, den_g);
auto H = tf_core::TransferFunction(num_h, den_h);
auto parallel_connection = G + H;
//Or
auto parallel_connection = G.Parallel(H);
- Serial
// Prepare TF
auto G = tf_core::TransferFunction(num_g, den_g);
auto H = tf_core::TransferFunction(num_h, den_h);
auto serial_connection = G * H;
//Or
auto serial_connection = G.Serial(H);
- Feedback
// Prepare TF
auto G = tf_core::TransferFunction(num_g, den_g);
auto H = tf_core::TransferFunction(num_h, den_h);
auto feedback_connection = G.Feedback(H);
// Or positive feedback
auto feedback_connection = G.Feedback(H, true);
//Define TF
auto G = tf_core::TransferFunction(num_g, den_g);
// Define discretization time and method
float sampling_time = 0.01f;
auto discretization_method = tf_core::DiscretizationMethod::Tustin;
// Discretize
auto discrete_G = G.Discretize(sampling_time, discretization_method);
//Define TF
auto G = tf_core::TransferFunction(num_g, den_g);
// Define signal, where using Signal = std::vector<float>;
Signal input_signal = {...};
// Simulate
auto output_signal = G.Simulate(input_signal);