In the below picture, the spap2 function is used in Matlab to smooth noisy data. The result is very good. Eigen library supports this functionality Splines. I'm looking for an example in Eigen to obtain similar results. For the Matlab, I've used spap2(4, 4, time, noisyY);
Data is provided in this format time noisyData
1.766 6.61202
1.767 11.4159
1.768 8.29416
1.769 8.29416
1.77 8.29416
1.771 6.02606
1.772 4.37819
1.773 4.37819
1.774 4.37819
1.775 3.18094
1.776 2.31109
1.777 1.67911
1.778 1.21994
1.779 0.886339
1.78 0.643963
1.781 0.467867
1.782 0.339925
1.783 0.24697
1.784 0.179434
1.785 7.03822
1.786 12.0214
1.787 8.73406
1.788 6.34567
1.789 4.6104
1.79 4.6104
1.791 4.6104
1.792 10.2071
1.793 14.2732
1.794 10.3701
1.795 7.53429
1.796 5.47398
1.797 3.97708
1.798 2.88952
1.799 2.09936
1.8 8.18047
1.801 12.5985
1.802 9.15338
1.803 6.65032
1.804 11.4743
1.805 14.9787
1.806 14.9787
1.807 14.9787
1.808 14.9787
1.809 10.8827
1.81 7.90674
1.811 5.74458
1.812 5.74458
1.813 4.17368
1.814 3.03236
1.815 2.20314
1.816 2.20314
1.817 8.27015
1.818 12.678
1.819 9.2111
1.82 9.2111
1.821 6.69225
1.822 4.86221
1.823 3.5326
1.824 2.56658
1.825 1.86473
1.826 1.35481
1.827 0.984325
1.828 0.715154
1.829 0.51959
1.83 0.377504
1.831 0.274273
1.832 0.199271
1.833 0.144779
1.834 0.105188
1.835 0.0764235
1.836 0.0555249
1.837 0.0403412
1.838 0.0293096
1.839 0.0212947
1.84 0.0212947
1.841 0.0212947
1.842 0.0154715
1.843 0.0112407
1.844 0.00816684
1.845 0.00593356
1.846 0.00431098
1.847 0.00313211
1.848 0.00227561
1.849 0.00165333
1.85 0.00120121
1.851 0.000872733
1.852 0.000634078
1.853 0.000460684
1.854 0.000334707
1.855 0.000334707
1.856 0.000334707
1.857 0.000334707
1.858 0.000334707
1.859 0.000243179
1.86 0.000243179
1.861 0.000243179
1.862 0.00017668
1.863 0.000128365
1.864 9.32629e-005
1.865 9.32629e-005
1.866 9.32629e-005
1.867 9.32629e-005
1.868 6.77594e-005
1.869 4.92301e-005
1.87 3.57678e-005
1.871 2.59868e-005
1.872 1.88805e-005
1.873 1.37175e-005
1.874 9.96635e-006
1.875 7.24098e-006
1.876 5.26088e-006
1.877 3.82225e-006
1.878 3.82225e-006
1.879 3.82225e-006
1.88 2.77703e-006
1.881 2.01763e-006
1.882 1.46589e-006
1.883 1.06503e-006
1.884 6.60526
1.885 11.4043
1.886 8.28568
1.887 6.0199
1.888 4.37371
1.889 3.17769
1.89 3.17769
1.891 3.17769
1.892 2.30873
1.893 1.67739
1.894 1.21869
1.895 0.885433
1.896 7.27548
1.897 11.9181
1.898 8.65899
1.899 6.29112
1.9 11.2017
1.901 14.7692
1.902 10.7305
1.903 7.79614
1.904 6.77613
1.905 6.03755
1.906 6.03289
1.907 6.03289
1.908 4.38315
1.909 3.18455
1.91 3.18455
1.911 9.51471
1.912 14.1156
1.913 10.2556
1.914 7.45113
1.915 7.45113
1.916 7.45113
1.917 5.41357
1.918 3.93319
1.919 2.85763
1.92 2.07619
1.921 8.9437
1.922 13.9338
1.923 13.9338
1.924 13.9338
1.925 10.1235
1.926 7.35515
1.927 11.9508
1.928 15.2911
1.929 11.1096
1.93 8.07161
1.931 5.86437
1.932 4.26071
1.933 4.22711
1.934 4.20402
1.935 3.0544
1.936 2.21915
1.937 1.61231
1.938 1.17141
1.939 0.851079
1.94 0.618345
1.941 0.449254
1.942 0.326402
1.943 0.237145
1.944 0.172296
1.945 0.12518
1.946 0.0909488
1.947 0.0660782
1.948 1.10487
1.949 1.85961
1.95 1.35108
1.951 0.981619
1.952 0.713188
1.953 0.518162
1.954 0.518162
1.955 0.518162
1.956 0.376466
1.957 0.376466
1.958 0.376466
1.959 0.273519
1.96 0.273519
1.961 0.198723
1.962 0.198723
1.963 0.144381
1.964 0.144381
1.965 0.104899
1.966 0.0762134
1.967 0.0553723
1.968 0.0402303
1.969 0.029229
1.97 0.029229
1.971 0.0212361
1.972 0.015429
1.973 0.015429
1.974 0.015429
1.975 1.16617
1.976 2.00223
1.977 1.4547
1.978 1.0569
1.979 0.767886
1.98 0.557902
1.981 0.405339
1.982 6.92392
1.983 11.6607
1.984 8.472
1.985 6.15527
1.986 4.47207
1.987 3.24915
1.988 2.36064
1.989 1.71511
1.99 1.2461
1.991 0.905344
1.992 0.657771
1.993 0.477898
1.994 0.347213
1.995 0.252265
1.996 0.183281
1.997 0.133162
1.998 0.0967477
1.999 0.0702913
2 0.0510696
2.001 6.71936
2.002 11.5642
2.003 8.40185
2.004 6.1043
2.005 4.43504
2.006 3.22224
2.007 3.22224
2.008 3.22224
2.009 2.3411
2.01 1.70091
2.011 1.23578
2.012 1.23578
2.013 0.897847
2.014 0.652324
2.015 0.473941
2.016 0.344338
2.017 6.28219
2.018 9.6646
2.019 6.08633
2.02 4.42198
2.021 3.21276
2.022 2.3342
2.023 2.33601
2.024 2.33471
2.025 1.69626
2.026 1.23241
2.027 0.895397
2.028 0.650544
2.029 0.472648
2.03 0.343399
2.031 0.249494
2.032 0.181268
2.033 0.131699
2.034 6.63352
2.035 11.3573
2.036 8.25156
2.037 7.12148
2.038 6.30308
2.039 4.57946
2.04 4.57946
2.041 10.0969
2.042 10.0969
2.043 14.1081
2.044 10.2501
2.045 7.44714
2.046 4.52751
2.047 2.40446
2.048 1.74694
2.049 7.73084
2.05 13.1854
2.051 10.6942
2.052 7.76983
2.053 12.0593
2.054 12.0593
2.055 15.1777
2.056 11.0272
2.057 9.03106
2.058 7.58411
2.059 12.1218
2.06 12.1218
2.061 15.4222
2.062 15.4273
2.063 11.2086
2.064 14.753
2.065 17.3291
2.066 12.5903
2.067 10.2519
2.068 8.55693
2.069 6.21698
2.07 11.1335
2.071 14.7082
2.072 10.6861
2.073 10.6852
2.074 10.6852
2.075 7.76327
2.076 12.2467
2.077 15.5046
2.078 17.8479
2.079 19.5501
2.08 14.204
2.081 16.9469
2.082 25.5109
2.083 25.1054
2.084 24.8705
2.085 24.6988
2.086 24.8916
2.087 25.0307
2.088 25.1688
2.089 25.1703
2.09 25.1703
2.091 32.1727
2.092 31.3272
2.093 30.4857
2.094 28.8139
2.095 27.5487
2.096 33.2503
2.097 33.2504
2.098 30.778
2.099 29.6056

One of your axioms is incorrect. Eigen (un)supports spline interpolation, which is different than approximating a function using splines. In the former, the spline must pass through the data points, whereas in the approximation they don't, as in
spap2. Using the following example, you can check the output to verify that bothspline(times(i))andsins(i)give the same result.