Reply by Rick Collins April 21, 20002000-04-21
I don't have full info on how you are programming this, but I am fairly
sure that your problem is caused by unavoidable delay in the ADC, DSP and
DAC components. The ADC takes some time to convert a signal. This delay may
be unavoidable or may be in part due to the way the software works with the
part.

If you are using a standard ADC which requires a trigger to start
conversion, then your software is triggering a conversion. The DSP reads
the converted data and triggers a new conversion. If this process is
repeated at the 20 KHz rate, the data is always one sample period old when
read by the DSP.

If you are using a sigma delta converter, then there is a fixed delay
caused by the filters in the ADC. This is often several sample periods long.

The DAC will have similar delays depending on the type. A standard
converter will have about one sample period delay before the output is
stable. A sigma delta converter will have a longer delay due to the filtering.

Finally, depending on how you write your code, you may have very long
delays in the DSP. Many applications use multiple buffers which are swapped
as they are filled and emptied. This will create delays as long as your
buffer size. Even if you don't have a buffer, you will likely to see a one
sample delay depending on how your code transfers the data from the ADC to
the DAC.

So once you realize that it is hard to remove the fixed delay from such an
application, you need to find out how long your delay is. You should be
able to measure the fixed delay at several frequencies to verify that it is
indeed a fixed delay. As long as it is fixed, this should be no problem.
This will not distort pulses or any other waveshape. Most designers have a
problem if the delay is anything other than a fixed delay. This is also
called a linear phase delay implying that the delay varies linearly with
frequency which is what you seem to be seeing.

The best way to minimize this delay is to eliminate any of the sources of
delay that you can. Then increase the sample rate to minimize the effect of
any delays that you can't eliminate.

If you really need a fixed phase delay in this process, then you will need
to design a filter for the DSP that will compensate for the delay by making
it longer, but a fixed phase. This will be not so easy and gets into very
complex filter design.
At 09:45 AM 4/21/00 , you wrote:
>Hi all..
>I just started using the C31 not long ago; so i am still in the
>learning process. There is something that I just cant seem to
>understand! I have this program that just echos the input out.
>However, when i change the frequency of the input, the phase changes
>between the two signals (input and output). It keeps shifting as I
>change frequency, although the two signals are still the same! Now..
>i thought that would be due to the delay in Calculations but from
>what i understand that it is supposed to be very fast and I am
>processing a signal that is less than 1 KHz with a sampling freqeuncy
>of 20KHz! If you know why that is happening, please let me know and
>how can I make the two signals have a fixed phase shift as I change
>the frequency? Thank youuuu :)
Rick Collins

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design

Arius http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX


Reply by Crazybaby April 21, 20002000-04-21
Hi all..
I just started using the C31 not long ago; so i am still in the
learning process. There is something that I just cant seem to
understand! I have this program that just echos the input out.
However, when i change the frequency of the input, the phase changes
between the two signals (input and output). It keeps shifting as I
change frequency, although the two signals are still the same! Now..
i thought that would be due to the delay in Calculations but from
what i understand that it is supposed to be very fast and I am
processing a signal that is less than 1 KHz with a sampling freqeuncy
of 20KHz! If you know why that is happening, please let me know and
how can I make the two signals have a fixed phase shift as I change
the frequency? Thank youuuu :)