• 0
ssm

high sampling rate problems

Question

Posted (edited)

Hi,

I am new to the AD2 board, and I am doing the following:

Experiment: using the scope in waveforms to read in data at a sampling rate 2M and higher, and number of collected samples is 16M. I am using Mac OS.

problem: when I use rate to be 2M, the reading of the samples is dropping after saving about 12M samples, so I either get around 12M samples only or the 4M left are saved as zeros. Increasing the rate increases the problem.

Questions:

- is this a USB problem? if it is, is there a way to go around the USB? using another board or module 

- is this a buffer size problem? I am putting the number of buffers to be 1K, and the scope setting to be 2x16K 

- although the board specs say I can get up to 100M rate, is there a way to that practically?

thank you for your time,

Edited by ss_majzoub@yahoo.com

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0
Posted (edited)

Hi @ssm

The OscilloScope has multiple operation modes:
- Repeated: lets you capture up to 8/16k samples per channel at up to 100MHz.
- Scan Screen/Shift: for monitoring slow signals continuously
- Record: lets you capture large amount of samples (16M). The data streaming limits the rate to about 1MHz.
+ Under Time options external clocking can be selected based on a trigger signal. The ADC always works on the internal 100MHz clock, only the sample storage is controlled by external signal.

The Analog Discovery has 8/16k sample device buffer for Repeated or Scan captures, at up to 100MHz. For 16k buffer select the 2nd device configuration under Settings/Device Manager.
In Record mode this is used as fifo-buffer and the data is stream to host over USB, limiting the rate to about 1Msps. The buffer overflow is indicated by "samples lost/could be lost message".

image.png.15939609371e7cc2a39814de417f2439.png

Edited by attila

Share this post


Link to post
Share on other sites
  • 0

ok, thank you again for the reply,

is there a way to increase the number of samples while keeping the rate >2M? basically I am trying to find a way to read samples at higher than 2MHz (up to 50MHz) with number of samples to be 16Ms.

for instance, can I use the scripting or SDK with the Repeated scope mode and save chunks of 16k continuously into a file? Is there an example on how to configure the scope to do that? I am looking at the SDK Cpp files trying to construct the script.

Note that I do not mind the discontinuity between the 16k chunks due to the time taken to send to USB and save the data

thank you again, I appreciate the help

Edited by ssm

Share this post


Link to post
Share on other sites
  • 0

Hi @ssm

You can find more Python examples, which you can use as pseudocode.

Like: SDK/ samples/ py/ AnalogIn_Trigger.py
Performs repeated captures: capture 1, ~millisecond delay to fetch the data, capture 2, delay,...
For AD use the 2nd configuration to have 16k oscilloscope/analog-in buffer. Change FDwfDeviceOpen to:
FDwfDeviceConfigOpen(-1, 1, &hdwf); // 1 = 2nd

Share this post


Link to post
Share on other sites
  • 0

Hi Attila,

I am trying to find the dwf library and link it when compiling using g++ under Mac iOS. 

please can you tell me where I can find it for Mac? thank you

I already checked the forum: 

 

 

Share this post


Link to post
Share on other sites
  • 0

thank you Attila for the help,

I am trying to generate a pulse using FDwfAnalogOutNodeFunctionSet but I did not find a function for that like funcSine,

is there a way to do that other than customizing a square wave? the length of the pulse is variable calculated in the code.

Share this post


Link to post
Share on other sites
  • 0

Hi @ssm

For such you can use the wait-run timing, like here: AnalogOut_Pulse.py

You could also use the funcSquare, funcPulse or custom with this the duty will be limited by the device buffer size, like 0.025%
The wait-run can have arbitrary timing, like run for 10ns and wait for 1day.

dwf.FDwfAnalogOutNodeEnableSet(hdwf, channel, AnalogOutNodeCarrier, c_bool(True))
dwf.FDwfAnalogOutIdleSet(hdwf, channel, DwfAnalogOutIdleOffset)
dwf.FDwfAnalogOutNodeFunctionSet(hdwf, channel, AnalogOutNodeCarrier, funcSquare)
dwf.FDwfAnalogOutNodeFrequencySet(hdwf, channel, AnalogOutNodeCarrier, c_double(0)) # low frequency
dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, channel, AnalogOutNodeCarrier, c_double(3.3))
dwf.FDwfAnalogOutNodeOffsetSet(hdwf, channel, AnalogOutNodeCarrier, c_double(0))
dwf.FDwfAnalogOutRunSet(hdwf, channel, c_double(pulse)) # pulse length
dwf.FDwfAnalogOutWaitSet(hdwf, channel, c_double(0)) # wait length
dwf.FDwfAnalogOutRepeatSet(hdwf, channel, c_int(1)) # repeat once

dwf.FDwfAnalogOutConfigure(hdwf, channel, c_bool(True))

 

Share this post


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