Jump to content
  • 0

Pulse at end of buffer with funcPlayPattern


Meindert Norg

Question

Hi,

I'm playing back a 5 second long 8 kHz sine signal at 6 MHz using funcPlayPattern. (30e6 sample) The sine signal is modulated with a ramp which changes from 1 to 0 over the length of the sine signal, resulting in an amplitude of ~1 at the start of the 5 sec playback, and 0 at the end. 

The issue is that if I zoom into the tail end of the 5 seconds data set on my o'scope, I can see an unexpected  ~50 ns long pulse. See scope photos. 

Any thoughts on what might cause that pulse and how to prevent it? 

Input data: 

image.thumb.png.42872eb04e92772d0ac324732bfce68d.png

1 sec / div

IMG_2383.thumb.jpg.952ec1b8672ebcbe852b6cd8cf5853d1.jpg

2 ms / div

IMG_2384.thumb.jpg.c36b472a6d0c10564e417246cec8176d.jpg

50 usec / div

IMG_2385.thumb.jpg.d2bb873df401cc544bb50e55a1b6520a.jpg

500 ns / div with the unexpected pulse triggered.

 

IMG_2386.thumb.jpg.74f63c08a62939794bfdd7a5dfbd475a.jpg

 

I uploaded the file which I use to switch back and forth between using a PlaybackOnlyExample2.pypre-recorded signal (not included) and a synthesized signal. The latter is the default setting, generating the signal at output 2. 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Using

dwf.FDwfAnalogOutRunSet(hdwf, iWavegen, c_double(0.0))

made it 'worse', See photo below. 

IMG_2391.thumb.jpg.adf11773275069d3fcc79bdb8b875203.jpg

Note that I'm ultimately not really to make a sweep of any kind (hence I think the AnalogOut_Sweep.py example will not suit my needs). I want to repeatedly play back a 6 MHz synthesized (home-made) signal and (for now) am using a sine with decreasing amplitude to prove that the output looks like what I generated. 

 

I was able to reproduce the issue (PlaybackOnlyExample3.py) to its simplest form where instead of a sine I'm now using a slope from 1 to 0. At the point where the waveform is repeated, the analog output is

  1. set to the new value (you can test that by changing the start value) for ~50 ns, then 
  2. set to the old value (you can test that by changing the end value) for ~500 or 600 ns
  3. set to the new value to start the actual playback of the signal. 

PlaybackOnlyExample3.py

10 Hz slope from +1 to -0.5 V, at a playback frequency of 6 MHz (166 ns period).

IMG_2395.thumb.jpg.0fe5f382ed4d731a7236c330c2051da0.jpg

Zoomed in to where the signal jumps from -0.5 V to +1 V and starts at the start of the downwards slope again:

IMG_2394.thumb.jpg.ec45a21fdec087c3f107b7a55c79b0b0.jpg

 

Any thoughts? 

 

Edited by Meindert Norg
Link to comment
Share on other sites

  • 0

Attila, 

I indeed measure about 30 ns of 'drift' that you contribute to fetching data from RAM. However, I don't seem to be able to eliminate that. 

Can you please educate me on how to configure what you call 'finite run with repeat' vs 'continuous run'? 

I interpret 'finite run with repeat' to be set with:

WaveFormLib.FDwfAnalogOutEnableSet(hdwf, channel, 1) 
WaveFormLib.FDwfAnalogOutFunctionSet(hdwf, channel, dwfc.funcPlayPattern)
WaveFormLib.FDwfAnalogOutFrequencySet(hdwf, channel, ctypes.c_double(hzRate))
WaveFormLib.FDwfAnalogOutAmplitudeSet(hdwf, channel, ctypes.c_double(ampOutVoltageRange))
WaveFormLib.FDwfAnalogOutRepeatSet(hdwf, channel, ctypes.c_double(0))
# WaveFormLib.FDwfAnalogOutRunSet(hdwf, channel, ctypes.c_double(0))
WaveFormLib.FDwfAnalogOutDataSet(hdwf, channel, rgdPlay, nrSamples)
WaveFormLib.FDwfAnalogOutConfigure(hdwf, channel, 1)

and 'continuous run' to be set with

WaveFormLib.FDwfAnalogOutRunSet(hdwf, channel, ctypes.c_double(0))WaveFormLib.FDwfAnalogOutEnableSet(hdwf, channel, 1) 
WaveFormLib.FDwfAnalogOutFunctionSet(hdwf, channel, dwfc.funcPlayPattern)
WaveFormLib.FDwfAnalogOutFrequencySet(hdwf, channel, ctypes.c_double(hzRate))
WaveFormLib.FDwfAnalogOutAmplitudeSet(hdwf, channel, ctypes.c_double(ampOutVoltageRange))
# WaveFormLib.FDwfAnalogOutRepeatSet(hdwf, channel, ctypes.c_double(0))
WaveFormLib.FDwfAnalogOutRunSet(hdwf, channel, ctypes.c_double(0))
WaveFormLib.FDwfAnalogOutDataSet(hdwf, channel, rgdPlay, nrSamples)
WaveFormLib.FDwfAnalogOutConfigure(hdwf, channel, 1)

but they both give the same 30ns per record drift. 

The way I measure this: 

  1. Generate 100 kHz signal with external signal generator, view on ch1 of benchtop o'scope and connect to AD pro input 1
  2. Connect AD Pro output 2 to ch2 or benchtop o'scope
  3. Run RecordOnlyExample.py (generates .pkl file with recorded data)
  4. Run PlaybackOnlyExample (plays back data from PlaybackOnlyExample.pyRecordOnlyExample.py.pkl file)
  5. Watch the 2 signals on the o'scope drift w.r.t. each other.
  6. Count the time for 1 period drift (~33 sec).
    1. 33 sec for at a record length of 100 ms = 330 'drift events'
    2. 1 period of 100 kHz signal == 10 usec
    3. 10 usec / 330 events = 30 ns. 

Thank you for your input.

Link to comment
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
×
×
  • Create New...