## Get the exact actual frequency of the AWG

tiaschaer
Newbie
Posts: 0
Joined: Tue Feb 26, 2019 5:34 pm

### Get the exact actual frequency of the AWG

Hi guys,
I have a PicoScope 4824 and need some help regarding the frequency of the AWG.

The frequency of the AWG can be set with the following code

Code: Select all

``````set(PicoDevice.Signalgenerator(1), 'startFrequency', setFreqHz);
set(PicoDevice.Signalgenerator(1), 'stopFrequency', setFreqHz);
``````
where setFreqHz is a MATLAB double defining the frequency in Hz.

Since the AWG frequency resolution is < 20mHz (see device specs), the set value setFreqHz is rounded to the nearest available frequency, which I call "actual frequency". Since I am working with frequencies in the range of 1Hz - 10Hz, 20mHz represents a non-negligible difference from the desired set frequency.

My simple question is now: How do I get the AWG actual frequency in MATLAB?

Thank you a lot for your help!

tiaschaer
Newbie
Posts: 0
Joined: Tue Feb 26, 2019 5:34 pm

### Re: Get the exact actual frequency of the AWG

Hi guys,
Nobody can help?
Thanks,
Mattia

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

### Re: Get the exact actual frequency of the AWG

Hi Mattia,

Sorry for the delay in someone responding to you.

The MATLAB Instrument Driver unfortunately does not report back the actual frequency being output (there isn't a function to do this in the shared library).

However, it should be possible to calculate this using the formula in the delta phase in the Programmer's Guide (see section 4.57.2 Calculating deltaPhase).

Please note that there is a freq2delta() function in the PicoScope Support Toolbox that you can use to calculate this. The delta phase is an integer value that you can then use to calculate the actual frequency. Try rounding the delta phase down to the nearest integer integer and calculate the frequency. You can then try capturing an output of your signal from the AWG, calculate the frequency and compare it against the first calculation.

Hope this helps,
Hitesh

Software Dev. Engineer