Hi,
My aim is to get a waveform sampled at 7.8125 MHz using the oversampling feature in order to enhance vertical resolution.
Therefore, I tried to set the sampling frequency to 125 MHz, and use oversample=16.
I connected channel A to a 120 kHz sinusoidal waveform generator. We have a picoscope ps4227.
However, the code copied below does not work.
-When I try with oversample=1, everything works fine: the period of the digitized signal in outputvaluesA that I measure manually, by visualizing the waveform, is what is expected (i.e. 1e9/120e3/interval samples)
-With oversample=16:
-The values returned by getTimebase are as expected (interval=1.0e9f/fs, and maxsample is divided by 16 compared to oversample=1)
-The period of the digitized signal in outputvaluesA that I measure manually is 1e9/120e3/(interval/16) samples (the same number of sample as with oversample=1), and not 1e9/120e3/interval, as expected
- The vertical resolution is not enhanced (still 12 bits)
Therefore, it appears that oversample=16 acts as expected for the function GetTimebase, however for the function RunBlock oversample=16 gives exactly the same data as what would have been obtained with oversample=1.
Is something missing or wrong in the code? Does our picoscope have ths oversampling feature?
Also, we noticed that in the last version of the SDK (10.5.019), the functions ps4000SetSimpleTrigger and ps4000IsReady are missing from the .lib file (an error is sent by the linker). We worked this around by using the 3 other trigger functions and the callback for RunBlock, it works fine but it is less convenient.
Hi Hitesh,
Thank you for your reply.
The 1e9 is to convert ns to s, assuming we use the "interval" value returned by ps4000GetTimebase (timeIntervalNanoseconds parameter). Therefore the expected number of samples per sine period is 1/f_waveform/(interval in s) or 1e9/f_waveform/(interval in ns), or as you wrote, f_sampling/f_waveform.
Therefore, as you say, with the test conditions described in my initial post, the expected number of samples per sine period is 1041 samples with oversampling=1 and 65 with oversampling=16.
My initial post may be a little confusing... If I try to summarize my problem, it appeared that the waveform data obtained using ps4000RunBlock followed by ps4000GetValues was not affected by the value of the oversample parameter of ps4000RunBlock (which always seemed to behave as if oversample=1).
Thank you for your help,
Guillaume.
I've had some clarification. It appears that the PicoScope 4227 does not support oversampling as it makes use of downsampling.
You can use the averaging functionality provided by using downsampling. You will need to use the function ps4000SetDataBufferWithMode and use the RATIO_MODE_AVERAGE enumeration. Ensure that the oversample value is set back to 1.