• 0

Inconsistent wavegen frequency with small samples


Question

I am using the Analog Discovery 2 and Analog Discovery Pro. I have a very long sequence of a square wave pulses at a constant frequency with notches. The current method I use to generate these square wave sequences is with a script that creates a sequence of 1s and 0s. A small sample of my output array would be something like this: [0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,0,1,0] (notch 3 cycles, square 3 cycles, notch 2 cycles, square 3 cycles). I currently sample at 660kHz to get a cycle frequency of 330kHz.

This works as expected with the pattern generator, but I need a larger output buffer (32kS) so I am attempting to use the wavegen output on the ADP. Unfortunately, even with a smaller test sequence (first and second img below) the output as measured by the oscilloscope is inconsistent (last img below). 

Is there a difference in the way these signals are generated that can explain the difference in results? Is it possible to get the behavior I want with this sequence on the ADP wavegen? I am open to different ways of creating this sequence, but wanted to keep my first post broad instead of diving into my strange requirements. 

Thanks in advance for any help! 

image.thumb.png.c49a89fd1b1b68eac02a4d26a53cea3f.png

image.png.41f0a221b7140c154980dde3e3752970.png

image.thumb.png.9213bb7a952a7328d09aeb0e62ca2801.png
 

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Josh Woods

The Wavegen is optimized for analog waveforms, so the generated average frequency to be close as possible to the requested. For this, fractional steps are used and this may result in varying sample rate.

I'll post soon software version with fixed sample rate option.

Edited by attila
Link to post
Share on other sites
  • 0

Hi @Josh Woods

For stable sample rate use the Signal Pattern option in the latest WF version:

You can use Custom or Play mode for more samples at limited streaming rate.
With AD2 Custom Pattern make sure the number of samples is power of two. With Play or Custom with ADP3X50 the number of samples can be arbitrary.

image.thumb.png.5d263e3218f14e86359974baf3822e31.png

image.thumb.png.b90b7744e935053299b470eaa86a0f39.png

 

 

Edited by attila
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now