05-12-2006 09:28 AM
05-17-2006 09:36 AM
Hi idrisi,
The reason you are currently getting that shifting effect is that you are using software timing to start waveform generation.
The problem with this is that you cannot guarantee the sine and square wave are beginning to generate their waveforms at the same instance.
This is the cause of the phase shift you are seeing. Although the waveforms have the same sample clock rate and are being generated at the same time one of the waveforms is starting generation later than the other.
What you need to implement is hardware timing to ensure that both waveforms simultaneously start generation.
I have attached an example piece of code which demonstrates how this can be done by using a digital trigger to ensure both your square wave and sine wave begin generation at the same time.
I hope this helps you,
Emma Rogulska
NIUK & Ireland
05-18-2006 04:33 AM