Test and Measurement Forum

How to obtain the desired frequency for the AWG

Post your MATLAB discussions here

How to obtain the desired frequency for the AWG

Postby fabianmicallef » Mon Nov 25, 2013 4:59 pm

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.
Posts: 0
Joined: Tue Nov 12, 2013 5:49 pm

Re: How to obtain the desired frequency for the AWG

Postby Hitesh » Tue Nov 26, 2013 2:32 pm

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);


awgBufferSize = 4096

I hope this helps.

Technical Support Engineer
Site Admin
Site Admin
Posts: 2359
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests