Frequency Measurement with DLL. PS2205A

Post general discussions on using our drivers to write your own software here
Post Reply
rcrodriguez
Newbie
Posts: 0
Joined: Fri Aug 19, 2016 9:41 pm

Frequency Measurement with DLL. PS2205A

Post by rcrodriguez » Tue Sep 06, 2016 6:03 pm

Hello, I'm using the Picoscope 2205A. I'm trying to measure the frequency of a waveform using DLL functions. I'm aware that there's no function dedicated to solely measuring frequency, but do you guys perhaps have any suggestions?

I was thinking of maybe using ps2000_run_streaming, and use the fact that I can specify the sampling time interval to measure the time difference between one V_peak to the next V_peak. The frequency would then be 1/(time difference).

Would this be the best method of measuring the frequency? I'd appreciate suggestions. Thanks.

Martyn
Site Admin
Site Admin
Posts: 3230
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Frequency Measurement with DLL. PS2205A

Post by Martyn » Thu Sep 08, 2016 6:56 am

That would be an acceptable method but I would use the zero crossing points, rather than the peaks.
Martyn
Technical Support Manager

TimOster
Advanced User
Advanced User
Posts: 45
Joined: Mon Dec 01, 2014 5:36 pm

Re: Frequency Measurement with DLL. PS2205A

Post by TimOster » Thu Aug 02, 2018 4:17 pm

Why do you say that? The zero crossing might occur between measurements, just like a peak. How does the Pico software measure frequency? At the fastest sampling rate and highest freq don't you only have a dozen or so samples?

bennog
Advanced User
Advanced User
Posts: 106
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Frequency Measurement with DLL. PS2205A

Post by bennog » Thu Aug 02, 2018 4:56 pm

That is why you need to do it at zero crossing (with a hysteresis if possible) then you have exactly 1 crossing from + to - and 1 from - to +.
If you count the samples between 2 successive + to - crossings you can measure the freq.
If the wave is symmetrical you can measure the number of samples between every crossing and multiply this by 2.

Benno

Martyn
Site Admin
Site Admin
Posts: 3230
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Frequency Measurement with DLL. PS2205A

Post by Martyn » Fri Aug 03, 2018 6:52 am

It is more accurate to use zero crossing, and when I say zero crossing I mean the point at which the waveform is half way so taking account of any DC offset. If you only have a few samples making up the waveform you can use linear interpolation and get a reasonable indication of where the crossing occurs, even if it is between sample points. If you try to do this with samples around the peaks the results you get will be less precise.
Martyn
Technical Support Manager

TimOster
Advanced User
Advanced User
Posts: 45
Joined: Mon Dec 01, 2014 5:36 pm

Re: Frequency Measurement with DLL. PS2205A

Post by TimOster » Fri Aug 03, 2018 2:51 pm

OK, I was thinking too literally. Transition from a positive to a negative value, rather than hitting zero exactly. Makes sense now.

Post Reply