Jump to content
Fourth of July -- Digilent US offices closed ×
  • 0

Changing delay when using trigsrcAnalogOut1


Carl Troili

Question

Hi,

 

I have modified the Analogin_Trigger demo script. ( Thanks for all the demo scripts by the way )

I have changed it to sample 16 bit and using trigsrcAnalogOut1 as trig and using a triangle instead of sinus as a signal.

I want each acquisition to start with the triangle at the lowest.

I am able to achieve that for a specific sample rate and frequency of the triangle wave by adding a delay using

dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(sampling_delay))

I have a fixed number of samples and I adjust the sample rate to get one triangle wave whatever the frequency of triangle is.

sampling_freq=nSamples*triangle_freq

For a frequency of the triangle from 1 k to 4 k I get the same delay of 2014 samples but then when I increase the frequency to 5k it changes to 1600 samples and then stays at that for 6k and 7k and so on.

How to predict how big the delay should be ?

 

Regards

Carl Troili

 

 

AnalogIn_Trigger_Int16_Send.py

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @Carl Troili

sampling_delay = round(0.5*nSamples/sampling_freq + 0.75/triangle_freq)
T0 is relative to the middle of the buffer so '0.5*nSamples/sampling_freq' to bring it to the first sample.
Shift the capture further to have the lowest point of triangle, which is at 270* or 75%, by 0.75/triangle_freq
(or -0.25/triangle_freq)

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