Re: filter design
keithma,
Ideally, you would use a "brick wall" low pass filter. This is a filter that has 0 attenuation (Gain of 1) below the cutoff frequency (2MHz) and infinite attenuation (Gain of 0) above the cutoff frequency. Unfortunately, it is not possible to implement such a filter. So you are stuck with making compromises. First, you need to decide how much attenuation that you can tolerate at 2 MHz. Then you need to decide the minimum attenuation that you can live with at 4 MHz. When these decisions are made, you can determine the complexity of the filter that is required. When the minimum acceptable peformance limits of the filter are defined, you can then design the filter, either as an active or passive filter. See any good filter design reference for details. A good one for beginners is the one by Steve Winder.
.
Another thing to keep in mind is that a 2 MHz square wave consists of a fundamental and an infinite nubmer of odd harmonics. If you design a very sharp low pass filter to pass only frequencies at or below 2 MHz, then all of the harmonics of the 2 MHz square wave would be eliminated, and you would end up with a 2 MHz sine wave.
Regards,
Kral