Showing results for 
Search instead for 
Did you mean: 

Filtering a Square Wave

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?

0 Kudos
Message 21 of 24

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.

0 Kudos
Message 22 of 24

@johnsold wrote:

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.



Nice Lynn

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?

"Should be" isn't "Is" -Jay
0 Kudos
Message 23 of 24

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?? )


  • the RC filter isn't a good idea for that. 
  • if resolution increases, you will be able to use the rising and falling edge of each single teeth and find a jitter per revolution, say you can identify each individual teeth 🙂

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 😄


Greetings from Germany

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

0 Kudos
Message 24 of 24