DSPRelated.com
Forums

sinewave DDS output starts appearing triangular as freq is increased

Started by currentsource December 10, 2010
I am experimenting with a DDS implementation on a Xilinx Spartan-3A starter
board. I am sending the DDS output to the on-board SPI-interface DAC (the
LTC 2624), clocked at 40 MHz. The 32 bit SPI protocol triggers a conversion
every 33 SPI clks, so that is effectively a sampling rate of 1.2 MHz. I do
NOT have an anti-imaging filter in place, so am looking at the raw DAC
analog output.

The output waveform starts out as a fairly clean (qualitatively speaking)
sinusoid at low frequencies (up to 50 kHz), but as I crank up the
frequency, it starts becoming more and more triangular. At 100 kHz the
waveshape is fairly triangular; it is even more crisply so at 150 kHz. What
might be causing this change in wave shape?

My guess is the following: DAC nonlinearity causes harmonics to appear in
the output. These harmonics get generated for all signal frequencies, of
course, but as the signal freq is increased, the amplitude of the
fundamental starts decreasing due to the sinc nature of the DAC's output
response. When the amplitude of the fundamental drops to where the
first/third/fifth harmonic amplitudes are close to the ideal 1 : 1/9 : 1/25
ratio of Fourier coefficients for a triangle wave, the waveshape starts
appearing more and more triangular. 

Might this indeed be the cause? (I don't have access to a spectrum
analyzer, so have no easy way to verify my thesis.) 





currentsource wrote:

> I am experimenting with a DDS implementation on a Xilinx Spartan-3A starter > board. I am sending the DDS output to the on-board SPI-interface DAC (the > LTC 2624), clocked at 40 MHz. The 32 bit SPI protocol triggers a conversion > every 33 SPI clks, so that is effectively a sampling rate of 1.2 MHz. I do > NOT have an anti-imaging filter in place, so am looking at the raw DAC > analog output. > > The output waveform starts out as a fairly clean (qualitatively speaking) > sinusoid at low frequencies (up to 50 kHz), but as I crank up the > frequency, it starts becoming more and more triangular. At 100 kHz the > waveshape is fairly triangular; it is even more crisply so at 150 kHz. What > might be causing this change in wave shape?
This looks very much like a slew rate limitation. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On 12/10/2010 06:29 PM, currentsource wrote:
> I am experimenting with a DDS implementation on a Xilinx Spartan-3A starter > board. I am sending the DDS output to the on-board SPI-interface DAC (the > LTC 2624), clocked at 40 MHz. The 32 bit SPI protocol triggers a conversion > every 33 SPI clks, so that is effectively a sampling rate of 1.2 MHz. I do > NOT have an anti-imaging filter in place, so am looking at the raw DAC > analog output. > > The output waveform starts out as a fairly clean (qualitatively speaking) > sinusoid at low frequencies (up to 50 kHz), but as I crank up the > frequency, it starts becoming more and more triangular. At 100 kHz the > waveshape is fairly triangular; it is even more crisply so at 150 kHz. What > might be causing this change in wave shape? > > My guess is the following: DAC nonlinearity causes harmonics to appear in > the output. These harmonics get generated for all signal frequencies, of > course, but as the signal freq is increased, the amplitude of the > fundamental starts decreasing due to the sinc nature of the DAC's output > response. When the amplitude of the fundamental drops to where the > first/third/fifth harmonic amplitudes are close to the ideal 1 : 1/9 : 1/25 > ratio of Fourier coefficients for a triangle wave, the waveshape starts > appearing more and more triangular. > > Might this indeed be the cause? (I don't have access to a spectrum > analyzer, so have no easy way to verify my thesis.)
Your nym is "currentsource" and you are having trouble recognizing the classic symptom of slew rate limitation? Hmm. How ironic. Check the data sheet for the DAC (or op-amp, if you're following the DAC with one) for slew rate. See if things start to make sense. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On Dec 10, 11:01=A0pm, Tim Wescott <t...@seemywebsite.com> wrote:
> On 12/10/2010 06:29 PM, currentsource wrote: > > > > > I am experimenting with a DDS implementation on a Xilinx Spartan-3A sta=
rter
> > board. I am sending the DDS output to the on-board SPI-interface DAC (t=
he
> > LTC 2624), clocked at 40 MHz. The 32 bit SPI protocol triggers a conver=
sion
> > every 33 SPI clks, so that is effectively a sampling rate of 1.2 MHz. I=
do
> > NOT have an anti-imaging filter in place, so am looking at the raw DAC > > analog output. > > > The output waveform starts out as a fairly clean (qualitatively speakin=
g)
> > sinusoid at low frequencies (up to 50 kHz), but as I crank up the > > frequency, it starts becoming more and more triangular. At 100 kHz the > > waveshape is fairly triangular; it is even more crisply so at 150 kHz. =
What
> > might be causing this change in wave shape? > > > My guess is the following: DAC nonlinearity causes harmonics to appear =
in
> > the output. These harmonics get generated for all signal frequencies, o=
f
> > course, but as the signal freq is increased, the amplitude of the > > fundamental starts decreasing due to the sinc nature of the DAC's outpu=
t
> > response. When the amplitude of the fundamental drops to where the > > first/third/fifth harmonic amplitudes are close to the ideal 1 : 1/9 : =
1/25
> > ratio of Fourier coefficients for a triangle wave, the waveshape starts > > appearing more and more triangular. > > > Might this indeed be the cause? (I don't have access to a spectrum > > analyzer, so have no easy way to verify my thesis.) > > Your nym is "currentsource" and you are having trouble recognizing the > classic symptom of slew rate limitation? > > Hmm. =A0How ironic. > > Check the data sheet for the DAC (or op-amp, if you're following the DAC > with one) for slew rate. =A0See if things start to make sense. > > -- > > Tim Wescott
I would expect a slew-rate limit to have a very obvious effect on the observed amplitude. Does that provide a clue? Jerry Engineering is the art of making what you want from things you can get.
On 12/11/2010 11:11 AM, Jerry Avins wrote:
> On Dec 10, 11:01 pm, Tim Wescott<t...@seemywebsite.com> wrote: >> On 12/10/2010 06:29 PM, currentsource wrote: >> >> >> >>> I am experimenting with a DDS implementation on a Xilinx Spartan-3A starter >>> board. I am sending the DDS output to the on-board SPI-interface DAC (the >>> LTC 2624), clocked at 40 MHz. The 32 bit SPI protocol triggers a conversion >>> every 33 SPI clks, so that is effectively a sampling rate of 1.2 MHz. I do >>> NOT have an anti-imaging filter in place, so am looking at the raw DAC >>> analog output. >> >>> The output waveform starts out as a fairly clean (qualitatively speaking) >>> sinusoid at low frequencies (up to 50 kHz), but as I crank up the >>> frequency, it starts becoming more and more triangular. At 100 kHz the >>> waveshape is fairly triangular; it is even more crisply so at 150 kHz. What >>> might be causing this change in wave shape? >> >>> My guess is the following: DAC nonlinearity causes harmonics to appear in >>> the output. These harmonics get generated for all signal frequencies, of >>> course, but as the signal freq is increased, the amplitude of the >>> fundamental starts decreasing due to the sinc nature of the DAC's output >>> response. When the amplitude of the fundamental drops to where the >>> first/third/fifth harmonic amplitudes are close to the ideal 1 : 1/9 : 1/25 >>> ratio of Fourier coefficients for a triangle wave, the waveshape starts >>> appearing more and more triangular. >> >>> Might this indeed be the cause? (I don't have access to a spectrum >>> analyzer, so have no easy way to verify my thesis.) >> >> Your nym is "currentsource" and you are having trouble recognizing the >> classic symptom of slew rate limitation? >> >> Hmm. How ironic. >> >> Check the data sheet for the DAC (or op-amp, if you're following the DAC >> with one) for slew rate. See if things start to make sense. >> >> -- >> >> Tim Wescott > > I would expect a slew-rate limit to have a very obvious effect on the > observed amplitude. Does that provide a clue?
I scanned his message for any indication of what happens to the magnitude of the triangle wave as the frequency goes up -- I didn't see a clue. If he would get back to us with details, we could help. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
>>> Check the data sheet for the DAC (or op-amp, if you're following the
DAC
>>> with one) for slew rate. See if things start to make sense. >>> >>> -- >>> >>> Tim Wescott >> >> I would expect a slew-rate limit to have a very obvious effect on the >> observed amplitude. Does that provide a clue? > >I scanned his message for any indication of what happens to the >magnitude of the triangle wave as the frequency goes up -- I didn't see >a clue. > >If he would get back to us with details, we could help. >
Yes, it is of course the slew rate. I had indeed plotted the amplitude against freq and seen that amplitude starts dropping steadily after 100 kHz or so. I had thoughtlessly attributed it to the sinc rolloff at the DAC output (which is what led me to my rather exotic theory as to why I might be seeing a triangle wave). I can now see that the amplitude drops off _much_ more rapidly than the sinc function dictates, and that makes complete sense in light of the slew rate limitation. As the output is trying to slowly ramp up towards a peak, the sine input has already crested and is on its way down; the output starts dropping again well before it reaches a peak. This effect only gets worse as the frequency is increased leading to lower and lower amplitudes. From the data sheet, the LTC 2624 DAC used on the board has a slew rate of 0.8 V/us. At 150 kHz, the worst-case slew of the ideally 3.3V p-p sine is 2*pi*150kHz*1.6V = 1.52 V/us, and hence the distortion. Sending a fast ramp input to the DAC shows the effects of the slew rate limitation even more starkly. Thank you all for your input!