The G35DDC API SDK is implemented as a dynamic library (libg35ddcapi.so) for 32-bit i386 and 64-bit x86_64 platforms. It provides object-oriented and non-object-oriented interfaces to control a set of G35DDC devices in coherent mode. This document describes the object-oriented interface. The libg35ddcapi.so library exports several functions which makes it possible to control G35DDC receivers in coherent mode.
The API is not fully thread-safe so preferably it should be used in single-threaded applications. It can be used in multi-threaded applications as well, but with some care: One set of G35DDC receivers can be controlled from a single user thread only.
A C/C++ header file g35ddcapi.h is a part of the SDK.
The 'G35DDC device set' in coherent mode can consist of up to 8 interconnected G35DDC devices. DDC1 signals from all the G35DDC devices in such set are phase-coherent. All other provided signals (IF, DDC2 and audio) are not phase-coherent. Only one processing channel per device is available in coherent mode.
The libg35ddcapi.so library can be loaded to the application using the dlopen function of dynamic linking loader (link with -ldl). After the library is loaded, it is necessary to get addresses of exported functions.
When the API is no longer required in the memory, the dlclose function can be used to unload the API. Before the dlclose is called, all the the objects created using the CreateInstance function must be freed releasing their interfaces using the Release method, otherwise the application can enter an unpredictable state.
The following source code shows how to load the API.
#include <stdio.h> #include <dlfcn.h> #include "g35ddcapi.h" G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; int main(void) { //Loading the API API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving address of the CreateInstance function CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); //Here place code that uses the API dlclose(API); } else { //If the dlopen fails printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } return 0; }
To enumerate available G35DDC device sets the API provides an enumeration object. The object has to be created using the CreateInstance function. The following source code in C++ produces a list of device serial numbers for the available G35DDC device sets:
#include <stdio.h> #include <dlfcn.h> #include <errno.h> #include "g35ddcapi.h" int main(void) { G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; ICohG35DDCDeviceSetEnumerator *Enumerator=NULL; G35DDC_DEVICE_INFO *DevInfo; uint32_t Count; uint32_t SetCount,i,j; API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); if(CreateInstance(G35DDC_CLASS_ID_COH_DEVICE_SET_ENUMERATOR,(void**)&Enumerator)) { Enumerator->Enumerate(); SetCount=Enumerator->GetDeviceSetCount(); if(SetCount!=0) { printf("Available G35DDC device set count=%d:\n",SetCount); for(i=0;i<Count;i++) { printf("Device set %u:\n",i); //retrieve number of devices in the device set Count=0; Enumerator->GetDeviceSetInfo(i,NULL,&Count); printf("\tNumber of devices in the set: %u\n",Count); DevInfo=new G35DDC_DEVICE_INFO[Count]; Enumerator->GetDeviceSetInfo(i,DevInfo,&Count); for(j=0;j<Count;j++) { printf("\t\t%u: SN: %s\n",j,DevInfo[j].SerialNumber); } delete[] DevInfo; } } else { printf("No available G35DDC device set found.\n"); } Enumerator->Release(); } else { printf("Failed to create enumerator object. Error code=%d\n",errno); } dlclose(API); } else { printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } printf("Press enter to exit\n"); getchar(); return 0; }
G35DDC device set has to be open before it can be controlled. The API provides an object to open and control the device set of interconnected G35DDC devices in coherent mode. This object has to be created using the CreateInstance function.
The following source code shows how to open the first available G35DDC device set.
#include <stdio.h> #include <dlfcn.h> #include <errno.h> #include "g35ddcapi.h" int main(void) { G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; ICohG35DDCDeviceSet *DeviceSet; //Loading the API API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving address of the CreateInstance API functions CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); //Creating instance of the device object if(CreateInstance(G35DDC_CLASS_ID_COH_DEVICE_SET,(void**)&DeviceSet)) { //Opening the first available G35DDC device set using predefined G35DDC_OPEN_FIRST_SET constant if(DeviceSet->Open(G35DDC_OPEN_FIRST_SET,0)) { //Here place code that works with the open G35DDC device set //Closing device set DeviceSet->Close(); } else { printf("Failed to open device set. Error code=%d\n",errno); } //Release interface of device object DeviceSet->Release(); } else { printf("Failed to create device set object. Error code=%d\n",errno); } dlclose(API); } else { //If the dlopen fails printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } return 0; }The following code demonstrates another way to open the first available G35DDC device set using device set enumerator.
#include <stdio.h> #include <dlfcn.h> #include <errno.h> #include "g35ddcapi.h" int main(void) { G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; ICohG35DDCDeviceSetEnumerator *Enumerator=NULL; G35DDC_DEVICE_INFO *DevInfo; uint32_t Count; uint32_t SetCount; ICohG35DDCDeviceSet *DeviceSet; API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); if(CreateInstance(G35DDC_CLASS_ID_COH_DEVICE_SET_ENUMERATOR,(void**)&Enumerator)) { Enumerator->Enumerate(); SetCount=Enumerator->GetDeviceSetCount(); if(SetCount!=0) { printf("Available G35DDC device set count=%d:\n",SetCount); //retrieve number of devices in the first device set Count=0; Enumerator->GetDeviceSetInfo(0,NULL,&Count); DevInfo=new G35DDC_DEVICE_INFO[Count]; Enumerator->GetDeviceSetInfo(0,DevInfo,&Count); CreateInstance(G35DDC_CLASS_ID_COH_DEVICE_SET,(void**)&DeviceSet); if(DeviceSet->Open(DevInfo,Count)) { //Here place code that works with the open G35DDC device set //Closing device set DeviceSet->Close(); } else { printf("Failed to open device set. Error code=%d\n",errno); } DeviceSet->Release(); delete[] DevInfo; } else { printf("No available G35DDC device set found.\n"); } Enumerator->Release(); } else { printf("Failed to create enumerator object. Error code=%d\n",errno); } dlclose(API); } else { printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } printf("Press enter to exit\n"); getchar(); return 0; }
Creates single object of the specified class and returns interface of the object.
C/C++ declaration
int CreateInstance(uint32_t ClassId,void **Interface);
Address retrieval
G35DDCAPI_CREATE_INSTANCE CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(hAPI,"CreateInstance");
Parameters
ClassId[in] Specifies class identifier of the object to be created. This parameter must be one of the following:
Value Meaning G35DDC_CLASS_ID_COH_DEVICE_SET_ENUMERATOR Class identifier of the enumerator object. When the function finished successfully, ICohG35DDCDeviceSetEnumerator interface is stored to a pointer variable pointed to by the Interface parameter. G35DDC_CLASS_ID_COH_DEVICE_SET Class identifier of the device set object. When the function finished successfully, ICohG35DDCDeviceSet interface is stored to pointer variable pointed to by the Interface parameter. Interface[out] Pointer to a variable that receives interface to newly created object of specified class. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
All the objects created using CreateInstance must be freed, releasing their interfaces using the Release method before the API is unloaded using the FreeLibrary function.
The CreateInstance function can be called in any user-thread. Returned interface can be used only in the same thread in which its object was created, otherwise the application can enter an unpredictable state.
ICohG35DDCDeviceSetEnumerator interface is the interface of the enumerator object that is created using the CreateInstance function which provides an enumeration mechanism of available G35DDC devices sets.
Increases the reference count to the enumerator object.
C/C++ declaration
uint32_t AddRef(void);
Parameters
None
Return value
The method returns resulting reference count.
Remarks
Initial reference count of an object created using the CreateInstance function is 1.
Decrements the reference count of the object. When the reference count reaches zero, the object and all the resources allocated by them are freed and the interface is no longer usable.
C/C++ declaration
uint32_t Release(void);
Parameters
None
Return value
The method returns the resulting reference count. If the return value is zero, the object was freed.
Performs enumeration of available G35DDC devices sets in coherent mode.
C/C++ declaration
int Enumerate(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the number of available G35DDC device sets enumerated using the ICohG35DDCDeviceSetEnumerator::Enumerate method.
C/C++ declaration
uint32_t GetDeviceSetCount(void);
Parameters
None
Return value
The method returns the number of available G35DDC device sets.
Retrieves information about the available G35DDC device set.
C/C++ declaration
int GetDeviceSetInfo(uint32_t SetIndex,G35DDC_DEVICE_INFO *DeviceInfos,uint32_t *DeviceInfosCount);
Parameters
SetIndex[in] Specifies index of the device set. It can vary from zero to 'one less' than the value returned by the ICohG35DDCDeviceSetEnumerator::GetDeviceSetCount method.DeviceInfos[out] Pointer to array of G35DDC_DEVICE_INFO structures to be filled with information about the device set.Order of the device infos in the array corresponds to hardware interconnect of physical G35DDC devices.DeviceInfosCount[in, out] Pointer to a variable that specifies size of the array (number of items in the array) pointed to by the DeviceInfos parameter. When the method returns, this variable contains the number of items copied to DeviceInfos.If the array specified by DeviceInfos parameter is not large enough to hold information about all the devices in the device set, the method fails (errno is set to ENOMEM) and stores the required array size (number of items) in the variable pointed to by the DeviceInfosCount parameter.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
ICohG35DDCDeviceSet interface is an interface of the device set object that is created using the CreateInstance function. This interface allows to control of the selected G35DDC device set in coherent mode.
Increases the reference count to the device set object.
C/C++ declaration
uint32_t AddRef(void);
Parameters
None
Return value
The method returns resulting reference count.
Remarks
Initial reference count of an object created using the CreateInstance function is 1.
Decrements the reference count of the object. When the reference count reaches zero, the object and all the resources allocated by them are freed and the interface is no longer usable.
C/C++ declaration
uint32_t Release(void);
Parameters
None
Return value
The method returns resulting reference count. If the return value is zero, the object was freed.
Opens all the G35DDC devices in the device set and associates them with the device set object given by its interface pointer.
C/C++ declaration
int Open(G35DDC_DEVICE_INFO *DeviceInfos,uint32_t Count);
Parameters
DeviceInfos[in] Pointer to array of G35DDC_DEVICE_INFO structures which contains information about all the devices in the device set to be opened. The number of items in the array is given by the Count parameter. The order of device info structures in the array has to correspond to hardware interconnect of the G35DDC devices. Array of device info structures and its size can be obtained using the ICohG35DDCDeviceSetEnumerator. The example above shows how to achieve this.
It is possible to use one of the following predefined values instead of a pointer to the array:
Value Meaning G35DDC_OPEN_FIRST_SET This method opens the first available G35DDC device set. The Count parameter is ignored, the number of interconnected devices is determined automatically. G35DDC_OPEN_DEMO_SET This method opens a demo G35DDC device set. This allows developers to work with the API without physical G35DDC devices. The Count parameter specifies the number of demo receivers in the set and it can vary from 1 to 8. Count[in] Specifies the number of items in the array pointed to by the DeviceInfos parameter.
Return value
If the method succeeds, the return value non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The order of devices in the device set corresponds to the hardware interconnection of the G35DDC devices. Each individual device in the device set has its own constant index which does not change while the hardware G35DDC device interconnect remains the same. This index is used in some methods of device set object to access specific device of the device set. Index of the first device is 0, index of the second device is 1, etc..
Closes currently open G35DDC device set and all the devices of this set associated with the device set object; and makes the object available for use with another G35DDC device set.
C/C++ declaration
void Close(void);
Parameters
None
Return value
None
Remarks
If no 'open' G35DDC device set is associated with the object, the Close method does nothing.
Checks if a device set is associated with the device set object.
C/C++ declaration
int IsOpen(void);
Parameters
None
Return value
This method returns a non-zero value if a device set is associated with the device set object (using the ICohG35DDCDeviceSet::Open method) and it can be controlled using methods of the device set object interface.
The method returns zero if no device set is associated with the device set object.
Checks if all the devices in the device set are still connected to the computer.
C/C++ declaration
int IsConnected(void);
Parameters
None
Return value
This method returns a non-zero value if all the devices in the set are still connected.
If a device is disconnected or the method fails, the return value is zero. To determine if the method failed, check errno. The errno is set to zero if a device of the device set is disconnected or another error code if IsConnected failed.
Remarks
If any device from the set is determined as disconnected, the device set is no longer usable and should be closed using the ICohG35DDCDeviceSet::Close method.
Retrieves the number of G35DDC devices in the device set.
C/C++ declaration
int GetDeviceCount(uint32_t *Count);
Parameters
Count[out] Pointer to a variable that receives the number of G35DDC devices in the device set. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves information about a single G35DDC device from the device set.
C/C++ declaration
int GetDeviceInfo(uint32_t DeviceIndex,G35DDC_DEVICE_INFO *Info);
Parameters
DeviceIndex[in] Specifies index of device in the device set. It can vary from zero to 'one less than the number of devices' in the device set. Order of the devices corresponds to the hardware interconnection of physical G35DDC devices.Info[out] Pointer to a G35DDC_DEVICE_INFO structure to be filled with information about the device. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDeviceCount method to determine the number of devices in the device set.
Retrieves information about all the G35DDC devices in the device set at once.
C/C++ declaration
int GetDeviceInfos(G35DDC_DEVICE_INFO *Infos,uint32_t *InfoCount);
Parameters
Infos[out] Pointer to array of G35DDC_DEVICE_INFO structures to be filled with information about device in the device set.Order of the device infos in the array corresponds to hardware interconnection of physical G35DDC devices.InfoCount[in, out] Pointer to a variable that specifies the size of the array (number of items in the array) pointed to by the Infos parameter. When the method returns, this variable contains the number of items copied to Infos.If the array specified by Infos parameter is not large enough to hold information about all the devices in the device set, the method fails (errno is se to ENOMEM) and stores the required array size (number of items) in the variable pointed to by the InfoCount parameter.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDeviceCount method to determine number of devices in the device set.
Turns on or off all the G35DDC devices in the device set.
C/C++ declaration
int SetPower(int Power);
Parameters
Power[in] Specifies whether to turn on or off the devices. If this parameter is non-zero all the device in the device set are turned on, if it is zero then all the devices are turned off.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If ICohG35DDCDeviceSet::SetPower turns the devices off, all the running streams are stopped.
Use the ICohG35DDCDeviceSet::GetPower method to determine the current power state of devices in the device set.
The GetPower method determines whether the devices are turned on or off.
C/C++ declaration
int GetPower(int *Power);
Parameters
Power[out] Pointer to a variable that receives current power state of the device set. If it is non-zero, the devices are turned on. If it is zero the devices are turned off. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the input attenuator.
C/C++ declaration
int SetAttenuator(uint32_t Attenuator);
Parameters
Attenuator[in] Value that specifies attenuation level in dB. Possible values are: 0, 3, 6, 9, 12, 15, 18, 21. If the value is not from the list, the ICohG35DDCDeviceSet::SetAttenuator method rounds the value to the nearest lower one.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetAttenuator method to determine the current setting of the attenuator.
Retrieves the current setting of the attenuator.
C/C++ declaration
int GetAttenuator(uint32_t *Attenuator);
Parameters
Attenuator[out] Pointer to a variable that receives the current attenuation level. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Controls the band pass filter at RF input.
C/C++ declaration
int SetPreselectors(uint32_t Low,uint32_t High);
Parameters
Low[in] Specifies the cut-off low frequency of the filter in Hz. Possible values are: 0, 850000, 2400000, 5400000, 11800000. If the value is not from the list, the method rounds it to the nearest one.High[in] Specifies the cut-off high frequency of the filter in Hz. Possible values are: 3100000, 5400000, 11800000, 23300000, 50000000. If the value is not from the list, the method rounds it to the nearest one.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Value of the Low parameter must not be higher than value of the High parameter, otherwise the method fails.
Use the ICohG35DDCDeviceSet::GetPreselectors method to determine the current setting of the preselectors.
Retrieves the current setting of the RF input band pass filter.
C/C++ declaration
int GetPreselectors(uint32_t *Low,uint32_t *High);
Parameters
Low[out] Pointer to a variable that receives the current cut-off low frequency of the filter in Hz. This parameter can be NULL if the application does not require this information.High[out] Pointer to a variable that receives the current cut-off high frequency of the filter in Hz. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the RF input preamplifier.
C/C++ declaration
int SetPreamp(int Preamp);
Parameters
Preamp[in] Specifies whether to enable or disable the RF preamplifier. If this parameter is non-zero, the preamplifier is enabled. If the parameter is zero, the preamplifier is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the ICohG35DDCDeviceSet::GetPreamp method to determine the current state of the preamplifier.
Retrieves the current state of the RF input preamplifier.
C/C++ declaration
int GetPreamp(int *Preamp);
Parameters
Preamp[out] Pointer to a variable that receives the current state of the preamplifier. The value is non-zero if the preamplifier is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the noise blanker on the ADC stream.
C/C++ declaration
int SetADCNoiseBlanker(int Enabled);
Parameters
Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, noise blanker is enabled. If the parameter is zero, noise blanker is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetADCNoiseBlanker method to determine the current state of the noise blanker.
Retrieves the current ADC noise blanker state.
C/C++ declaration
int GetADCNoiseBlanker(int *Enabled);
Parameters
Enabled[out] Pointer to a variable that receives the current state of the noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the ADC noise blanker threshold.
C/C++ declaration
int SetADCNoiseBlankerThreshold(uint16_t Threshold);
Parameters
Threshold[in] Specifies the maximum acceptable input signal. The maximum possible value of threshold is 32767, in this case the noise blanker has no effect even if it is enabled using the ICohG35DDCDeviceSet::SetADCNoiseBlanker method.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetADCNoiseBlankerThreshold method to retrieve the current threshold of the noise blanker.
Determines the ADC noise blanker threshold.
C/C++ declaration
int GetADCNoiseBlankerThreshold(uint16_t *Threshold);
Parameters
Threshold[out] Pointer to a variable that receives the threshold of ADC noise blanker. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts sending of IF snapshots from specific device of the device set.
C/C++ declaration
int StartIF(uint32_t DeviceIndex,uint16_t Period);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Period[in] Specifies the time interval in milliseconds for how often the IF snapshot is taken and sent to the ICohG35DDCDeviceSetCallback::CohG35DDC_IFCallback callback.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC device has to be turned on using the ICohG35DDCDeviceSet::SetPower method before use of ICohG35DDCDeviceSet::StartIF, otherwise the ICohG35DDCDeviceSet::StartIF method fails.
Stops sending of IF snapshots from specific device of the device set.
C/C++ declaration
int StopIF(uint32_t DeviceIndex,);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The ICohG35DDCDeviceSetCallback::CohG35DDC_IFCallback callback is not called after ICohG35DDCDeviceSet::StopIF returns.
Enables or disables frequency spectrum inversion.
C/C++ declaration
int SetInverted(int Inverted);
Parameters
Inverted[in] Specifies whether to enable or disable frequency spectrum inversion. If this parameter is non-zero, IF spectrum is inverted.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the current frequency spectrum inversion setting.
C/C++ declaration
int GetInverted(int *Inverted);
Parameters
Inverted[out] Pointer to a variable that receives a non-zero value if the frequency spectrum inversion is enabled, and zero if the inversion is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves information about DDC format.
C/C++ declaration
int GetDDCInfo(uint32_t DDCTypeIndex,G3XDDC_DDC_INFO *Info);
Parameters
DDCTypeIndex[in] Specifies index of DDC type. For more information, see remarks.Info[out] Pointer to a G3XDDC_DDC_INFO structure to be filled with information about DDC type.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDDC1Count method to determine the number of possible DDC types of DDC1. In this case the DDCTypeIndex parameter can vary from zero to 'one less' than the number determined by ICohG35DDCDeviceSet::GetDDC1Count.
Use the ICohG35DDCDeviceSet::GetDDC1 method to determine the current DDC type index of DDC1 and the ICohG35DDCDeviceSet::GetDDC2 method to determine current DDC type of DDC2.
Retrieves the number of DDC types supported by DDC1.
C/C++ declaration
int GetDDC1Count(uint32_t *Count);
Parameters
Count[out] Pointer to a variable that receives the number of DDC types supported by the DDC1. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets current DDC type of DDC1.
C/C++ declaration
int SetDDC1(uint32_t DDCTypeIndex);
Parameters
DDCTypeIndex[in] Specifies index of DDC type to be used in DDC1. It can vary from zero to 'one less than the number of DDC types' of the DDC1.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDDC1Count method to determine the number of possible DDC types of the DDC1. The DDCTypeIndex parameter can vary from zero to 'one less' than the number determined by ICohG35DDCDeviceSet::GetDDC1Count.
DDC1 streaming must not run when calling ICohG35DDCDeviceSet::SetDDC1. In other words, DDC1 streaming which is started using the ICohG35DDCDeviceSet::StartDDC1 method has to be stopped using the ICohG35DDCDeviceSet::StopDDC1 method before calling of ICohG35DDCDeviceSet::SetDDC1, otherwise ICohG35DDCDeviceSet::SetDDC1 fails. The ICohG35DDCDeviceSet::SetDDC1 method does not start and stop DDC1 streaming, just changes the DDC type of DDC1.
Calling of ICohG35DDCDeviceSet::SetDDC1 can change the current DDC type of DDC2 and current bandwidth of demodulator filter, so it is useful to call the ICohG35DDCDeviceSet::GetDDC2 and ICohG35DDCDeviceSet::GetDemodulatorFilterBandwidth methods immediately after ICohG35DDCDeviceSet::SetDDC1 to determine the current DDC type of DDC2 and current bandwidth of the demodulator filter.
Use the ICohG35DDCDeviceSet::GetDDC1 method to determine current DDC type of the DDC1.
Retrieves information about the current DDC type of the DDC1.
C/C++ declaration
int GetDDC1(uint32_t *DDCTypeIndex,G3XDDC_DDC_INFO *DDCInfo);
Parameters
DDCTypeIndex[out] Pointer to a variable that receives index of current DDC type of the DDC1. This parameter can be NULL if the application does not require this information.DDCInfo[out] Pointer to a G3XDDC_DDC_INFO structure to be filled with information about the current DDC type of the DDC1. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Returned DDCTypeIndex can be passed to the ICohG35DDCDeviceSet::GetDDCInfo method.
Sets DDC1 center frequency.
C/C++ declaration
int SetDDC1Frequency(uint32_t Frequency);
Parameters
Frequency[in] Specifies the new center frequency of DDC1 in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Changing of DDC1 frequency causes change of absolute frequency of the DDC2, and demodulator in each device in the set.
Use the ICohG35DDCDeviceSet::GetDDC1Frequency method to determine the current center frequency of DDC1.
Retrieves the current center frequency of DDC1.
C/C++ declaration
int GetDDC1Frequency(uint32_t *Frequency);
Parameters
Frequency[out] Pointer to a variable that receives the current center frequency of DDC1 in Hz. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the phase shift of the DDC1 signal for a specific device in the device set.
C/C++ declaration
int SetDDC1PhaseShift(uint32_t DeviceIndex,double PhaseShift);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.PhaseShift[in] Specifies the new phase shift of DDC1 signal in degrees at the current DDC1 center frequency. It can vary from -180 to +180 degrees.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
It can be used for compensation of 'small length differences' of cables used for the coherent clock or at receiver RF inputs.
Use the ICohG35DDCDeviceSet::GetDDC1PhaseShift method to retrieve the current phase shift of the DDC1 signal.
Retrieves the current phase shift of the DDC1 signal for the specific device in the device set.
C/C++ declaration
int GetDDC1PhaseShift(uint32_t DeviceIndex,double *PhaseShift);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.PhaseShift[out] Pointer to a variable that receives the current phase shift of the DDC1 signal in degrees. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts coherent DDC1 streaming on all the devices in the set simultaneously.
C/C++ declaration
int StartDDC1(uint32_t SamplesPerBuffer);
Parameters
SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the ICohG35DDCDeviceSetCallback::CohG35DDC_DDC1StreamCallback callback. If the current DDC1 type index (specified by the ICohG35DDCDeviceSet::SetDDC1 method) is less than or equal to 23 (DDC1 bandwidth <= 4 MHz) the value of the SamplesPerBuffer has to be a multiple of 64. If the current the DDC1 type index is greater than 23 (DDC1 bandwidth > 4 MHz), the SamplesPerBuffers has to be a multiple of 1024. If it is zero, the ICohG35DDCDeviceSet::StartDDC1 method fails.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC devices have to be turned on using the ICohG35DDCDeviceSet::SetPower method before ICohG35DDCDeviceSet::StartDDC1 is used. Otherwise ICohG35DDCDeviceSet::StartDDC1 fails.
If the DDC1 streaming is already running before use of ICohG35DDCDeviceSet::StartDDC1, ICohG35DDCDeviceSet::StartDDC1 restarts the streaming except it was previously started with the same SamplesPerBuffer parameter. In this case ICohG35DDCDeviceSet::StartDDC1 does nothing. Restart of DDC1 streaming stops DDC2 and audio streaming in each device in the set. ICohG35DDCDeviceSet::StartDDC1 does not restart DDC2 and audio streaming.
Use the ICohG35DDCDeviceSet::StopDDC1 method to stop DDC1 streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops DDC1 streaming on all the devices of the device set.
C/C++ declaration
int StopDDC1(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The ICohG35DDCDeviceSet::StopDDC1 method stops all the streaming beyond the DDC1 in the processing chain (DDC2 and audio streaming in all the devices in the set).
The ICohG35DDCDeviceSetCallback::CohG35DDC_DDC1StreamCallback callback is not called after ICohG35DDCDeviceSet::StopDDC1 returns.
Retrieves information about current DDC type of the DDC2.
C/C++ declaration
int GetDDC2(uint32_t *DDCTypeIndex,G3XDDC_DDC_INFO *DDCInfo);
Parameters
DDCTypeIndex[out] Pointer to a variable that receives an index of the current DDC type of the DDC2. This parameter can be NULL if the application does not require this information.DDCInfo[out] Pointer to a G3XDDC_DDC_INFO structure to be filled with information about the current DDC type of the DDC2. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
DDC type of DDC2 in each device is the same and depends upon DDC type of DDC1, it cannot be changed by the application directly. The DDC type of DDC2 is equal to the DDC type of DDC1 if DDC type index of DDC1 is less than or equal to 5 (sample rate: 80 kHz, bandwidth: 64 kHz, bits per sample: 32). If the DDC type index of DDC1 is above 5, the DDC type index of DDC2 is always 5. Changing of DDC type of DDC1 can cause a change of DDC type of DDC2, so it is useful to call ICohG35DDCDeviceSet::GetDDC2 immediately after the ICohG35DDCDeviceSet::SetDDC1 method to determine the current DDC type of DDC2 - if the application needs to know parameters of DDC2.
The BitsPerSample member of the G3XDDC_DDC_INFO structure is not used and it can be ignored for DDC2. I and Q samples in buffers passed to the ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2StreamCallback and ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2PreprocessedStreamCallback DDC2 callbacks are always in IEEE float (32 bit, little endian) format.
Returned DDCTypeIndex can be passed to the ICohG35DDCDeviceSet::GetDDCInfo method.
Sets the relative center frequency of DDC2 for the specified device of the device set.
C/C++ declaration
int SetDDC2Frequency(uint32_t DeviceIndex,int32_t Frequency);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Frequency[in] Specifies the new center frequency of DDC2 in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The value of the Frequency parameter is center frequency of the DDC2 relative to center of the DDC1. The value can be negative.
The absolute frequency of the DDC2 is given by the following formula:
faDDC2 = fDDC1 + frDDC2
Where faDDC2 is the absolute center frequency of DDC2, fDDC1 is the center frequency of the DDC1 in Hz (set using the ICohG35DDCDeviceSet::SetDDC1Frequency method) and frDDC2 is the relative center frequency of DDC2 in Hz (set using ICohG35DDCDeviceSet::SetDDC2Frequency).
Changing of DDC2 'relative frequency' changes the 'absolute frequency' of the DDC2 and demodulator of specified device.
Use the ICohG35DDCDeviceSet::GetDDC2Frequency method to determine the current relative center frequency of the DDC2.
The following example shows three methods of how it is possible to set the absolute DDC2 center frequency of the first device (DeviceIndex = 0) to 11.01 MHz:
ICohG35DDCDeviceSet *DeviceSet; //Interface of the G35DDC device set object, created using CreateInstance function //1. method DeviceSet->SetDDC1Frequency(11010000); DeviceSet->SetDDC2Frequency(0,0); //2. method, it can be used if bandwidth of DDC2 is less than bandwidth of DDC1 DeviceSet->SetDDC1Frequency(11000000); DeviceSet->SetDDC2Frequency(0,10000); //3. method, it can be used if bandwidth of DDC2 is less than bandwidth of DDC1 DeviceSet->SetDDC1Frequency(11020000); DeviceSet->SetDDC2Frequency(0,-10000);
Retrieves the current relative DDC2 center frequency of the specified device in the device set.
C/C++ declaration
int GetDDC2Frequency(uint32_t DeviceIndex,int32_t *Frequency);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Frequency[out] Pointer to a variable that receives the current relative center frequency of DDC2 in Hz. The returned value can be negative. See remarks of the ICohG35DDCDeviceSet::SetDDC2Frequency for information how to calculate the absolute center frequency of DDC2. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts DDC2 streaming on the specified device.
C/C++ declaration
int StartDDC2(uint32_t DeviceIndex,uint32_t SamplesPerBuffer);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2StreamCallback and ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2PreprocessedStreamCallback callbacks. The value has to be multiple of 64 greater than zero. If it is zero, the ICohG35DDCDeviceSet::StartDDC2 method fails. If it is not a multiple of 64, the method rounds it up to nearest multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Before ICohG35DDCDeviceSet::StartDDC2 is used, devices of the device set have to be turned on using the ICohG35DDCDeviceSet::SetPower method and DDC1 streaming has to be started using the ICohG35DDCDeviceSet::StartDDC1 method, otherwise ICohG35DDCDeviceSet::StartDDC2 fails.
If the DDC2 streaming for a given device is already running, ICohG35DDCDeviceSet::StartDDC2 restarts it except the streaming was previously started with the same SamplesPerBuffer parameter. In this case ICohG35DDCDeviceSet::StartDDC2 does nothing. Restart of the DDC2 streaming stops audio streaming for the given device. ICohG35DDCDeviceSet::StartDDC2 does not restart audio streaming.
Use the ICohG35DDCDeviceSet::StopDDC2 method to stop DDC2 streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops DDC2 streaming on the specified device.
C/C++ declaration
int StopDDC2(uint32_t DeviceIndex);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If audio streaming for a given device is running, it is stopped too.
If DDC2 streaming is not active, ICohG35DDCDeviceSet::StopDDC2 does nothing.
The ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2StreamCallback and ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2PreprocessedStreamCallback callbacks are not called when ICohG35DDCDeviceSet::StopDDC2 returns.
Enables or disables the noise blanker on the DDC2 stream of the specified device.
C/C++ declaration
int SetDDC2NoiseBlanker(uint32_t DeviceIndex,int Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, the noise blanker is enabled. If the parameter is zero, the noise blanker is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDDC2NoiseBlanker method to determine current state of the noise blanker.
Retrieves the current DDC2 noise blanker state of the specified device.
C/C++ declaration
int GetDDC2NoiseBlanker(uint32_t DeviceIndex,int *Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Enabled[out] Pointer to a variable that receives current state of noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the DDC2 noise blanker threshold of the specified device.
C/C++ declaration
int SetDDC2NoiseBlankerThreshold(uint32_t DeviceIndex,double Threshold);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Threshold[in] Specifies threshold in %.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDDC2NoiseBlankerThreshold method to retrieve the current threshold of the noise blanker.
Retrieves the DDC2 noise blanker threshold of the specified device.
C/C++ declaration
int GetDDC2NoiseBlankerThreshold(uint32_t DeviceIndex,double *Threshold);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Threshold[out] Pointer to a variable that receives the threshold of the noise blanker. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines a value which indicates the percentage ratio between 'short time average signal level' and 'maximum level'.
C/C++ declaration
int GetDDC2NoiseBlankerExcessValue(uint32_t DeviceIndex,double *Value);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Value[out] Pointer to a variable that receives current excess value in %. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines the current signal level for the specified device.
C/C++ declaration
int GetSignalLevel(uint32_t DeviceIndex,float *Peak,float *RMS);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Peak[out] Pointer to a variable that receives the current signal level (peak) in Volts. This parameter can be NULL if the application does not require this information.RMS[out] Pointer to a variable that receives the current signal level (RMS) in Volts. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
DDC2 streaming has to be active (started using the ICohG35DDCDeviceSet::StartDDC2 method) before calling of ICohG35DDCDeviceSet::GetSignalLevel, otherwise the returned peak and RMS signal levels are zero.
Signal level is evaluated from the signal after the demodulator filter and before the notch filter (see block diagram), the signal is selected by the demodulator filter.
Signal level is evaluated for each buffer processed by the demodulator filter. Buffer size (signal level evaluation rate) is given by the SamplesPerBuffer parameter of the ICohG35DDCDeviceSet::StartDDC2 method.
The ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2PreprocessedStreamCallback callback provides signal level for each buffer passed to the callback, i.e. for each buffer used in signal level evaluation. This provides a way to get signal level from each processed buffer without the need for pulling it using ICohG35DDCDeviceSet::GetSignalLevel.
To convert RMS signal level in Volts to power in dBm use the following formulas:
P[W] = (VRMS)2 / R = (VRMS)2 / 50
P[dBm]= 10 * log10( P[W] * 1000 )
Where VRMS is RMS signal level in Volts obtained by ICohG35DDCDeviceSet::GetSignalLevel, R is G35DDC receiver input impedance (50 Ω), P[W] is power in Watts and P[dBm] is power in dBm and 1000 is conversion coefficient W -> mW.
The following example shows how to obtain the current signal level in dBm from device 0:
#include <stdio.h> #include <math.h> ICohG35DDCDeviceSet *DeviceSet; //Interface of G35DDC device set object, created using the CreateInstance function float P_dBm,V_RMS; DeviceSet->GetSignalLevel(0,NULL,&V_RMS); P_dBm=10.0*log10(V_RMS*V_RMS*(1000.0/50.0)); printf("Current signal level [RMS]: %.1f dBm\n",P_dBm);
Enables or disables the notch filter of the specified device.
C/C++ declaration
int SetNotchFilter(uint32_t DeviceIndex,uint32_t NotchFilterIndex,int Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable the notch filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetNotchFilter method to determine whether the filter is enabled or disabled.
Retrieves the current notch filter state of the specified device.
C/C++ declaration
int GetNotchFilter(uint32_t DeviceIndex,uint32_t NotchFilterIndex,int *Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[out] Pointer to a variable that receives the current state of the notch filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the relative center frequency of the notch filter for the specified device.
C/C++ declaration
int SetNotchFilterFrequency(uint32_t DeviceIndex,uint32_t NotchFilterIndex,int32_t Frequency);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[in] Specifies the new center frequency of the notch filter in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The value of the Frequency parameter is the new center frequency of the notch filter relative to center of the DDC2 (see the ICohG35DDCDeviceSet::SetDDC2Frequency method). The value can be negative.
Use the ICohG35DDCDeviceSet::GetNotchFilterFrequency method to retrieve the current center frequency of the notch filter.
Retrieves the current relative center frequency of the notch filter.
C/C++ declaration
int GetNotchFilterFrequency(uint32_t DeviceIndex,uint32_t NotchFilterIndex,int32_t *Frequency);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[out] Pointer to a variable that receives the current center frequency of the notch filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the bandwidth of the notch filter of the specified device.
C/C++ declaration
int SetNotchFilterBandwidth(uint32_t DeviceIndex,uint32_t NotchFilterIndex,uint32_t Bandwidth);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[in] Specifies the new bandwidth of the notch filter in Hz. The bandwidth can be from range 1 - 3000 Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetNotchFilterBandwidth method to retrieve the current bandwidth of the notch filter.
Retrieves the current bandwidth of the notch filter for the specified device.
C/C++ declaration
int GetNotchFilterBandwidth(uint32_t DeviceIndex,uint32_t NotchFilterIndex,uint32_t *Bandwidth);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[out] Pointer to a variable that receives the current bandwidth of the notch filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the notch filter length for the specified device. The notch filter is implemented as an FIR filter. This method specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetNotchFilterLength(uint32_t DeviceIndex,uint32_t NotchFilterIndex,uint32_t Length);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[in] Specifies length of the notch filter. The value has to be multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not multiple of 64, the method rounds it up to the nearest multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the ICohG35DDCDeviceSet::GetNotchFilterLength method to determine the current length of the notch filter.
Retrieves the current notch filter length of the specified device.
C/C++ declaration
int GetNotchFilterLength(uint32_t DeviceIndex,uint32_t NotchFilterIndex,uint32_t *Length);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[out] Pointer to a variable that receives the current length of the notch filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the AGC for the specified device.
C/C++ declaration
int SetAGC(uint32_t DeviceIndex,int Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Enabled[in] Specifies whether to enable or disable the AGC. If this parameter is non-zero, the AGC is enabled. If the parameter is zero, the AGC is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If the AGC is disabled, the signal is affected by fixed gain specified using the ICohG35DDCDeviceSet::SetGain method.
Use the ICohG35DDCDeviceSet::GetAGC method to determine the current state of the AGC.
Retrieves the current state of the AGC for the specified device.
C/C++ declaration
int GetAGC(uint32_t DeviceIndex,int *Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Enabled[out] Pointer to a variable that receives the current state of the AGC. The value is non-zero if the AGC is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets parameters of the AGC of specified device.
C/C++ declaration
int SetAGCParams(uint32_t DeviceIndex,double AttackTime,double DecayTime,double ReferenceLevel);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.AttackTime[in] Specifies the new attack time of the AGC in seconds.DecayTime[in] Specifies the new decay time of the AGC in seconds.ReferenceLevel[in] Specifies the new reference level of the AGC in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetAGCParams method to determine the current parameters of the AGC.
Retrieves the current parameters of the AGC for the specified device.
C/C++ declaration
int GetAGCParams(uint32_t DeviceIndex,double *AttackTime,double *DecayTime,double *ReferenceLevel);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.AttackTime[out] Pointer to a variable that receives the current attack time of the AGC in seconds. This parameter can be NULL if the application does not require this information.DecayTime[out] Pointer to a variable that receives the current decay time of the AGC in seconds. This parameter can be NULL if the application does not require this information.ReferenceLevel[out] Pointer to a variable that receives the current reference level of the AGC in dB. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets maximum gain of the AGC for the specified device.
C/C++ declaration
int SetMaxAGCGain(uint32_t DeviceIndex,double MaxGain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.MaxGain[in] Specifies the new maximum gain of the AGC in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetMaxAGCGain method to determine the maximum gain of the AGC.
Retrieves the current maximum gain of the AGC of the specified device.
C/C++ declaration
int GetMaxAGCGain(uint32_t DeviceIndex,double *MaxGain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.MaxGain[out] Pointer to a variable that receives the current maximum gain of the AGC in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets fixed gain for the specified device. This gain is applied to the I/Q signal if the AGC is disabled, otherwise it is not used.
C/C++ declaration
int SetGain(uint32_t DeviceIndex,double Gain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Gain[in] Specifies the new fixed gain in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetGain method to determine the current fixed gain.
Retrieves the current fixed gain of the specified device.
C/C++ declaration
int GetGain(uint32_t DeviceIndex,double *Gain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Gain[out] Pointer to a variable that receives the current fixed gain in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the current gain that is applied to the I/Q signal of the specified device.
C/C++ declaration
int GetCurrentGain(uint32_t DeviceIndex,double *CurrentGain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.CurrentGain[out] Pointer to a variable that receives the current gain in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If the AGC is enabled (using the ICohG35DDCDeviceSet::SetAGC method), the variable pointed to by the CurrentGain parameter is filled by the current gain of the AGC. If the AGC is disabled, the variable pointed to by the CurrentGain parameter is filled by fixed gain that is specified using the ICohG35DDCDeviceSet::SetGain method.
Sets bandwidth of the demodulator filter of the specified device.
C/C++ declaration
int SetDemodulatorFilterBandwidth(uint32_t DeviceIndex,uint32_t Bandwidth);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Bandwidth[in] Specifies the new bandwidth of the demodulator filter in Hz. Possible values are from the range of 1 Hz to the current DDC2 bandwidth. Use the ICohG35DDCDeviceSet::GetDDC2 method to retrieve information about the current DDC type of DDC2.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The demodulator filter bandwidth can be changed using the ICohG35DDCDeviceSet::SetDDC1 method. It can change DDC type of DDC2 and if the current demodulator filter bandwidth is greater than the new bandwidth of DDC2, the demodulator filter bandwidth is reduced. So it is useful to call the ICohG35DDCDeviceSet::GetDemodulatorFilterBandwidth method immediately after ICohG35DDCDeviceSet::SetDDC1.
Retrieves the current demodulator filter bandwidth of the specified device.
C/C++ declaration
int GetDemodulatorFilterBandwidth(uint32_t DeviceIndex,uint32_t *Bandwidth);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Bandwidth[out] Pointer to a variable that receives the current demodulator filter bandwidth. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the demodulator filter shift of the specified device.
C/C++ declaration
int SetDemodulatorFilterShift(uint32_t DeviceIndex,int32_t Shift);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Shift[in] Specifies the new shift of the demodulator filter in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Value of the Shift parameter is shift in Hz relative to center of the demodulator. This value can be negative.
This method does not change demodulator frequency, just shifts the filter from the demodulator's centre.
Use the ICohG35DDCDeviceSet::GetDemodulatorFilterShift method to determine the current demodulator filter shift.
Retrieves the current shift of the demodulator filter for the specified device.
C/C++ declaration
int GetDemodulatorFilterShift(uint32_t DeviceIndex,int32_t *Shift);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Shift[out] Pointer to a variable that receives the current shift of the demodulator. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the demodulator filter length of the specified device. The demodulator filter is implemented as an FIR filter. This method specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetDemodulatorFilterLength(uint32_t DeviceIndex,uint32_t Length);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Length[in] Specifies the length of the demodulator filter. The value has to be multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 64, the method rounds it up to nearest multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the ICohG35DDCDeviceSet::GetDemodulatorFilterLength method to determine the current length of the demodulator filter.
Retrieves the current length of the demodulator filter for the specified device.
C/C++ declaration
int GetDemodulatorFilterLength(uint32_t DeviceIndex,uint32_t *Length);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Length[out] Pointer to a variable that receives the current demodulator filter length. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the demodulator mode of the specified device.
C/C++ declaration
int SetDemodulatorMode(uint32_t DeviceIndex,uint32_t Mode);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Mode[in] Specifies the new demodulator mode. This value can be one of the following:
Value Meaning G3XDDC_MODE_CW Continuous wave G3XDDC_MODE_AM Amplitude modulation G3XDDC_MODE_FM Frequency modulation G3XDDC_MODE_LSB Lower sideband modulation G3XDDC_MODE_USB Upper sideband modulation G3XDDC_MODE_AMS Amplitude modulation G3XDDC_MODE_DSB Double sideband modulation G3XDDC_MODE_ISB Independent sideband modulation
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetDemodulatorMode method to retrieve current demodulator mode.
Retrieves the current demodulator mode of the specified device.
C/C++ declaration
int GetDemodulatorMode(uint32_t DeviceIndex,uint32_t *Mode);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Mode[out] Pointer to a variable that receives the current demodulator mode. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the relative center frequency of the demodulator for the specified device.
C/C++ declaration
int SetDemodulatorFrequency(uint32_t DeviceIndex,int32_t Frequency);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Frequency[in] Specifies the new center frequency of the demodulator in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The value of the Frequency parameter is center frequency of the demodulator relative to the center of the DDC2. The value can be negative.
The absolute frequency of the demodulator is given by the following formula:
faDEM = fDDC1 + frDDC2 + frDEM
Where faDEM is the absolute center frequency of the demodulator in Hz, fDDC1 is the center frequency of the DDC1 in Hz (set using the ICohG35DDCDeviceSet::SetDDC1Frequency method), frDDC2 is the relative center frequency of DDC2 of in Hz (set using the ICohG35DDCDeviceSet::SetDDC2Frequency) and frDEM is relative center frequency of the demodulator in Hz (set using ICohG35DDCDeviceSet::SetDemodulatorFrequency).
The absolute center frequency of the demodulator is the real-world frequency that you are listening to.
Use the ICohG35DDCDeviceSet::GetDemodulatorFrequency method to determine the current relative center frequency of the demodulator for the given device.
The following example shows three methods of how to set the absolute demodulator center frequency of the device 0 to 11.01 MHz:
ICohG35DDCDeviceSet *DeviceSet; //Interface of G35DDC device set object, created using the CreateInstance function //1. method DeviceSet->SetDDC1Frequency(11010000); DeviceSet->SetDDC2Frequency(0,0); DeviceSet->SetDemodulatorFrequency(0,0); //2. method, usable if DDC2 bandwidth is less than DDC1 bandwidth DeviceSet->SetDDC1Frequency(11000000); DeviceSet->SetDDC2Frequency(0,10000); DeviceSet->SetDemodulatorFrequency(0,0); //3. method, usable if DDC2 bandwidth is less than DDC1 bandwidth, //and demodulator filter bandwidth is less than DDC2 bandwidth DeviceSet->SetDDC1Frequency(11020000); DeviceSet->SetDDC2Frequency(0,-5000); DeviceSet->SetDemodulatorFrequency(0,-5000);
Retrieves the current relative center frequency of the demodulator for the specified device.
C/C++ declaration
int GetDemodulatorFrequency(uint32_t DeviceIndex,int32_t *Frequency);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Frequency[out] Pointer to a variable that receives the current center frequency of the demodulator. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets a parameter of demodulation of the specified device.
C/C++ declaration
int SetDemodulatorParam(uint32_t DeviceIndex,uint32_t Code,const void *Buffer,uint32_t BufferSize);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Code[in] Specifies the code of the demodulator parameter to be set by this method. The code can be one of the following:
Value Meaning G3XDDC_DEMODULATOR_PARAM_AMS_SIDE_BAND Side band for synchronous AM demodulation.
The Buffer parameter has to be pointer to an uint32_t variable, and the BufferSize parameter has to be sizeof(uint32_t).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G3XDDC_SIDE_BAND_LOWER
AMS demodulator will use lower sidebandG3XDDC_SIDE_BAND_UPPER
AMS demodulator will use upper sidebandG3XDDC_SIDE_BAND_BOTH
AMS demodulator will use both side bands.G3XDDC_DEMODULATOR_PARAM_AMS_CAPTURE_RANGE Capture range of synchronous AM demodulator.
The Buffer parameter has to be pointer to a G3XDDC_AMS_CAPTURE_RANGE structure, and the BufferSize parameter has to be sizeof(G3XDDC_AMS_CAPTURE_RANGE).
G3XDDC_DEMODULATOR_PARAM_CW_FREQUENCY CW tone frequency
The Buffer parameter has to be pointer to a int32_t variable, and the BufferSize parameter has to be sizeof(int32_t).
Value of the variable pointed to by the Buffer parameter is CW tone frequency in Hz.
G3XDDC_DEMODULATOR_PARAM_DSB_SIDE_BAND Side band for DSB demodulation.
The Buffer parameter has to be pointer to an uint32_t variable, and the BufferSize parameter has to be sizeof(uint32_t).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G3XDDC_SIDE_BAND_LOWER
DSB demodulator will use lower sidebandG3XDDC_SIDE_BAND_UPPER
DSB demodulator will use upper sidebandG3XDDC_SIDE_BAND_BOTH
DSB demodulator will use both side bands.G3XDDC_DEMODULATOR_PARAM_ISB_SIDE_BAND Side band for ISB demodulation.
The Buffer parameter has to be pointer to an uint32_t variable, and the BufferSize parameter has to be sizeof(uint32_t).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G3XDDC_SIDE_BAND_LOWER
ISB demodulator will use lower sidebandG3XDDC_SIDE_BAND_UPPER
ISB demodulator will use upper sidebandG3XDDC_SIDE_BAND_BOTH
ISB demodulator will use both side bands.Buffer[in] Pointer to a buffer containing the value of the demodulator parameter which this method will set. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves a parameter of demodulation of the specified device.
C/C++ declaration
int GetDemodulatorParam(uint32_t DeviceIndex,uint32_t Code,void *Buffer,uint32_t BufferSize);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Code[in] Specifies the code of the demodulator parameter to be retrieved. For detailed information about available codes see ICohG35DDCDeviceSet::SetDemodulatorParam.Buffer[out] Pointer to a buffer that receives the requested parameter. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves information about the current demodulator state of the specified device.
C/C++ declaration
int GetDemodulatorState(uint32_t DeviceIndex,uint32_t Code,void *Buffer,uint32_t BufferSize);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Code[in] Specifies the code of the demodulator state to be retrieved. The code can be one of the following:
Value Meaning G3XDDC_DEMODULATOR_STATE_AMS_LOCK Lock state of synchronous AM demodulation.
The Buffer parameter has to be pointer to a int variable, and the BufferSize parameter has to be sizeof(int).
Received value is non-zero if synchronous AM demodulator is locked to signal, and zero if it is not locked.
G3XDDC_DEMODULATOR_STATE_AMS_FREQUENCY Frequency in Hz which synchronous AM demodulator is locked to. It is relative to center of the demodulator. It can be negative.
The Buffer parameter has to be pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G3XDDC_DEMODULATOR_STATE_AM_DEPTH Depth of AM modulation in %.
The Buffer parameter has to be pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G3XDDC_DEMODULATOR_STATE_DSB_LOCK Lock state of DSB demodulation.
The Buffer parameter has to be pointer to a int variable, and the BufferSize parameter has to be sizeof(int).
Received value is non-zero if DSB demodulator is locked to signal, and zero if it is not locked.
G3XDDC_DEMODULATOR_STATE_DSB_FREQUENCY Frequency in Hz which DSB demodulator is locked to. It is relative to center of the demodulator. It can be negative.
The Buffer parameter has to be pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G3XDDC_DEMODULATOR_STATE_TUNE_ERROR Estimated tune error in Hz.
The Buffer parameter has to be pointer to an int32_t variable, and the BufferSize parameter has to be sizeof(int32_t).
Received value is difference between demodulator frequency and frequency of received signal. Subtract the returned tune error from demodulator frequency to get frequency of the received signal. Tune error is relative to center of the demodulator and it can be negative.
G3XDDC_DEMODULATOR_STATE_FM_DEVIATION Estimated frequency deviation in Hz.
The Buffer parameter has to be pointer to an uint32_t variable, and the BufferSize parameter has to be sizeof(uint32_t).
Buffer[out] Pointer to a buffer that receives the requested information. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts audio streaming for the specified device.
C/C++ declaration
int StartAudio(uint32_t DeviceIndex,uint32_t SamplesPerBuffer);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.SamplesPerBuffer[in] Specifies the number of samples in each buffer passed to the ICohG35DDCDeviceSetCallback::CohG35DDC_AudioStreamCallback callback. The value has to be multiple of 64 greater than zero. If it is zero, the ICohG35DDCDeviceSet::StartAudio method fails. If it is not multiple of 64 the method rounds it up to nearest multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Before ICohG35DDCDeviceSet::StartAudio is used, the G35DDC devices have to be turned on using the ICohG35DDCDeviceSet::SetPower method, DDC1 streaming has to be started using the ICohG35DDCDeviceSet::StartDDC1 method and DDC2 streaming has to be started using the ICohG35DDCDeviceSet::StartDDC2 method, otherwise ICohG35DDCDeviceSet::StartAudio fails.
If the audio streaming of specified device is already running, ICohG35DDCDeviceSet::StartAudio restarts it except the streaming was previously started with the same SamplesPerBuffer parameter. In this case ICohG35DDCDeviceSet::StartAudio does nothing.
Use the ICohG35DDCDeviceSet::StopAudio method to stop audio streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops audio streaming for the specified device.
C/C++ declaration
int StopAudio(uint32_t DeviceIndex);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If audio streaming is not active, ICohG35DDCDeviceSet::StopAudio does nothing.
The ICohG35DDCDeviceSetCallback::CohG35DDC_AudioStreamCallback callback are not called after ICohG35DDCDeviceSet::StopAudio returns.
Sets fixed audio gain of the specified device.
C/C++ declaration
int SetAudioGain(uint32_t DeviceIndex,double Gain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Gain[in] Specifies a new fixed audio gain in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetAudioGain method to retrieve the current audio gain.
Retrieves the current fixed audio gain of the specified device.
C/C++ declaration
int GetAudioGain(uint32_t DeviceIndex,double *Gain);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Gain[out] Pointer to a variable that receives the current fixed gain in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the audio filter of the device index.
C/C++ declaration
int SetAudioFilter(uint32_t DeviceIndex,int Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Enabled[in] Specifies whether to enable or disable the audio filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetAudioFiler method to retrieve the current state of the audio filter.
Retrieves the current state of the audio filter for the specific device.
C/C++ declaration
int GetAudioFilter(uint32_t DeviceIndex,int *Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Enabled[out] Pointer to a variable that receives the current state of the audio filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the parameters of the audio filter for the specified device.
C/C++ declaration
int SetAudioFilterParams(uint32_t DeviceIndex,uint32_t CutOffLow,uint32_t CutOffHigh,double Deemphasis);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.CutOffLow[in] Specifies the cut-off low frequency of the filter in Hz. This is the start frequency of filter's passband, it can be from the range of 0 to 23999 Hz. The value has to be less then the cut-off high frequency specified by the CutOffHigh parameter.CutOffHigh[in] Specifies the cut-off high frequency of the filter in Hz. This is the end frequency of filter's passband it can be from the range of 1 - 24000 Hz. The value has to be greater than the cut-off low frequency specified by the CutOffLow parameter.Deemphasis[in] Specifies the de-emphasis of the filter in dB per octave. De-emphasis starts at the cut-off low frequency of the filter. This value can be from the range of -9.9 to 0.0 dB/octave. Zero means that de-emphasis is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the ICohG35DDCDeviceSet::GetAudioFilerParams method to retrieve the current parameters of the audio filter.
Retrieves the current parameters of the audio filter for the specified device.
C/C++ declaration
int GetAudioFilterParams(uint32_t DeviceIndex,uint32_t *CutOffLow,uint32_t *CutOffHigh,double *Deemphasis);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.CutOffLow[out] Pointer to a variable that receives the current cut-off low frequency of the filter. This parameter can be NULL if the application does not require this information.CutOffHigh[out] Pointer to a variable that receives the current cut-off high frequency of the filter. This parameter can be NULL if the application does not require this information.Deemphasis[out] Pointer to a variable that receives the current de-emphasis setting of the filter. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the audio filter length of the specified device. The audio filter is implemented as an FIR filter. This method specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetAudioFilterLength(uint32_t DeviceIndex,uint32_t Length);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Length[in] Specifies the length of the audio filter. The value has to be multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 64, the method rounds it up to nearest multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Increasing the filter length increases filter steepness and it may increase CPU usage.
Use the ICohG35DDCDeviceSet::GetAudioFilterLength method to determine the current length of the audio filter.
Retrieves the current audio filter length of the specified device.
C/C++ declaration
int GetAudioFilterLength(uint32_t DeviceIndex,uint32_t *Length);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Length[out] Pointer to a variable that receives the current length of the audio filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the audio volume of the specified device.
C/C++ declaration
int SetVolume(uint32_t DeviceIndex,uint8_t Volume);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Volume[in] Specifies the new volume. The value can vary from 0 to 31, where 31 means maximum volume.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC receiver has an audio output connector, the ICohG35DDCDeviceSet::SetVolume method affects the audio signal level at this output (see also ICohG35DDCDeviceSet::SetDAC).
Use the ICohG35DDCDeviceSet::GetVolume method to retrieve the current volume.
Retrieve the current volume of the specified device.
C/C++ declaration
int GetVolume(uint32_t DeviceIndex,uint8_t *Volume);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Volume[out] Pointer to a variable that receives the current volume. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Mutes or unmutes audio of the specified device.
C/C++ declaration
int SetMute(uint32_t DeviceIndex,int Mute);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Mute[in] Specifies whether to mute or unmute audio. If this parameter is non-zero, the audio is muted. If the parameter is zero, the audio is unmuted.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC receiver has an audio output connector, the ICohG35DDCDeviceSet::SetMute method affects the audio signal at this output (see also ICohG35DDCDeviceSet::SetDAC).
Use the ICohG35DDCDeviceSet::GetMute method to retrieve the current mute state.
Retrieves the current mute state of the specified device.
C/C++ declaration
int GetMute(uint32_t DeviceIndex,int *Mute);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Mute[out] Pointer to a variable that receives the current mute state. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Allows routing audio output to a DAC (Digital-to-analog converter). The DAC output is connected to the audio output connector of the receiver.
C/C++ declaration
int SetDAC(uint32_t DeviceIndex,uint32_t DAC);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.DAC[in] Specifies the routed audio to the DAC.
Bit Meaning 0 If it is set, audio output is routed to left channel of the audio output connector. 1 If it is set, audio output is routed to right channel of the audio output connector. 2 - 31 Reserved. Must be zero.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines if audio output is routed to the audio output connector (DAC).
C/C++ declaration
int GetDAC(uint32_t DeviceIndex,uint32_t *DAC);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.DAC[out] Pointer to a variable that receives a bitwise array which specifies how the audio is routed to the audio output connector (DAC). For more information, see ICohG35DDCDeviceSet::SetDAC. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines compensation data for the frequency spectrum computed from DDC1, DDC2 and IF signal. It is used to convert relative amplitudes in dB to absolutes ones in dBm.
C/C++ declaration
int GetSpectrumCompensation(uint32_t DeviceIndex,uint32_t CenterFrequency,uint32_t Width,float *Buffer,uint32_t Count);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.CenterFrequency[in] Specifies the absolute center frequency of the requested compensation data in Hz.Width[in] Specifies the width of the requested compensation data in Hz.Buffer[out] Pointer to a buffer to be filled with compensation data. This parameter cannot be NULL.Count[in] Specifies the number of FLOAT items in the buffer pointed to by the Buffer parameter.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The following example shows how to use the ICohG35DDCDeviceSet::GetSpectrumCompensation method in ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2StreamCallback callback:
//Let the following is prototype of a function which computes FFT from I/Q signal stored in //the buffer pointed to be the Input parameter. Result is stored in complex form in the buffer //pointed to by the Output parameter. Size of the FFT is given be the Size parameter. //The example uses 2048 bins FFT. void FFT(float *Output,const float *Input,int Size); ICohG35DDCDeviceSet *DeviceSet; //Interface to G35DDC device set object uint32_t AbsDDC2Frequency; //Absolute frequency of the DDC2 int32_t RelDDC2Frequency; //Relative frequency of the DDC2 uint32_t DDC1Frequency; //DDC1 frequency G3XDDC_DDC_INFO DDC2Info; //Information about current DDC type of the DDC2 float FFTBuffer[2*2048]; //Buffer for FFT result float Compensation[2048]; //Buffer for compensation data uint32_t FirstBin,LastBin; //the first and last bins in the FFT of useful DDC2 band MY_CALLBACK_OBJECT MyCallbackObject; //User defined callback object implementing methods of ICohG35DDCDeviceSetCallback interface uint32_t DeviceIndex; //index of device in the device set Code before... //Retrieve frequency of the DDC1 DeviceSet->GetDDC1Frequency(DeviceIndex,&DDC1Frequency); //Retrieve relative frequency of the DDC2 for channel 0 DeviceSet->GetDDC2Frequency(DeviceIndex,&RelDDC2Frequency); //Calculate absolute frequency of the DDC2 AbsDDC2Frequency=(INT32)DDC1Frequency+RelDDC2Frequency; //Retrieve DDC type information of the DDC2 DeviceSet->GetDDC2(DeviceIndex,NULL,&DDC2Info); //Retrieve compensation data DeviceSet->GetSpectrumCompensation(DeviceIndex,AbsDDC2Frequency,DDC2Info.SampleRate,Compensation,2048); //In this case the Width parameter is equal to sample rate, because we need compensation data //for whole DDC2 band. //Compensation data have to be updated after change of absolute DDC2 frequency using //the ICohG35DDCDeviceSetCallback::SetDDC1Frequency or ICohG35DDCDeviceSetCallback::SetDDC2Frequency method. //In this case a mutual-exclusion synchronization method (for example critical section) should be used //if the Compensation buffer would be modified outside the CohG35DDC_DDC2StreamCallback callback. FirstBin=2048*(DDC2Info.SampleRate-DDC2Info.Bandwidth)/2/DDC2Info.SampleRate; LastBin=2048*(DDC2Info.SampleRate+DDC2Info.Bandwidth)/2/DDC2Info.SampleRate; //Register callback object DeviceSet->SetCallback(&MyCallbackObject); //Start DDC2 streaming for channel 0 //The SamplesPerBuffer parameter is set to 2048 which is size of the FFT to simplify //the example. DeviceSet->StartDDC2(DeviceIndex,2048); Code after... void MY_CALLBACK_OBJECT::CohG35DDC_DDC2StreamCallback(ICohG35DDCDeviceSet *DeviceSet,uint32_t DeviceIndex,const float *Buffer,uint32_t NumberOfSamples) { uint32_t i; //Compute FFT FFT(FFTBuffer,Buffer,2048); //Converts complex FFT result to dB for(i=0;i<2048;i++) { FFTBuffer[i]=(float)(10.0*log10(FFTBuffer[i*2]*FFTBuffer[i*2]+FFTBuffer[i*2+1]*FFTBuffer[i*2+1])); } //Apply compensation data to get amplitudes in frequency spectrum in dBm for(i=0;i<2048;i++) { FFTBuffer[i]+=Compensation[i]; } //now the FFTBuffer contains amplitudes in dBm //Useful band starts at the bin given by the FirstBin variable //and ends at the bin given by the LastBin variable. }
Registers a user-defined callback object given by its interface. The API calls methods of the object to pass samples to the application. The object has to implement methods of the ICohG35DDCDeviceSetCallback interface.
C/C++ declaration
int SetCallback(ICohG35DDCDeviceSetCallback *Callback);
Parameters
Callback[in] Interface to a user-defined object to be registered as a callback object. If this parameter is NULL, the current callback object is unregistered, the API will not call any callback after ICohG35DDCDeviceSet::SetCallback returns.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Returns a pointer to the current user-defined callback object.
C/C++ declaration
ICohG35DDCDeviceSetCallback* GetCallback(void);
Parameters
None
Return value
This method returns a pointer to the current user-defined callback object, previously set by the ICohG35DDCDeviceSet::SetCallback method.
Retrieves the current internal temperature of the G35DDC device in the device set.
C/C++ declaration
int GetTemperature(uint32_t DeviceIndex,uint32_t *Temperature);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.Temperature[out] Pointer to a variable that receives the current internal temperature in degrees of Celsius. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC devices have to be turned on using the ICohG35DDCDeviceSet::SetPower method before ICohG35DDCDeviceSet::GetTemperature is used. Otherwise ICohG35DDCDeviceSet::GetTemperature fails.
Retrieves the current error state of the G35DDC device.
C/C++ declaration
int GetDeviceState(uint32_t DeviceIndex,uint32_t *State);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.State[out] Pointer to a variable that receives the current error state of the device. This parameter cannot be NULL. The value can be zero or G3XDDC_DEVICE_STATE_ERROR_HIGH_TEMP if critical temperature is detected and the device is turned off. In this case the application should call ICohG35DDCDeviceSet::SetPower to turn off explicitly.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the state of DDC1 and ADC counters.
C/C++ declaration
int GetTimestampCounters(double *DDC1SampleCounter,uint64_t *ADCPeriodCounter);
Parameters
DDC1SampleCounter[out] Pointer to a variable that receives the current value of DDC1 sample counter. The value specifies how many I/Q sample sets were produced by the DDC1 since its start, to the latest pulse received at the 1PPS input of the coherent clock generator board.ADCPeriodCounter[out] Pointer to a variable that receives the current value of ADC counter. The value represents the number of periods of ADC clock since DDC1 start, to the latest pulse received at the 1PPS input of the coherent clock generator board.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The counters are active only when the DDC1 is running (see the ICohG35DDCDeviceSet::StartDDC1 method). If the DDC1 is not running, the GetTimestampCounters method fails.
The DDC1 sample counter can be used to time stamp the DDC1 I/Q sample sets received in the ICohG35DDCDeviceSetCallback::CohG35DDC_DDC1StreamCallback callback. The value of the DDC1 sample counter is equal to the number of I/Q sample sets received in the ICohG35DDCDeviceSetCallback::CohG35DDC_DDC1StreamCallback callback, since start of the DDC1 to the latest pulse at the 1PPS input of the coherent clock generator board.
The counters are common for all the devices in the device set.
Enables or disables the test signal at the receiver's input, which allows testing of the entire signal and processing path.
C/C++ declaration
int SetBuiltInTest(uint32_t DeviceIndex,int Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than number of devices' in the device set.Enabled[in] Specifies whether to enable or disable the built-in test. If this parameter is non-zero, the test signal is enabled. If the parameter is zero, the test signal is disabled.Test signal parameters:
Frequency Level 25 MHz ± 2 kHz -40 dBm ± 5 dB
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Built-in test is optional. If the receiver does not support built-in test, SetBuiltInTest fails. The following example shows how to determine that receiver supports built-in test:
G35DDC_DEVICE_INFO DeviceInfo; IG35DDCDeviceSet *DeviceSet; //Interface of G35DDC device set object, created using the CreateInstance function uint32_t DeviceIndex; //index of the receiver in the device set DeviceSet->GetDeviceInfo(DeviceIndex,&DeviceInfo); if(DeviceInfo.Flags & G35DDC_FLAGS_BIT) { //the receiver supports built-in test } else { //the receiver does not support built-in test }
Retrieves information about whether the test signal is enabled or not.
C/C++ declaration
int GetBuiltInTest(uint32_t DeviceIndex,int *Enabled);
Parameters
DeviceIndex[in] Specifies index of the device in the device set. It can vary from zero to 'one less than number of devices' in the device set.Enabled[out] Pointer to a variable which receives information about the test signal state. If it is non-zero, test signal is enabled, if it is zero, test signal is not enabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
ICohG35DDCDeviceSetCallback interface is an interface of application-defined object that implements methods of the interface. The object is used to receive streamed buffers from the G35DDC device set object. See ICohG35DDCDeviceSet::SetCallback.
Each method of the interface is called in context of thread created by the API. If some shared data are accessed inside callback methods, it is recommended to use a mutual-exclusion synchronization method. The application should not call any G35DDC API function/method from the inside method of this interface, otherwise it can cause deadlock or the application can enter an unpredictable state.
It is called by the API to pass coherent I/Q samples from DDC1 of all the devices in the device set to the application at once. The DDC1 streaming is started using the ICohG35DDCDeviceSet::StartDDC1 method.
C/C++ declaration
void CohG35DDC_DDC1StreamCallback(ICohG35DDCDeviceSet *DeviceSet,uint32_t DeviceCount,const void **Buffers,uint32_t NumberOfSamples,uint32_t BitsPerSample);
Parameters
DeviceSetInterface of the device set object which called the callback.DeviceCountSpecifies the number of I/Q sample buffers in the array pointed to by the Buffers. It is equal to number of devices in the device set (see the CohGetDeviceCount function).BuffersPointer to the array of pointers to the buffers which contain I/Q sample sets from DDC1. Sample rate and bits per sample is given by the used DDC type, see the ICohG35DDCDeviceSet::SetDDC1 method. One I/Q sample set consists of two samples. The order of the buffers in the array corresponds to the hardware interconnection of the G35DDC devices.NumberOfSamplesSpecifies the number of I/Q sample sets in each buffer in the Buffers array. This value is equal to value of the SamplesPerBuffer parameter of the ICohG35DDCDeviceSet::StartDDC1 method.BitsPerSampleSpecifies the number of bits per sample. It is given by DDC type used for DDC1 and it can be 16 or 32. If it is 16, the sample is 16bit integer (32bits per I/Q sample set), signed, little endian, from the range -32768 to 32767. If it is 32, the sample is 32bit integer (64bits per I/Q sample set), signed, little endian, from the range -2147483648 to 2147483647.
It is called by the API to pass IF snapshots to the application from a specific device of the device set. Sending of IF snapshots is started using the ICohG35DDCDeviceSet::StartIF method.
C/C++ declaration
void CohG35DDC_IFCallback(ICohG35DDCDeviceSet *DeviceSet,uint32_t DeviceIndex,const int16_t *Buffer,uint32_t NumberOfSamples, uint16_t MaxADCAmplitude,uint32_t ADCSamplingRate);
Parameters
DeviceSetInterface of the device object which called the method.DeviceIndexSpecifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.BufferPointer to the buffer which contains samples directly received from the ADC. Sample rate is 100 MHz, the sample is 16bit signed little endian.NumberOfSamplesSpecifies the number of samples in the buffer pointed to by the Buffer parameter. This is usually 65536.MaxADCAmplitudeSpecifies the maximum amplitude. Measurement of the maximum is started at the end of the previous snapshot to the current one. The possible value is 0 to 32767.ADCSamplingRateSpecifies the sample rate of the ADC in Hz.
It is called by the API to pass I/Q samples from DDC2 to the application. The DDC2 streaming can be started using the ICohG35DDCDeviceSet::StartDDC2 method.
C/C++ declaration
void CohG35DDC_DDC2StreamCallback(ICohG35DDCDeviceSet *DeviceSet,uint32_t DeviceIndex,const float *Buffer,uint32_t NumberOfSamples);
Parameters
DeviceSetInterface of the device set object which called the method.DeviceIndexSpecifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.BufferPointer to the buffer which contains I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the CohGetDDC2 function to determine the current DDC type of the DDC2. Sample is 32bit IEEE float from range -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the ICohG35DDCDeviceSet::StartDDC2 method.
It is called by the API to pass pre-processed I/Q samples from DDC2 to the application. The samples are filtered by the demodulator filter, notch filter and affected by AGC or fixed gain. The DDC2 streaming can be started using the ICohG35DDCDeviceSet::StartDDC2 method.
C/C++ declaration
void CohG35DDC_DDC2PreprocessedStreamCallback(ICohG35DDCDeviceSet *Device,uint32_t DeviceIndex,const float *Buffer, uint32_t NumberOfSamples,float SlevelPeak,float SlevelRMS);
Parameters
DeviceSetInterface of the device set object which called the method.DeviceIndexSpecifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.BufferPointer to the buffer which contains preprocessed I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the ICohG35DDCDeviceSet::GetDDC2 method to determine the current DDC type of the DDC2. Sample is 32bit IEEE float from range -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the ICohG35DDCDeviceSet::StartDDC2 method.SlevelPeakSpecifies the peak signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter.SlevelRMSSpecifies the RMS signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter. For detailed information on how to convert RMS signal level to dBm, see the remarks of the ICohG35DDCDeviceSet::GetSignalLevel method.
It is called by the API to pass audio samples to the application. The audio streaming is started using the ICohG35DDCDeviceSet::StartAudio method.
C/C++ declaration
void CohG35DDC_AudioStreamCallback(ICohG35DDCDeviceSet *Device,uint32_t DeviceIndex,uint32_t Type,const float *Buffer,uint32_t NumberOfSamples);
Parameters
DeviceSetInterface of the device set object which called the method.DeviceIndexSpecifies index of the device in the device set. It can vary from zero to 'one less than the number of devices' in the device set.TypeSpecifies the type (stage) of audio samples stored in the buffer pointed to by the Buffer parameter. The value of this parameter can be one of the following:
Value Meaning 0 The buffer contains audio samples affected by audio gain (see ICohG35DDCDeviceSet::SetAudioGain). 1 The buffer contains audio samples affected by audio gain and audio filter (see ICohG35DDCDeviceSet::SetAudioGain and ICohG35DDCDeviceSet::SetAudioFilter). 2 The buffer contains audio samples affected by audio gain, audio filter and volume (see ICohG35DDCDeviceSet::SetAudioGain, ICohG35DDCDeviceSet::SetAudioFilter, ICohG35DDCDeviceSet::SetVolume and ICohG35DDCDeviceSet::SetMute). BufferPointer to the buffer which contains samples of the audio signal. The signal is mono, sample rate is 48000 Hz, sample is 32bit IEEE float from range -1.0 to 1.0.NumberOfSamplesSpecifies the number of samples stored in the buffer pointed to by the Buffer parameter. This value is equal to the value of the SamplesPerBuffer parameter of the ICohG35DDCDeviceSet::StartAudio function.
Contains information about the G35DDC device.
C/C++ declaration
#pragma pack(push,1) typedef struct { char DevicePath[MAX_PATH]; uint8_t InterfaceType; char SerialNumber[9]; uint16_t HWVersion; uint16_t FWVersion; uint8_t EEPROMVersion; uint32_t Flags; uint32_t ChannelCount; uint32_t DDCTypeCount; } G35DDC_DEVICE_INFO; #pragma pack(pop)
Members
DevicePathDevice system path in a null-terminated string. It is used to open the device using the object interface.InterfaceTypeDevice interface type. The value can be one of the following:
G3XDDC_INTERFACE_TYPE_PCIE
The device is connected to the computer via PCI express.G3XDDC_INTERFACE_TYPE_USB
The device is connected to the computer via USB.SerialNumberSerial number in null-terminated string.HWVersionVersion of the hardware.FWVersionVersion of the firmware.EEPROMVersionEEPROM structure version.FlagsHardware configuration flags can be a combination of the following values:
Value Meaning G35DDC_FLAGS_EXTERNAL_REFERENCE The device supports external reference. G35DDC_FLAGS_AUDIO_OUTPUT The device has an audio output connector. G35DDC_FLAGS_COHERENT The device supports coherent mode. G35DDC_FLAGS_BIT The device supports built-in test. ChannelCountNumber of channels. This is always 3. In coherent mode each device has a single processing channel.DDCTypeCountNumber of DDC types supported by the DDC1.
Contains information about the DDC type.
C/C++ declaration
#pragma pack(push,1) typedef struct { uint32_t SampleRate; uint32_t Bandwidth; uint32_t BitsPerSample; } G3XDDC_DDC_INFO; #pragma pack(pop)
Members
SampleRateSample rate of I/Q signal in Hz.BandwidthUseful bandwidth in Hz.BitsPerSampleNumber of bits per sample. This can be 16 or 32. It is used to determine the bits per sample for DDC1.
Contains information about the AMS capture range.
C/C++ declaration
#pragma pack(push,1) typedef struct { uint32_t Tune; uint32_t Lock; } G3XDDC_AMS_CAPTURE_RANGE; #pragma pack(pop)
Members
TuneInitial capture range in Hz.LockCapture range (in Hz) used when the AMS demodulator is locked.