Transfer function response using idinput as input signal.
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Rohan Gulur
il 28 Lug 2023
Commentato: Star Strider
il 28 Lug 2023
Hello, I currently have a binary(0, 1 alternating) input signal which I created using the idinput signal object. In addition, I also have a discretized transfer function which I have created.
Here is an example of my input signal function: u = idinput(100,'prbs',Band,Range);
My discretized transfer function is a normal discrete transfer function.
I want to plot the time domain response of this idinput signal with a system response using the discretized transfer function. I tried to use the lsim command with the following arguments(transferFunction, u, time).
I am getting an error when plotting the output however, stating that: Incorrect number or types of inputs or outputs for function 'iosize'.
Does anybody know how to properly plot the discretized transfer function response with an idinput signal object.
Regards.
1 Commento
Jon
il 28 Lug 2023
Please provide a simple, standalone, runnable example that reproduces the problem, or at least copy your code, and the full error message. To include code, please use the insert code tool on the MATLAB answers toolbar.
Risposta accettata
Star Strider
il 28 Lug 2023
It would help to have the details.
Example —
num = rand(1,2)
den = rand(1,3)
Ts = 0.01;
sys = tf(num,den,Ts)
Range = [-2,2];
Band = [0 1/4];
u = idinput(100, 'prbs', Band, Range);
[y,t] = lsim(sys, u);
figure
plot(t, y, 'DisplayName','Output')
hold on
plot(t, u, 'DisplayName','Input')
hold off
grid
legend('Location','best')
This works.
.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Measurements and Feature Extraction in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!