% AT STEP 162: CALCULATES SISO FIR MODEL FOR CV 22SI0406 FROM MV/DV 20FC1001

% MATLAB SCRIPT STARTS .......

FIR_22SI0406_20FC1001_uraw = [412008 412009 412009 412009 412010 412010 412010 412011 412011 412011 412012 412012 412012 412013 412013 412014 412015 412015 412016 412016 412016 412017 412017 412017 412017 412018 412018 412018 412018 412019 412019 412019 412019 412020 412020 412020 412020 412020 412020 412020 412020 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 401702 356047 347890 340647 335315 330635 327507 324365 322027 319914 318334 316904 315852 315000 314194 313723 313311 313000 312764 312583 312464 312391 312337 312293 312254 312212 312171 312135 312098 312070 312044 312021 312002 311983 311970 311958 311951 311943 311938 311935 311932 311929 311928 311927 311927 311927 311926 311926 311927 311927 311927 311927 311928 311928 311929 311929 311930 311931 311931 311932 311932 311931 311931 311929 311927 311924 311919 311913 311906 311902 311906 311915 311926 311941 311958 311971 311983 311994 312001 312007 312011 312014 312015 312014 312012 312009 312006 312003 312000 311997 311993 311989 311985 311982 311977 311974 311971 311969 311967 311965 311963 311962 ]';
FIR_22SI0406_20FC1001_yraw = [10559.3 10559.3 10559.2 10559.2 10559.1 10559.1 10559 10559 10558.9 10558.9 10558.9 10558.8 10558.8 10558.8 10558.7 10558.7 10558.6 10558.6 10558.6 10558.5 10558.5 10558.5 10558.5 10558.4 10558.4 10558.4 10558.4 10558.3 10558.3 10558.3 10558.3 10558.3 10558.3 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558 10557.2 10555.6 10552.9 10549.7 10544.6 10538.6 10530.4 10521.4 10509.7 10497.5 10484.4 10468.7 10456.9 10444.6 10433.4 10423.3 10412.2 10402.1 10394.3 10388.2 10384.2 10381.9 10381 10381.4 10382.6 10384.4 10386.2 10388.6 10391.1 10393.7 10396.4 10398.2 10400.4 10402.4 10403.8 10404.9 10405.9 10407.1 10408 10408.7 10409.1 10409.4 10409.7 10410 10410.2 10410.4 10410.4 10410.5 10410.4 10410.4 10410.4 10410.5 10410.5 10410.6 10410.6 10410.7 10410.8 10410.9 10411 10411.2 10411.3 10411.4 10411.4 10411.4 10411.4 10411.2 10411 10410.8 10410.6 10410.5 10410.3 10410.1 10410.1 10410.2 10410.5 10410.8 10411.3 10411.7 10412.2 10412.7 10413.1 10413.6 10414.1 10414.4 10414.8 10415.1 10415.3 10415.4 10415.5 10415.5 10415.5 10415.4 10415.4 10415.3 10415.1 10414.9 10414.7 10414.5 10414.3 ]';
FIR_22SI0406_20FC1001_yfilt = [10559.3 10559.3 10559.2 10559.2 10559.1 10559.1 10559 10559 10558.9 10558.9 10558.9 10558.8 10558.8 10558.8 10558.7 10558.7 10558.6 10558.6 10558.6 10558.5 10558.5 10558.5 10558.5 10558.4 10558.4 10558.4 10558.4 10558.3 10558.3 10558.3 10558.3 10558.3 10558.3 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558 10557.2 10555.6 10552.9 10549.7 10544.6 10538.6 10530.4 10521.4 10509.7 10497.5 10484.4 10468.7 10456.9 10444.6 10433.4 10423.3 10412.2 10402.1 10394.3 10388.2 10384.2 10381.9 10381 10381.4 10382.6 10384.4 10386.2 10388.6 10391.1 10393.7 10396.4 10398.2 10400.4 10402.4 10403.8 10404.9 10405.9 10407.1 10408 10408.7 10409.1 10409.4 10409.7 10410 10410.2 10410.4 10410.4 10410.5 10410.4 10410.4 10410.4 10410.5 10410.5 10410.6 10410.6 10410.7 10410.8 10410.9 10411 10411.2 10411.3 10411.4 10411.4 10411.4 10411.4 10411.2 10411 10410.8 10410.6 10410.5 10410.3 10410.1 10410.1 10410.2 10410.5 10410.8 10411.3 10411.7 10412.2 10412.7 10413.1 10413.6 10414.1 10414.4 10414.8 10415.1 10415.3 10415.4 10415.5 10415.5 10415.5 10415.4 10415.4 10415.3 10415.1 10414.9 10414.7 10414.5 10414.3 ]';
FIR_22SI0406_20FC1001_u = [412008 412009 412009 412009 412010 412010 412010 412011 412011 412011 412012 412012 412012 412013 412013 412014 412015 412015 412016 412016 412016 412017 412017 412017 412017 412018 412018 412018 412018 412019 412019 412019 412019 412020 412020 412020 412020 412020 412020 412020 412020 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 401702 356047 347890 340647 335315 330635 327507 324365 322027 319914 318334 316904 315852 315000 314194 313723 313311 313000 312764 312583 312464 312391 312337 312293 312254 312212 312171 312135 312098 312070 312044 312021 312002 311983 311970 311958 311951 311943 311938 311935 311932 311929 311928 311927 311927 311927 311926 311926 311927 311927 311927 311927 311928 311928 311929 311929 311930 311931 311931 311932 311932 311931 311931 311929 311927 311924 311919 311913 311906 311902 311906 311915 311926 311941 311958 311971 311983 311994 312001 312007 312011 312014 312015 312014 312012 312009 312006 312003 312000 311997 311993 311989 311985 311982 311977 311974 311971 311969 311967 311965 311963 311962 ]';
FIR_22SI0406_20FC1001_y = [10559.3 10559.3 10559.2 10559.2 10559.1 10559.1 10559 10559 10558.9 10558.9 10558.9 10558.8 10558.8 10558.8 10558.7 10558.7 10558.6 10558.6 10558.6 10558.5 10558.5 10558.5 10558.5 10558.4 10558.4 10558.4 10558.4 10558.3 10558.3 10558.3 10558.3 10558.3 10558.3 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558 10557.2 10555.6 10552.9 10549.7 10544.6 10538.6 10530.4 10521.4 10509.7 10497.5 10484.4 10468.7 10456.9 10444.6 10433.4 10423.3 10412.2 10402.1 10394.3 10388.2 10384.2 10381.9 10381 10381.4 10382.6 10384.4 10386.2 10388.6 10391.1 10393.7 10396.4 10398.2 10400.4 10402.4 10403.8 10404.9 10405.9 10407.1 10408 10408.7 10409.1 10409.4 10409.7 10410 10410.2 10410.4 10410.4 10410.5 10410.4 10410.4 10410.4 10410.5 10410.5 10410.6 10410.6 10410.7 10410.8 10410.9 10411 10411.2 10411.3 10411.4 10411.4 10411.4 10411.4 10411.2 10411 10410.8 10410.6 10410.5 10410.3 10410.1 10410.1 10410.2 10410.5 10410.8 10411.3 10411.7 10412.2 10412.7 10413.1 10413.6 10414.1 10414.4 10414.8 10415.1 10415.3 10415.4 10415.5 10415.5 10415.5 10415.4 10415.4 10415.3 10415.1 10414.9 10414.7 10414.5 10414.3 ]';
FIR_22SI0406_20FC1001_ymod = [10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.1 10558 10558.1 10557.2 10555.6 10552.9 10549.7 10544.6 10538.6 10530.4 10521.4 10509.7 10497.5 10484.4 10468.7 10456.9 10444.6 10433.4 10423.3 10412.2 10402.1 10394.3 10388.2 10384.2 10381.9 10381 10381.4 10382.6 10384.4 10386.2 10388.6 10391.1 10393.7 10396.4 10398.2 10400.4 10402.4 10403.8 10404.9 10405.9 10407.1 10408 10408.7 10409.1 10409.4 10409.8 10410 10410.2 10410.4 10410.4 10410.5 10410.4 10410.4 10410.4 10410.5 10410.5 10410.6 10410.6 10410.7 10410.8 10410.9 10411 10411.2 10411.3 10411.4 10411.4 10411.4 10411.4 10411.2 10411 10410.8 10410.6 10410.5 10410.3 10410.1 10410.1 10410.2 10410.5 10410.8 10411.3 10411.7 10412.2 10412.7 10413.1 10413.6 10414.1 10414.4 10414.8 10415.1 10415.3 10415.4 10415.5 10415.5 10415.5 10415.4 10415.4 10415.3 10415.1 10414.9 10414.7 10414.5 10414.3 ]';
FIR_22SI0406_20FC1001 = [2.54275e-005 1.66395e-005 2.8987e-005 4.8898e-005 9.36853e-005 0.000132483 0.000208416 0.00028424 0.000401157 0.000511999 0.000670435 0.000824895 0.000969248 0.00118713 0.00129408 0.00141986 0.00152721 0.00160656 0.00171731 0.00181641 0.00187302 0.00190735 0.00191119 0.00189674 0.00187184 0.00183304 0.00179302 0.00174828 0.00171539 0.00167834 0.00164125 0.00160922 0.0015725 0.00156103 0.0015392 0.00152028 0.00151034 0.00150736 0.00150288 0.0014939 0.00148561 0.00148366 0.0014851 0.00148463 0.00148375 0.00148283 0.00148219 0.00148193 0.00148287 0.0014841 0.00148533 0.00148631 0.0014866 0.00148641 0.00148583 0.00148512 0.00148422 0.00148344 0.00148219 0.00148095 0.00147933 0.00147739 0.00147608 0.00147551 0.00147534 0.00147588 0.00147703 0.00147961 0.00148269 0.00148645 0.00148852 0.00149049 0.00149315 0.00149475 0.00149386 0.00149114 0.00148564 0.00148059 0.00147405 0.00146748 0.00146145 0.00145604 0.00145144 0.00144669 0.00144111 0.00143808 0.00143581 0.00143375 0.00143239 0.00143314 0.00143444 0.00143579 0.00143701 0.00143807 0.00143961 0.00144133 0.00144425 0.00144621 0.0014517 0.00144119 0.00149686 0.00126888 0.00100764 0.000787192 0.000602908 0.000450289 0.000324913 0.000221925 0.000137602 6.89832e-005 1.48027e-005 -2.76225e-005 -6.00646e-005 -8.43057e-005 -0.00010186 -0.00011407 -0.000122146 -0.000127147 -0.000129965 -0.000131366 -0.000131981 -0.00013231 -0.000132586 -0.000132877 -0.000133141 -0.000133395 -0.000133632 -0.000133855 -0.000134065 -0.000134261 -0.000134444 -0.000134615 -0.000134774 -0.000134921 -0.000135058 -0.000135184 -0.0001353 -0.000135408 -0.000135506 -0.000135596 -0.000135679 -0.000135754 -0.000135823 -0.000135885 -0.000135942 -0.000135993 -0.000136039 -0.000136081 -0.00013611 -0.000136139 -0.000136164 -0.000136186 -0.000136204 -0.00013622 -0.000136234 -0.000136245 -0.000136254 -0.000136261 -0.000136267 -0.000136272 -0.000136275 -0.000136276 ]';
FIR_22SI0406_20FC1001_u_wndw0 = [412008 412009 412009 412009 412010 412010 412010 412011 412011 412011 412012 412012 412012 412013 412013 412014 412015 412015 412016 412016 412016 412017 412017 412017 412017 412018 412018 412018 412018 412019 412019 412019 412019 412020 412020 412020 412020 412020 412020 412020 412020 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 412021 401702 356047 347890 340647 335315 330635 327507 324365 322027 319914 318334 316904 315852 315000 314194 313723 313311 313000 312764 312583 312464 312391 312337 312293 312254 312212 312171 312135 312098 312070 312044 312021 312002 311983 311970 311958 311951 311943 311938 311935 311932 311929 311928 311927 311927 311927 311926 311926 311927 311927 311927 311927 311928 311928 311929 311929 311930 311931 311931 311932 311932 311931 311931 311929 311927 311924 311919 311913 311906 311902 311906 311915 311926 311941 311958 311971 311983 311994 312001 312007 312011 312014 312015 312014 312012 312009 312006 312003 312000 311997 311993 311989 311985 311982 311977 311974 311971 311969 311967 311965 311963 311962 ]';
FIR_22SI0406_20FC1001_y_wndw0 = [10559.3 10559.3 10559.2 10559.2 10559.1 10559.1 10559 10559 10558.9 10558.9 10558.9 10558.8 10558.8 10558.8 10558.7 10558.7 10558.6 10558.6 10558.6 10558.5 10558.5 10558.5 10558.5 10558.4 10558.4 10558.4 10558.4 10558.3 10558.3 10558.3 10558.3 10558.3 10558.3 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.1 10558.1 10558.1 10558.1 10558.1 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558.2 10558 10557.2 10555.6 10552.9 10549.7 10544.6 10538.6 10530.4 10521.4 10509.7 10497.5 10484.4 10468.7 10456.9 10444.6 10433.4 10423.3 10412.2 10402.1 10394.3 10388.2 10384.2 10381.9 10381 10381.4 10382.6 10384.4 10386.2 10388.6 10391.1 10393.7 10396.4 10398.2 10400.4 10402.4 10403.8 10404.9 10405.9 10407.1 10408 10408.7 10409.1 10409.4 10409.7 10410 10410.2 10410.4 10410.4 10410.5 10410.4 10410.4 10410.4 10410.5 10410.5 10410.6 10410.6 10410.7 10410.8 10410.9 10411 10411.2 10411.3 10411.4 10411.4 10411.4 10411.4 10411.2 10411 10410.8 10410.6 10410.5 10410.3 10410.1 10410.1 10410.2 10410.5 10410.8 10411.3 10411.7 10412.2 10412.7 10413.1 10413.6 10414.1 10414.4 10414.8 10415.1 10415.3 10415.4 10415.5 10415.5 10415.5 10415.4 10415.4 10415.3 10415.1 10414.9 10414.7 10414.5 10414.3 ]';
FIR_22SI0406_20FC1001_ymod_wndw0 = [10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.3 10559.1 10558 10558.1 10557.2 10555.6 10552.9 10549.7 10544.6 10538.6 10530.4 10521.4 10509.7 10497.5 10484.4 10468.7 10456.9 10444.6 10433.4 10423.3 10412.2 10402.1 10394.3 10388.2 10384.2 10381.9 10381 10381.4 10382.6 10384.4 10386.2 10388.6 10391.1 10393.7 10396.4 10398.2 10400.4 10402.4 10403.8 10404.9 10405.9 10407.1 10408 10408.7 10409.1 10409.4 10409.8 10410 10410.2 10410.4 10410.4 10410.5 10410.4 10410.4 10410.4 10410.5 10410.5 10410.6 10410.6 10410.7 10410.8 10410.9 10411 10411.2 10411.3 10411.4 10411.4 10411.4 10411.4 10411.2 10411 10410.8 10410.6 10410.5 10410.3 10410.1 10410.1 10410.2 10410.5 10410.8 10411.3 10411.7 10412.2 10412.7 10413.1 10413.6 10414.1 10414.4 10414.8 10415.1 10415.3 10415.4 10415.5 10415.5 10415.5 10415.4 10415.4 10415.3 10415.1 10414.9 10414.7 10414.5 10414.3 ]';
figure(1)
subplot(2,1,1)
plot(FIR_22SI0406_20FC1001_uraw)
grid
xlabel('20FC1001 raw data');
title('Data for 22SI0406 and 20FC1001');
subplot(2,1,2)
plot([FIR_22SI0406_20FC1001_yraw FIR_22SI0406_20FC1001_yfilt])
grid
xlabel('22SI0406 raw and filtered');
figure(2)
subplot(3,1,1)
plot(FIR_22SI0406_20FC1001_u)
grid
xlabel('20FC1001');
title('Modeling 22SI0406 from steps in 20FC1001');
subplot(3,1,2)
plot([FIR_22SI0406_20FC1001_y FIR_22SI0406_20FC1001_ymod])
grid
xlabel('22SI0406 measured and model');
subplot(3,1,3)
plot(FIR_22SI0406_20FC1001)
xlabel('Step response');

figure(3)
subplot(2,1,1)
plot(FIR_22SI0406_20FC1001_u_wndw0)
grid
xlabel('20FC1001');
title('Data window #1: Modeling 22SI0406 from steps in 20FC1001');
subplot(2,1,2)
plot([FIR_22SI0406_20FC1001_y_wndw0 FIR_22SI0406_20FC1001_ymod_wndw0])
grid
xlabel('22SI0406 measured and model');

% MATLAB SCRIPT ENDS .......

