Jump to content
  • 0

high sampling rate problems


ssm

Question

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,

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

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

Link to comment
Share on other sites

Hi @ssm

I think it would be easier first to experiment with the WaveForms application, on how can you filter the signal or to extract the information you need from it.
The device-circuit offset error can be eliminated with a zero offset option, measuring the average with shorted input then using this as deltaAD2 to subtract from measurement.
You can also try Math channels, low/high/band-pass filters, FFT view, or Spectrum Analyzer tool.

image.png.804b9d795cbe38177a95621b57005922.png

Link to comment
Share on other sites

Hi Attila,

thank you  again for the great help,

I am reading a noisy weak signal, and I need this noise, I will call this Signal:  S + deltaS. deltaS being the noise from the signal S itself. 

Now the problem is that the AD2 board might have its own noise, call that deltaAD2 , and it might had that to the total noise.

So the total signal is: S + deltaS + deltaAD2

if my assumptions above are correct, is there a way using the noise buffer or calibration to separate/remove the deltaAD2 from the signal while keeping deltaS intact?

thank you for the help

ssm

Link to comment
Share on other sites

thank you again for the help,

Is there a way to read the binary data from the scope, or from the ADC directly? I need to read the actual binary data produced by the ADC before converting to decimal values.

In other words, reading the buffer contents filled by the ADC directly as zeros and ones,

thanks

ssm  

Link to comment
Share on other sites

Hi @ssm

For each channel you can select sampling mode (filter) between: average, decimate and min/max.
The averaging (default) filters components above sampling rate, acts like anti-aliasing, but damps lower frequency components too.
In case you don't want this filtering select decimate.
dwf.FDwfAnalogInChannelFilterSet(hdwf, c_int(-1), filterDecimate)

The noise buffer is an optional, separate buffering method to indicate glitches or higher frequency components.

 

Link to comment
Share on other sites

thank you for the great help,

I noticed when I use the scope in Waveforms interface, I can see the Noise checkbox both under the Options panel and under the Channel 1/2 panel, this is used for filtering the noise I presume, 

In my work, I do not want to filter the noise, I need the noise to stay in the signal so I usually untick the Noise checkbox,

Is there something equivalent to that in the c++ coding? is there a way to switch off filtering?

thank you

ssm

Link to comment
Share on other sites

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))

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...