A discrete transfer function shows how input signals change to output signals in systems that work step-by-step over time.
Discrete transfer function in Simulink
H(z) = (b0 + b1*z^-1 + b2*z^-2 + ... + bnb*z^-nb) / (1 + a1*z^-1 + a2*z^-2 + ... + ana*z^-na)
The numerator coefficients (b0, b1, ...) define zeros of the system.
The denominator coefficients (a1, a2, ...) define poles of the system.
Numerator coefficients: [0.5, -0.3] Denominator coefficients: [1, -0.7]
Numerator coefficients: [1, 0, -1] Denominator coefficients: [1, -1.8, 0.81]
This code creates a discrete transfer function with given coefficients, computes its step response, and plots it. It also prints the first 5 output values to see how the system reacts over time.
import numpy as np import matplotlib.pyplot as plt from scipy.signal import dlti, dstep # Define numerator and denominator coefficients b = [0.5, -0.3] # numerator a = [1, -0.7] # denominator # Create discrete transfer function system system = dlti(b, a, dt=1) # dt=1 means sample time is 1 unit # Compute step response t, y = dstep(system) # Flatten output and convert time to array t = np.squeeze(t) y = np.squeeze(y) # Plot step response plt.stem(t, y, use_line_collection=True) plt.title('Step Response of Discrete Transfer Function') plt.xlabel('Time steps') plt.ylabel('Output') plt.grid(True) plt.show() # Print first 5 output values print('First 5 step response values:', y[:5])
The sample time (dt) must be set correctly to match how often your system updates.
Discrete transfer functions work with signals at fixed time steps, unlike continuous ones.
A discrete transfer function models how outputs relate to inputs in step-by-step systems.
It uses numerator and denominator coefficients to describe system behavior.
You can analyze system responses like step response to understand performance.
Practice
Solution
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.Step 2: Eliminate unrelated options
Options about colors, hardware, or file formats do not describe system behavior.Final Answer:
The relationship between input and output in a step-by-step system -> Option CQuick Check:
Discrete transfer function = input-output relation [OK]
- Confusing transfer function with hardware settings
- Thinking it describes visual aspects
- Mixing file formats with system models
Solution
Step 1: Recall discrete transfer function definition
It requires numerator and denominator coefficient vectors plus a sample time to define the discrete system.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.Final Answer:
Using numerator and denominator coefficient vectors with a sample time -> Option AQuick Check:
Numerator + denominator + sample time = correct syntax [OK]
- Omitting denominator coefficients
- Using continuous parameters for discrete blocks
- Using single scalar instead of vectors
Solution
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.Step 2: Confirm initial conditions and input values
Initial output y[0] is zero, input at step 1 is zero, so calculation is correct.Final Answer:
0.5 -> Option BQuick Check:
y[1] = 0.5*0 + 0.5*1 + 0.3*0 = 0.5 [OK]
- Ignoring initial output conditions
- Using wrong input values for step 1
- Mixing numerator and denominator signs
Solution
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.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.Final Answer:
Input signal is not connected -> Option DQuick Check:
No response? Verify input connection [OK]
- Ignoring numerator vector meaning
- Assuming sample time zero is valid
- Not verifying input connection
Solution
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].Step 2: Denominator for no feedback is [1]
Since no feedback is mentioned, denominator is simply [1]. Other options have incorrect placements or values.Final Answer:
Numerator = [0 0 0.8], Denominator = [1] -> Option AQuick Check:
Delay = zeros before gain in numerator [OK]
- Placing gain at wrong numerator index
- Misunderstanding denominator role
- Confusing gain and delay positions
Ready to prove it?
Pass the test and this pattern moves unknown
