Borrar filtros
Borrar filtros

How to add noise in input of State space model ?

15 visualizaciones (últimos 30 días)
RJS
RJS el 28 de Dic. de 2021
Respondida: Star Strider el 28 de Dic. de 2021
I want to add noise signal in Input of state space model in code..G=ss(S,B,C,D).
I know to how to do in simulink, but don,t know ho to don in code
..please help me

Respuestas (1)

Star Strider
Star Strider el 28 de Dic. de 2021
Try this —
A = [-3 -1.5; 5 0];
B = [1; 0];
C = [0.5 1.5];
D = 0;
sys = ss(A,B,C,D);
t = linspace(0, 10, 1500); % Time Vector
u = sum(sin((1:29)'*2*pi*t/2.5)); % Arbitrary Input
figure
lsim(sys,u,t)
grid on
un = u + randn(size(u))*1.5; % Add Gaussian Noise (Standard Deviation = 1.5)
figure
lsim(sys,un,t)
grid on
Use any initial input ‘u’ vector appropriate to the model.
The model here is from the lsim documentation.
.

Categorías

Más información sobre Time and Frequency Domain Analysis en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by