You may use a lowpass filter and set the passband of the filter a bit higher than the frequency of the square wave.
- How do I create a Gaussian filter in LabVIEW? neuron1
- LoveDSP
You may use a lowpass filter and set the passband of the filter a bit higher than the frequency of the square wave.