## Capturing Correct Number of Cycles with PicoScope 5444D

Post your MATLAB discussions here
cah00
Newbie
Posts: 0
Joined: Tue Apr 16, 2019 7:32 pm

### Capturing Correct Number of Cycles with PicoScope 5444D

I'm using the channels on the PicoScope 5444D to collect samples of an incoming signal. I'm using 8-bit block mode. The goal is to collect 100 samples/cycle of the incoming signal and to collect 100 total cycles of the incoming signal.

If I have 100 total cycles with 100 samples/cycle my numPostTriggerSamples should be equal to 100*100 = 10,000. This is what I set it to.

100 samples/cycle means the sample frequency needs to be 100 times faster than the incoming signal (2500 Hz). Thus the sample interval is 1/(100*2500Hz) = 4000 ns

According to the picoscope 5000 series a api programmers guide (pg. 22), for 8-bit resolution and a sampling interval greater than 8 ns, the equation for the timebase index is: (n-2)/(125,000,000)

4000 ns = (n-2)/125,000,000 --> n = 502 = timebase index

When I run the script I only receive approximately 40 total cycles. Not the 100 I expected. Through trial and error I discovered that setting my timebase index to 1255 gives me almost exactly 100 total cycles. Also, if I increase the frequency of the incoming signal, continue to use 8-bit resolution, and use the equation above my total number of cycles becomes progressively lower and lower.

The ultimate goal is to obtain 100 cycles/freq and 100 total cycles of several different incoming frequencies. I can't seem to figure out what is going wrong. I have attached a matlab test script as a text file for reference.
Attachments
Test_Script.txt

Hitesh
PICO STAFF
Posts: 2855
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

### Re: Capturing Correct Number of Cycles with PicoScope 5444D

Hi cah00,

Please try the following:

* Set the numPreTriggerSamples property to 0
* Call the ps5000aGetTimebase2 function once (refer to PS5000A_ID_Block_Example.m script included as part of the package) to confirm that the sampling interval is as expected for the timebase selected
* Set the autoTriggerMs property to 0 to wait indefinitely for a trigger event - the current time set is less than the time for the acquisition (40 ms)

Which version of picotech_ps5000a_generic.mdd are you using?

Regards,
Hitesh

Software Dev. Engineer