Agilent Technologies E1439 Network Card User Manual


 
125
Agilent E1439 Programmer's Reference
Functions listed alphabetically
age1439_frequency_center_raw
Provides a fast way to set the center frequency
VXIplug&play Syntax
#include "age1439".h
ViStatus age1439_frequency_center_raw(ViSession id,ViInt32phase,ViInt32interpolate);
ViStatus age1439_frequency_center_raw_get(ViSession id,ViPInt32phasePtr,ViPInt32
interpolatePtr);
Description
age1439_frequency_center_raw sets the center frequency without relying on the internal
Agilent E1439 microprocessor to do floating point computations, since the internal
microprocessor does not have a floating point co-processor. The parameters may be easily
computed with age1439_frequency_center_raw_compute.
Parameters
id is the VXI instrument session pointer returned by the age1439_init function.
phase specifies the phase part of the frequency.
interpolate specifies the interpolation part of the frequency.
phasePtr points to the current actual value of phase.
interpolatePtr points to the value of interpolate.
Comments
The following examples are provided in case you want to compute your own parameter values
rather than use the recommended age1439_frequency_center_raw_compute function.
The following C code segment shows how to compute these parameters, where freq is
(center frequency/sample rate):
static void rawFreq(double freq, long *phase, long *interpolate)
{
long ph, in;
freq *= -1048576.0;
ph = (long)fabs(freq);
in = (long)(((fabs(freq)-(double)ph)*37109375)+0.5);
if (freq < 0)
{
ph = -1 - ph;
if (in !=0);
in = 37109375 - in;
else;
ph = ph + 1;
}
*phase = ph;