Now I have a picoscope 4425A device, I copied the code by following the python example of github and want to run block mode.
As the equation of sampling rate in picoscope-4000-series-a-api-programmers-guide.pdf,
Sampling frequency (fS) = 80 MHz / (timebase+1),
I want to set frequency as 20000Hz, so timebase is 3999, am I right?
But if I give 100Hz input audio and capture 200 samples by 20000Hz sampling rate, the waveform of these 200 samples is not a full cycle.
Is there something wrong with my code?
What a coincidence. I have stumble over a very similar problem today!
I have a Picoscope5203 which I use in an automated measurement setup.
Today, I have noticed an inconsistency of the sampling rates set in ps5000RunBlock via the timebase variable.
My box can do up to 1Gsps and rates of 1Gsps/2^n.
Down to 62,5Msps=1Gsps/16 all is well. But if I attemt to sample at half that rate, i.e. 31,25Msps=1Gsps/32 that's not what I get. Looking at the sampled stream I see that my signal is sampled with around 41,7Msps=1Gsps/24 instead of 31,25Msps, which is drastically off! HOW COME?
The other slower sample rates appear to be off, too.
Is there a list of the real sample rates available?
@Martyn
Hi Martyn,
Could you please help me to comfirm the timebase value?
if use 20000Hz sampling frequency, What the value of the timebase should be? by using picoscope 4425A.
Or I need to adjust some parameters else?
You are correct a timebase of 3999 should give a sampling speed of 20000Samples/sec for a 4425A
I am not in the office and don't have that device to hand so can't check. I would suggest trying to set this up in PicoScope 7 and see what you get, the rule of thumb is that if it works in PicoScope then it should work in your own application.
For the 5203 I would suggest using the ps5000GetTimebase call and see what is returned for the sample interval.
You are correct a timebase of 3999 should give a sampling speed of 20000Samples/sec for a 4425A
I am not in the office and don't have that device to hand so can't check. I would suggest trying to set this up in PicoScope 7 and see what you get, the rule of thumb is that if it works in PicoScope then it should work in your own application.
For the 5203 I would suggest using the ps5000GetTimebase call and see what is returned for the sample interval.
Thanks for your description.
On normal case, if I give 100 Hz input audio and then capture 200 samples when timebase is 3999(sampling rate is 20000Hz), I would get a full sine waveform of 100Hz if plot the samples, right?
But I got not a full sine waveform of 100Hz as I attached waveform.
Is something wrong in my code? or I need to adjust something eles?
It is different with acquisition device of other brand.
I used NI device to capture 200 samples with 20000Hz sampling rate and plotted the samples, it was a full sine waveform.I have attached the waveform.
By the way, I tried streaming mode and set
sampleInterval = ctypes.c_int32(50) #50 us
sampleUnits = ps.PS4000A_TIME_UNITS['PS4000A_US'] # unis is us
It got correct sine waveform.