Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Make a filter to pass the fundamental component. Then use an amplifier or attenuator or even a potential divider to get the sine wave amplitude you want.
If the digital signal has repitition rate, or commonly, frequency f, this is also the fundamental components frequency,i.e. the frequency of the biggest amplitude sine wave you can make this waveform from, so if you only pass it through a filter to pass it only, for example a Band Pass Filter of pass frequency (fp) such that f<fp<2f,
You'll get the wave you want. Then use an amplifier or any thing else, example. amplifier and limiter to get the amplitude you need.
The peak fundamental value of a 50% square wave is Vsq * 4 / Pi, where Vsq is the peak (not peak-to-peak) value of the square wave. If you run the square wave through a high- Q bandpass filter (or several in cascade) you will get a sine wave of this magnitude. It's interesting to note that the peak value of the fundamental is greater than the peak value of the square wave. The order of the require bandpass filter will depend on the amount of distortion you can tolerate. Only odd order harmonics will be present. The relative magnitude of the nth harmonic is equal to 1/n. The reason that I recommend a bandpass filter instead of a low pass filter is that the initial rolloff slop of a high Q bandpass is much higher than that of a similar order low-pass (even an elliptic).