MGTsystemFIR

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.0, Creation date: 2021-02-09, Last change: 2025-09-15

generates a system response for a transfer fnct that has only bi coefficients

Description

the coefficients of the equation y[k]=b0*u[k]+b1*u[k-1]+b2*u[k-2]+b3*u[k-3]+...

See Also: MGTsystemIIR , MGTsysteminvFIR

Example Illustration

 missing image of MGTsystemFIR(u0,bi,sh)

Syntax

y=MGTsystemFIR([u0,bi,sh])

Input Parameter

u0: numer sequence describin a signal / function
bi: [1 x n] Coefficients [b0 b1 b2 b3 .....bn-1]
sh: if true; the progess is shown step by step

Output Parameter

y: response of y "masked" with coefficients bi

Examples


MGTsystemFIR([0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0],[0 0 1 1 1 1 0 0 ]/4); % Mean + Delay




Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, MGTsystemFIR, generates a system response for a transfer function that has only bi coefficients. It is part of the SG-Library and was introduced in SolidGeometry 5.0.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the input parameters using getfuncparams function:
    • u0 is set to a default sequence if not provided.
    • bi is set to a default array [0.5, 0.5] if not provided.
    • sh is set to false if not provided.
  2. Initialize arrays y, u, and v with zeros, having the same size as u0.
  3. Determine the number of elements in ai and bi using numel.
  4. Call the function MGTsystemIIR with parameters u0, ai, bi, and sh to compute the response y.
  5. If no output is expected (nargout == 0):
    • Check if the absolute sum of bi is greater than 1, and print the amplification factor if true.
    • Call MGTsystemIIR again with the same parameters.
    • Invoke SGtitle to set the title of the plot.
    • Plot the coefficients bi using PLplotdiscretetime and display the plot.
    • Capture the plot as an image and display it using implot.

Example

The function can be called as follows:

MGTsystemFIR([0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0],[0 0 1 1 1 1 0 0 ]/4);

This example demonstrates a mean and delay operation on the input sequence.

Algorithm explaination created using ChatGPT on 2025-08-19 08:12. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21