Transfer function: let simulated output start at same point as real output

1 view (last 30 days)
Hi all,
I am trying to find a transfer function that will estimate an output signal from a given input, with an output signal also given. The command I am using is built within Matlab: 'tfest'. What I want to achieve is that the estimated output will start at the same point as the real output (which always starts at zero). When I use 'tfest' it will not always start at a similar point, i.e. zero. Part of the code I am using you can find next:
Ts = 0.01; % Sampling time
ze = iddata(input, output, Ts); % creates an iddata time domain series (comment: input and output are given data points)
np = 2; % number of poles of TF
nz = 2; % number of zeros of TF
tf1 = tfest(ze, np, nz, 'Ts', 0.01, 'Feedthrough',true); % discrete TF estimation
[y,fit,x0] = compare(ze,tf1);
figure
plot(output)
hold on
plot(y.OutputData)
The figure is shown below. In the generated figure, y.OutputData is the simulated output of the TF, which doesn't start at the same point as the output itself. The output starts at zero, while the simulated output starts at around -0.10. Is there a way to force the simulated output to start at exactly the same point as the output (at zero), using the 'tfest' command?

Answers (0)

Community Treasure Hunt

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

Start Hunting!