Bird
Raised Fist0
Simulinkdata~10 mins

Discrete transfer function in Simulink - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Discrete transfer function
Define numerator and denominator coefficients
↓
Create discrete transfer function block
↓
Input discrete signal
↓
Apply transfer function (difference equation)
↓
Output filtered discrete signal
The discrete transfer function takes numerator and denominator coefficients to process an input discrete signal and produce an output signal by applying the difference equation.
Execution Sample
Simulink
num = [0.5];
den = [1, -0.7];
input = [1, 2, 3, 4, 5];
output = filter(num, den, input);
This code applies a discrete transfer function defined by numerator and denominator coefficients to an input signal.
Execution Table
StepInput SamplePrevious OutputCalculationOutput Sample
110 (initial)0.5*1 - (-0.7)*0 = 0.50.5
220.50.5*2 - (-0.7)*0.5 = 1 + 0.35 = 1.351.35
331.350.5*3 - (-0.7)*1.35 = 1.5 + 0.945 = 2.4452.445
442.4450.5*4 - (-0.7)*2.445 = 2 + 1.7115 = 3.71153.7115
553.71150.5*5 - (-0.7)*3.7115 = 2.5 + 2.59805 = 5.098055.09805
💡 All input samples processed, output signal generated.
Variable Tracker
VariableStartAfter 1After 2After 3After 4After 5
input sampleN/A12345
previous output00.51.352.4453.71155.09805
output sampleN/A0.51.352.4453.71155.09805
Key Moments - 2 Insights
Why does the output at step 2 depend on the previous output?
Because the discrete transfer function uses feedback from previous outputs as shown in the calculation column of the execution_table rows 2 to 5.
Why is the initial previous output zero?
The initial previous output is zero because before processing any input, the system starts at rest, as shown in the variable_tracker start value.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the output sample at step 3?
A1.35
B2.445
C3.7115
D0.5
💡 Hint
Check the 'Output Sample' column at step 3 in the execution_table.
At which step does the output first exceed 3?
AStep 3
BStep 5
CStep 4
DNever
💡 Hint
Look at the 'Output Sample' values in the execution_table rows.
If the denominator coefficient -0.7 changed to -0.5, how would the output at step 2 change?
AIt would decrease
BIt would increase
CIt would stay the same
DCannot determine
💡 Hint
The feedback term depends on the denominator coefficient; reducing its magnitude reduces the feedback effect, lowering output.
Concept Snapshot
Discrete Transfer Function:
- Defined by numerator (num) and denominator (den) coefficients
- Processes discrete input signals step-by-step
- Output depends on current input and previous outputs
- Implemented via difference equations or filter function
- Used in digital signal processing and control systems
Full Transcript
A discrete transfer function uses numerator and denominator coefficients to process discrete input signals. It applies a difference equation where each output sample depends on the current input and previous outputs. The example code uses filter with num and den arrays to compute the output signal. Step-by-step execution shows how each output sample is calculated using the input sample and feedback from the previous output. The initial previous output is zero, representing system rest. This process continues for all input samples, producing the filtered output signal.

Practice

(1/5)
1. What does a discrete transfer function in Simulink represent?
easy
A. The color scheme of the Simulink blocks
B. The hardware configuration of the computer
C. The relationship between input and output in a step-by-step system
D. The file format used to save Simulink models

Solution

  1. Step 1: Understand the purpose of discrete transfer functions

    A discrete transfer function models how the output of a system depends on its input at discrete time steps.
  2. Step 2: Eliminate unrelated options

    Options about colors, hardware, or file formats do not describe system behavior.
  3. Final Answer:

    The relationship between input and output in a step-by-step system -> Option C
  4. Quick Check:

    Discrete transfer function = input-output relation [OK]
Hint: Think input-output step relation for discrete systems [OK]
Common Mistakes:
  • Confusing transfer function with hardware settings
  • Thinking it describes visual aspects
  • Mixing file formats with system models
2. Which of the following is the correct way to define a discrete transfer function in Simulink?
easy
A. Using numerator and denominator coefficient vectors with a sample time
B. Using only a numerator vector without denominator
C. Using continuous time parameters without sample time
D. Using a single scalar value without vectors

Solution

  1. Step 1: Recall discrete transfer function definition

    It requires numerator and denominator coefficient vectors plus a sample time to define the discrete system.
  2. Step 2: Check options for completeness

    Only Using numerator and denominator coefficient vectors with a sample time includes numerator, denominator, and sample time, which is necessary.
  3. Final Answer:

    Using numerator and denominator coefficient vectors with a sample time -> Option A
  4. Quick Check:

    Numerator + denominator + sample time = correct syntax [OK]
Hint: Remember: numerator, denominator, and sample time needed [OK]
Common Mistakes:
  • Omitting denominator coefficients
  • Using continuous parameters for discrete blocks
  • Using single scalar instead of vectors
3. Given a discrete transfer function with numerator = [0.5 0.5] and denominator = [1 -0.3], and sample time = 1, what is the output at step 1 if the input is 1 at step 0 and 0 afterwards?
medium
A. 0
B. 0.5
C. 0.65
D. 0.15

Solution

  1. Step 1: Calculate output at step 1 using difference equation

    Output y[1] = 0.5*u[1] + 0.5*u[0] - (-0.3)*y[0]. Given u[0]=1, u[1]=0, y[0]=0 (initially), y[1] = 0.5*0 + 0.5*1 + 0.3*0 = 0.5.
  2. Step 2: Confirm initial conditions and input values

    Initial output y[0] is zero, input at step 1 is zero, so calculation is correct.
  3. Final Answer:

    0.5 -> Option B
  4. Quick Check:

    y[1] = 0.5*0 + 0.5*1 + 0.3*0 = 0.5 [OK]
Hint: Use difference equation with initial zero output [OK]
Common Mistakes:
  • Ignoring initial output conditions
  • Using wrong input values for step 1
  • Mixing numerator and denominator signs
4. You defined a discrete transfer function with numerator = [1 0] and denominator = [1 -0.5], sample time = 1. The output does not change when input changes. What is the likely error?
medium
A. Denominator coefficients are incorrect length
B. Sample time is set to zero
C. Numerator coefficients do not represent the input properly
D. Input signal is not connected

Solution

  1. Step 1: Validate the coefficients

    Numerator [1 0] and denominator [1 -0.5] yield y[n] = u[n] + 0.5 y[n-1], which responds to input changes.
  2. Step 2: Identify the likely cause

    In Simulink, if output ignores input despite valid parameters, the input signal is probably not connected to the block.
  3. Final Answer:

    Input signal is not connected -> Option D
  4. Quick Check:

    No response? Verify input connection [OK]
Hint: If output unresponsive, check input connection first [OK]
Common Mistakes:
  • Ignoring numerator vector meaning
  • Assuming sample time zero is valid
  • Not verifying input connection
5. You want to design a discrete transfer function in Simulink to model a system with a delay of 2 steps and a gain of 0.8. Which numerator and denominator coefficients correctly represent this?
hard
A. Numerator = [0 0 0.8], Denominator = [1]
B. Numerator = [0.8 0 0], Denominator = [1 -0.2]
C. Numerator = [0 0.8 0], Denominator = [1 0]
D. Numerator = [0 0 1], Denominator = [0.8]

Solution

  1. Step 1: Understand delay and gain in numerator

    A delay of 2 steps means the gain appears at the third coefficient (index 2), so numerator should be [0 0 0.8].
  2. Step 2: Denominator for no feedback is [1]

    Since no feedback is mentioned, denominator is simply [1]. Other options have incorrect placements or values.
  3. Final Answer:

    Numerator = [0 0 0.8], Denominator = [1] -> Option A
  4. Quick Check:

    Delay = zeros before gain in numerator [OK]
Hint: Delay = zeros before gain in numerator vector [OK]
Common Mistakes:
  • Placing gain at wrong numerator index
  • Misunderstanding denominator role
  • Confusing gain and delay positions
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard