The UUT is measuring the teeth of a wheel spinning at 1000 RPM. I can't help but wonder if maybe the sine wave is actually wheel wobble. Any thoughts on that?
Can you please expand a little on that? How many teeths do you have on the wheel and are you using a proximity sensor to do the measurement? Is the square wave supposed to measure the teeth frequency? If so and since we have an unwanted signal that is the 5th harmonic of the square wave, do you have any gear in the system that has a 5:1 ratio?
A small sketch of you setup (mechanical and electrical) would definitely help.
The interfering signal is almost exactly at the 5th harmonic of the pulse signal and is very nearly synchronous with the pulses. I suspect that you can get reasonably good rise time measurements without worrying about removing the interfering signal.
Here is an example. It contains some unused code which I had tried but later discarded. I removed that last element from the data set because it is an outlier. I looked at the spectrum. It clearly shows the harmonic content of the pulses. The spectrum of the 7.5 kHz sine wave is essentially undistinguishable from the harmonics of the pulses. The for loop finds the indexes in the data array where the signal crosses the "10%" and "90%" thresholds. The thresholds are in quotes " " because the values used are "eyeball" estimates rather than trying to program a determination of the amplitude of the sine wave. The constant 0.38 used in calculating the thresholds would be 0.45 (90% * 0.5) if no interference was present.
Note that the graph of the rise times has a distinctly periodic look to it. That is probably the effect of the interference.
So I went and used your threshold values and added a saturatuion block. There is still a sinusoidous component to the rise times. Changing the Plot type to small open diamonds no line clearly shows the same effect in the top graph. I suspect this is a "Beat" of the sample rate and the motor speed.
Looking at the FFT, I guess there is more than one target per revoloution! and there is some variability in the displacement of those proximity targets. They are not exactly equally spaced!
The Hardware RC Filter may be underdamped- What happens if you just remove it?
So it's a wheel turning with 1000rpm ... may I ask why you need to measure the rise time?
The only thing I can think of is to get a faster response ( calc the speed by risetime?? )
Reminds me of an application measuring the (aircraft) turbine blade to housing distance (with a cap. sensor) .. after some heavy signal processing/modelling you where able to identify each blade and even blade bending and vibration 😄