function [ DataIdent ] = GenerInterDataIdent(F, TypeInSignal , Ts, N )
%GenerInterDataIdent - function for generation data for spectral analysis

AmplitudeInputSignal = 1;

DataIdent = MotionIdentTwinCAT();

DataIdent.PeriodInputSignal = Ts;
DataIdent.LengthInputSignal = N;
DataIdent.CountRepeat = 1;
DataIdent.AmplitudeInputSignal = AmplitudeInputSignal;
DataIdent.ControlMode = 3;
DataIdent.vScale = 1;
DataIdent.xScale = 1;
DataIdent.TaskTime = Ts;
DataIdent.NameAxis = 'SimulDataIdent';
DataIdent.Notes = 'Simulation';

%% Input signal
if strcmp(TypeInSignal,'prbs')
%     u = idinput(N,'prbs',[0 1],[0 AmplitudeInputSignal]);
    u = idinput(N,'prbs',[0 1],[-AmplitudeInputSignal AmplitudeInputSignal]);
elseif strcmp(TypeInSignal,'randn')
    rng(701638692)
%     u = (randn(1,N)-AmplitudeInputSignal)*AmplitudeInputSignal;
    u = randn(1,N)*AmplitudeInputSignal;
else
    error('Wrong TypeInSignal')
end
AllCommandValue = u;

%% Output signal                           
t = 0:Ts:((length(u)-1)*Ts);
y = lsim(F,u,t);
AllFeedbackValue = y;

DataIdent = DataIdent.SetValues( AllCommandValue, AllFeedbackValue');


            
end

