## How to obtain the desired frequency for the AWG

fabianmicallef
Newbie
Posts: 0
Joined: Tue Nov 12, 2013 5:49 pm

### How to obtain the desired frequency for the AWG

I am attempting to set up the AWG on my PS2204 using the function: ps2000_set_sig_gen_arbitrary
I do not need any sweeping of the frequency so the value of startdeltaphase and stopdeltaphase must be equal, and the value for deltaphaseincrement and dwelltime must both be 0, am I correct?

Having said that I am finding it cannot manage to calculate of the deltaphase necessary to abtain my desired frequency. I am using the equation as instructed:
outputFrequency = dacFrequency × ( d e l ta P h a s e /phaseAccumulatorSize)× (awgBufferSize/arbitraryWaveformSize)

With the value for the constants given in the documentation:
phaseAccumulatorSize 2^32
awgBufferSize 4096
dacFrequency 2 MHz

Is it possible that these constants are not correct for my model?
I am sure that in my arbitrary waveform file I have a single oscillation and therefore that is certainly not the source of the error.
I am obtaining a frequency 25 times larger than it should be.

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

### Re: How to obtain the desired frequency for the AWG

Hi Fabian,

There was an error found in the delta phase calculation in the Programmer's Guide. You need to use the DDS Frequency of 48MHz (not DAC Frequency of 2MHz). A new version of the Programmer's Guide will be released in the future.

Below is the information that you need:
Updated formula for frequency calculation
The formula for delta phase should be:

Code: Select all

``delta = ((frequency * waveformSize) / awgBufferSize) * AWG_PHASE_ACCUMULATOR * (1/AWG_DDS_FREQUENCY);``
where

AWG_PHASE_ACCUMULATOR = 2^32
awgBufferSize = 4096
AWG_DDS_FREQUENCY = 48 MHz

I hope this helps.
Hitesh

Software Dev. Engineer