Programming Information for WiNRADiO G35DDC HF receiver in coherent mode.

The G35DDC API SDK is implemented as a 32-bit dynamic library (G35DDCAPI.dll). It provides object-oriented and non-object-oriented interfaces to control set of G35DDC devices in coherent mode. This document describes the object-oriented interface. The G35DDCAPI.dll library exports several functions that make it possible to control G35DDC receivers in coherent mode.

The API is not fully thread-safe so preferrably 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 API can be used by any 32-bit application under Microsoft Windows 2000, XP, Vista, Windows 7 and Windows 8 (including their 64-bit versions).

Processing chain block diagram of G35DDC device set in coherent mode

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.

Simplified block diagram of G35DDC processing chain
Attenuator Preselectors Preamplifier Noise blanker IF DDC1 frequency shift DDC1 DDC1 stream DDC2 frequency shift DDC2 DDC2 stream DDC2 noise blanker Demodulator filter Signal level Notch filters Gain Pre-processed DDC2 stream Demodulator Audio gain Audio stream Audio filter Set volume Attenuator Preselectors Preamplifier Noise blanker IF DDC1 frequency shift DDC1 DDC1 stream DDC2 frequency shift DDC2 DDC2 stream DDC2 noise blanker Demodulator filter Signal level Notch filters Gain Pre-processed DDC2 stream Demodulator Audio gain Audio stream Audio filter Set volume Attenuator Preselectors Preamplifier Noise blanker IF DDC1 frequency shift DDC1 DDC1 stream DDC2 frequency shift DDC2 DDC2 stream DDC2 noise blanker Demodulator filter Signal level Notch filters Gain Pre-processed DDC2 stream Demodulator Audio gain Audio stream Audio filter Set volume Simplified block diagram of the device set processing chain containing three interconnected G35DDC devices in coherent mode.
Phase-coherent parts of the device set are in the red rectangles.

Using WiNRADiO G35DDC API

Loading API

The G35DDCAPI.dll library can be loaded to the application by two Microsoft Windows API functions. The first one is LoadLibrary and the second one is LoadLibraryEx. After the library is loaded, it is required to get addresses of exported functions. When the API is no longer required in the memory, the FreeLibrary function can be used to unload the API. Before the FreeLibrary is called, all the objects created using 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 "G35DDCAPI.h"



G3XDDCAPI_CREATE_INSTANCE CreateInstance;

HMODULE hAPI;



void main(void)

{  

    //Loading the API

    hAPI=LoadLibrary("G35DDCAPI.dll");



    if(hAPI!=NULL)

    {

        //Retrieving address of the CreateInstance function

        CreateInstance=(G3XDDCAPI_CREATE_INSTANCE)GetProcAddress(hAPI,"CreateInstance");



        //Here place code that uses the API



        FreeLibrary(hAPI);

    }

    else

    {

        //If the LoadLibrary fails

        printf("Failed to load G35DDCAPI.dll.\n");

    }

}

Enumerating available G35DDC devices sets in coherent mode

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 list of device serial numbers of available G35DDC device sets:


#include <stdio.h>

#include "G35DDCAPI.h"



void main(void)

{

 G3XDDCAPI_CREATE_INSTANCE CreateInstance;

 HMODULE hAPI;

 ICohG35DDCDeviceSetEnumerator *Enumerator=NULL;

 G35DDC_DEVICE_INFO *DevInfo;

 UINT32 Count;

 UINT32 SetCount,i,j;



    hAPI=LoadLibrary("G35DDCAPI.dll");



    if(hAPI!=NULL)

    {

        CreateInstance=(G3XDDCAPI_CREATE_INSTANCE)GetProcAddress(hAPI,"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 i-th 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=%08X\n",GetLastError());

        }



        FreeLibrary(hAPI);

    }

    else

    {

        printf("Failed to load G35DDCAPI.dll.\n");

    }



    printf("Press enter to exit\n");

    getchar();

}

Opening G35DDC device set

G35DDC device set has to be open before it can be controlled. The API provides an object to to open and control 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 "G35DDCAPI.h"





void main(void)

{  

 G3XDDCAPI_CREATE_INSTANCE CreateInstance;

 HMODULE hAPI;

 ICohG35DDCDeviceSet *DeviceSet;

 

    //Loading the API

    hAPI=LoadLibrary("G35DDCAPI.dll");



    if(hAPI!=NULL)

    {

        //Retrieving address of the CreateInstance API functions

        CreateInstance=(G3XDDCAPI_CREATE_INSTANCE)GetProcAddress(hAPI,"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=%08X\n",GetLastError());

            }

            

            //Release interface of device object

            DeviceSet->Release();

        }

        else

        {

            printf("Failed to create device set object. Error code=%08X\n",GetLastError());

        }        



        FreeLibrary(hAPI);

    }

    else

    {

        //If the LoadLibrary fails

        printf("Failed to load G35DDCAPI.dll.\n");

    }

}

The following code demonstrates another way to open the first available G35DDC device set using device set enumerator.

#include <stdio.h>

#include "G35DDCAPI.h"



void main(void)

{

 G3XDDCAPI_CREATE_INSTANCE CreateInstance;

 HMODULE hAPI;

 ICohG35DDCDeviceSetEnumerator *Enumerator=NULL;

 G35DDC_DEVICE_INFO *DevInfo;

 UINT32 Count;

 UINT32 SetCount,i,j;

 ICohG35DDCDeviceSet *DeviceSet;



    hAPI=LoadLibrary("G35DDCAPI.dll");



    if(hAPI!=NULL)

    {

        CreateInstance=(G3XDDCAPI_CREATE_INSTANCE)GetProcAddress(hAPI,"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(i,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=%08X\n",GetLastError());

                }

                    

                DeviceSet->Release();

                

                delete[] DevInfo;                

            }

            else

            {

                printf("No available G35DDC device set found.\n");

            }



            Enumerator->Release();

        }

        else

        {

            printf("Failed to create enumerator object. Error code=%08X\n",GetLastError());

        }



        FreeLibrary(hAPI);

    }

    else

    {

        printf("Failed to load G35DDCAPI.dll.\n");

    }



    printf("Press enter to exit\n");

    getchar();

}

CreateInstance

Creates single object of the specified class and returns interface of the object.

C/C++ declaration

INT32 __stdcall CreateInstance(UINT32 ClassId,PVOID *Interface);

Address retrieval

G3XDDCAPI_CREATE_INSTANCE CreateInstance=(G3XDDCAPI_CREATE_INSTANCE)GetProcAddress(hAPI,"CreateInstance");

Parameters

ClassId
[in] Specifies class identifier of the object to be created. This parameter must be one of the following:

ValueMeaning
G35DDC_CLASS_ID_COH_DEVICE_SET_ENUMERATORClass identifier of the enumerator object. When the function finished successfully, ICohG35DDCDeviceSetEnumerator interface is stored to pointer variable pointed to by the Interface parameter.
G35DDC_CLASS_ID_COH_DEVICE_SETClass 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, call GetLastError.

Remarks

All the objects created using CreateInstance must be freed releasing their interfaces using 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 become to unpredictable state.


ICohG35DDCDeviceSetEnumerator interface

ICohG35DDCDeviceSetEnumerator interface is the interface of the enumerator object that is created using the CreateInstance function and that provides enumeration mechanism of available G35DDC devices sets.


ICohG35DDCDeviceSetEnumerator::AddRef

Increases the reference count to the enumerator object.

C/C++ declaration

LONG __stdcall AddRef(void);

Parameters

None

Return value

The method returns resulting reference count.

Remarks

Initial reference count of an object created using CreateInstance function is 1.

ICohG35DDCDeviceSetEnumerator::Release

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

LONG __stdcall Release(void);

Parameters

None

Return value

The method returns resulting reference count. If the return value is zero, the object was freed.

ICohG35DDCDeviceSetEnumerator::Enumerate

Performs enumeration of available G35DDC devices sets in coherent mode.

C/C++ declaration

BOOL __stdcall 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, call GetLastError.

ICohG35DDCDeviceSetEnumerator::GetDeviceSetCount

Retrieves number of available G35DDC devices sets enumerated using the ICohG35DDCDeviceSetEnumerator::Enumerate method.

C/C++ declaration

UINT32 __stdcall GetDeviceSetCount(void);

Parameters

None

Return value

The method returns number of available G35DDC device sets.

ICohG35DDCDeviceSetEnumerator::GetDeviceSetInfo

Retrieves information about available G35DDC device set.

C/C++ declaration

BOOL __stdcall GetDeviceSetInfo(UINT32 SetIndex,G35DDC_DEVICE_INFO *DeviceInfos,UINT32 *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 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 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 (GetLastError returns ERROR_INSUFFICIENT_BUFFER) 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, call GetLastError.

ICohG35DDCDeviceSet interface

ICohG35DDCDeviceSet interface is an interface of the device set object that is created using the CreateInstance function. This interface allows to control selected G35DDC device set in coherent mode.


ICohG35DDCDeviceSet::AddRef

Increases the reference count to the device set object.

C/C++ declaration

LONG __stdcall AddRef(void);

Parameters

None

Return value

The method returns resulting reference count.

Remarks

Initial reference count of an object created using CreateInstance function is 1.

ICohG35DDCDeviceSet::Release

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

LONG __stdcall Release(void);

Parameters

None

Return value

The method returns resulting reference count. If the return value is zero, the object was freed.

ICohG35DDCDeviceSet::Open

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

BOOL __stdcall Open(G35DDC_DEVICE_INFO *DeviceInfos,UINT32 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 open. Number of items in the array is given by the Count parameter. Order of device info structures in the array has to correspond to hardware interconnect of G35DDC devices. Array of device info structures and its size can be obtained using the ICohG35DDCDeviceSetEnumerator. The example above shows how to do it.

It is possible to use one of the following predefined values instead of pointer to the array:
ValueMeaning
G35DDC_OPEN_FIRST_SETThe method opens first available G35DDC device set. The Count parameter is ignored, number of interconnected devices is determined automatically.
G35DDC_OPEN_DEMO_SETThe method opens demo G35DDC device set. This allows to work with the API without physical G35DDC devices. The Count parameter specifies 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, call GetLastError.

Remarks

Order of devices in the device set corresponds to hardware interconnect of the G35DDC devices. Each individual devices in the device set has its own constant index that does not change while hardware G35DDC device interconnect is 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..


ICohG35DDCDeviceSet::Close

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 __stdcall Close(void);

Parameters

None

Return value

None

Remarks

If no open G35DDC device set is associated with the object, the Close method does nothing.

ICohG35DDCDeviceSet::IsConnected

Checks if all the devices in the device set are still connected to the computer.

C/C++ declaration

BOOL __stdcall IsConnected(void);

Parameters

None

Return value

The method returns non-zero value if all the devices in the set are still connected.
If a device is disconnected or the method fails return value is zero. To determine if the method failed, call GetLastError. GetLastError returns ERROR_SUCCESS if a device is disconnected or another error code if IsConnected failed.

Remarks

If it is determined the device is disconnected, the application should call the ICohG35DDCDeviceSet::Close.

ICohG35DDCDeviceSet::GetDeviceCount

Retrieves number of G35DDC devices in the device set.

C/C++ declaration

BOOL __stdcall GetDeviceCount(UINT32 *Count);

Parameters

Count
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::GetDeviceInfo

Retrieves information about the G35DDC device in the device set.

C/C++ declaration

BOOL __stdcall GetDeviceInfo(UINT32 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 number of devices in the device set. Order of the devices corresponds to hardware interconnect 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetDeviceCount method to determine number of devices in the device set.

ICohG35DDCDeviceSet::GetDeviceInfos

Retrieves information about all the G35DDC devices in the device set at once.

C/C++ declaration

BOOL __stdcall GetDeviceInfos(G35DDC_DEVICE_INFO *Infos,UINT32 *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 interconnect of physical G35DDC devices.
InfoCount
[in, out] Pointer to a variable that specifies size of the array (number of items in the array) pointed to by the Infos parameter. When the method returns, this variable contains 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 returns fails (GetLastError returns ERROR_INSUFFICIENT_BUFFER) 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetDeviceCount method to determine number of devices in the device set.

ICohG35DDCDeviceSet::SetPower

Turns on or off all the G35DDC devices in the device set.

C/C++ declaration

BOOL __stdcall SetPower(BOOL 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 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, call GetLastError.

Remarks

If ICohG35DDCDeviceSet::SetPower turns the devices off, all the running streams are stopped.

Use the ICohG35DDCDeviceSet::GetPower method to determine current power state of devices in the device set.


ICohG35DDCDeviceSet::GetPower

The GetPower method determines whether the devices are turned on or off.

C/C++ declaration

BOOL __stdcall GetPower(BOOL *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, call GetLastError.

ICohG35DDCDeviceSet::SetAttenuator

Sets input attenuator.

C/C++ declaration

BOOL __stdcall SetAttenuator(UINT32 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 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetAttenuator method to determine current setting of the attenuator.

ICohG35DDCDeviceSet::GetAttenuator

Retrieves current setting of the attenuator.

C/C++ declaration

BOOL __stdcall GetAttenuator(UINT32 *Attenuator);

Parameters

Attenuator
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetPreselectors

Controls the band pass filter at input.

C/C++ declaration

BOOL __stdcall SetPreselectors(UINT32 Low,UINT32 High);

Parameters

Low
[in] Specifies 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 nearest one.
High
[in] Specifies 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 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, call GetLastError.

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 current setting of the preselectors.


ICohG35DDCDeviceSet::GetPreselectors

Retrieves current setting of input band pass filter.

C/C++ declaration

BOOL __stdcall GetPreselectors(UINT32 *Low,UINT32 *High);

Parameters

Low
[out] Pointer to a variable that receives 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 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, call GetLastError.

ICohG35DDCDeviceSet::SetPreamp

Enables or disables input preamplifier.

C/C++ declaration

BOOL __stdcall SetPreamp(BOOL Preamp);

Parameters

Preamp
[in] Specifies whether to enable or disable 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 current state of the preamplifier.


ICohG35DDCDeviceSet::GetPreamp

Retrieves current state of input preamplifier.

C/C++ declaration

BOOL __stdcall GetPreamp(BOOL *Preamp);

Parameters

Preamp
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetADCNoiseBlanker

Enables or disables noise blanker on ADC stream.

C/C++ declaration

BOOL __stdcall SetADCNoiseBlanker(BOOL Enabled);

Parameters

Enabled
[in] Specifies whether to enable or disable 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetADCNoiseBlanker method to determine current state of the noise blanker.

ICohG35DDCDeviceSet::GetADCNoiseBlanker

Retrieves current ADC noise blanker state.

C/C++ declaration

BOOL __stdcall GetADCNoiseBlanker(BOOL *Enabled);

Parameters

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, call GetLastError.

ICohG35DDCDeviceSet::SetADCNoiseBlankerThreshold

Specifies ADC noise blanker threshold.

C/C++ declaration

BOOL __stdcall SetADCNoiseBlankerThreshold(WORD Threshold);

Parameters

Threshold
[in] Specifies the maximum acceptable input signal. Maximum possible value of threshold is 32767, in this case the noise blanker has no effect even 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetADCNoiseBlankerThreshold method to retrieve current threshold of the noise blanker.

ICohG35DDCDeviceSet::GetADCNoiseBlankerThreshold

Determines ADC noise blanker threshold.

C/C++ declaration

BOOL __stdcall GetADCNoiseBlankerThreshold(WORD *Threshold);

Parameters

Threshold
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::StartIF

Starts sending of IF snapshots from specific device of the device set.

C/C++ declaration

BOOL __stdcall StartIF(UINT32 DeviceIndex,WORD Period);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Period
[in] Specifies time interval in milliseconds how often the IF snapshot is taken and sent to 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, call GetLastError.

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.


ICohG35DDCDeviceSet::StopIF

Stops sending of IF snapshots from specific device of the device set.

C/C++ declaration

BOOL __stdcall StopIF(UINT32 DeviceIndex,);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than 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, call GetLastError.

Remarks

The ICohG35DDCDeviceSetCallback::CohG35DDC_IFCallback callback is not called after ICohG35DDCDeviceSet::StopIF returns.


ICohG35DDCDeviceSet::SetInverted

Enables or disables frequency spectrum inversion.

C/C++ declaration

BOOL __stdcall etInverted(BOOL 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, call GetLastError.

ICohG35DDCDeviceSet::GetInverted

Retrieves current frequency spectrum inversion setting.

C/C++ declaration

BOOL __stdcall GetInverted(BOOL *Inverted);

Parameters

Inverted
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::GetDDCInfo

Retrieves information about DDC format.

C/C++ declaration

BOOL __stdcall GetDDCInfo(UINT32 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, call GetLastError.

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 current DDC type index of DDC1 and the ICohG35DDCDeviceSet::GetDDC2 method to determine current DDC type of DDC2.


ICohG35DDCDeviceSet::GetDDC1Count

Retrieves number of DDC types supported by DDC1.

C/C++ declaration

BOOL __stdcall GetDDC1Count(UINT32 *Count);

Parameters

Count
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDDC1

Sets current DDC type of DDC1.

C/C++ declaration

BOOL __stdcall SetDDC1(UINT32 DDCTypeIndex);

Parameters

DDCTypeIndex
[in] Specifies index of DDC type to be used in DDC1. It can vary from zero to one less than 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, call GetLastError.

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 that 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 DDC type of DDC1.

Calling of ICohG35DDCDeviceSet::SetDDC1 can change 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 current DDC type of DDC2 and current bandwidth of demodulator filter.

Use the ICohG35DDCDeviceSet::GetDDC1 method to determine current DDC type of the DDC1.


ICohG35DDCDeviceSet::GetDDC1

Retrieves information about current DDC type of the DDC1.

C/C++ declaration

BOOL __stdcall GetDDC1(UINT32 *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 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, call GetLastError.

Remarks

Returned DDCTypeIndex can be passed to the ICohG35DDCDeviceSet::GetDDCInfo method.

ICohG35DDCDeviceSet::SetDDC1Frequency

Sets DDC1 center frequency.

C/C++ declaration

BOOL __stdcall SetDDC1Frequency(UINT32 Frequency);

Parameters

Frequency
[in] Specifies 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, call GetLastError.

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 current center frequency of DDC1.


ICohG35DDCDeviceSet::GetDDC1Frequency

Retrieves current center frequency of DDC1.

C/C++ declaration

BOOL __stdcall GetDDC1Frequency(UINT32 *Frequency);

Parameters

Frequency
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDDC1PhaseShift

Sets phase shift of DDC1 signal for specific device in the device set.

C/C++ declaration

BOOL __stdcall SetDDC1PhaseShift(UINT32 DeviceIndex,double PhaseShift);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
PhaseShift
[in] Specifies new phase shift of DDC1 signal in degrees at 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, call GetLastError.

Remarks

It can be used for compensation of small length differences of cables used for coherent clock or at receiver RF inputs.

Use the ICohG35DDCDeviceSet::GetDDC1PhaseShift method to retrieve current phase shift of DDC1 signal.


ICohG35DDCDeviceSet::GetDDC1PhaseShift

Retrieves current phase shift of DDC1 signal of specific device in the device set.

C/C++ declaration

BOOL __stdcall GetDDC1PhaseShift(UINT32 DeviceIndex,double *PhaseShift);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
PhaseShift
[out] Pointer to a variable that receives current phase shift of 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, call GetLastError.

ICohG35DDCDeviceSet::StartDDC1

Starts coherent DDC1 streaming on all the devices in the set simultaneously.

C/C++ declaration

BOOL __stdcall StartDDC1(UINT32 SamplesPerBuffer);

Parameters

SamplesPerBuffer
[in] Specifies number of I/Q sample sets in each buffer passed to the the ICohG35DDCDeviceSetCallback::CohG35DDC_DDC1StreamCallback callback. The value has to be multiple of 64 greater than zero. If it is zero, the ICohG35DDCDeviceSet::StartDDC1 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, call GetLastError.

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 value of the SamplesPerBuffer parameter decreases latency and it may increase CPU usage. Increasing value of the SamplesPerBuffer parameter increases latency and it may decrease CPU usage.


ICohG35DDCDeviceSet::StopDDC1

Stops DDC1 streaming on all the devices of the device set.

C/C++ declaration

BOOL __stdcall 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, call GetLastError.

Remarks

The ICohG35DDCDeviceSet::StopDDC1 method stops all the streaming beyond the DDC1 in 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.


ICohG35DDCDeviceSet::GetDDC2

Retrieves information about current DDC type of the DDC2.

C/C++ declaration

BOOL __stdcall GetDDC2(UINT32 *DDCTypeIndex,G3XDDC_DDC_INFO *DDCInfo);

Parameters

DDCTypeIndex
[out] Pointer to a variable that receives index of 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 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, call GetLastError.

Remarks

DDC type of DDC2 in each device is the same and it depends on DDC type of DDC1, it cannot be changed by the application directly. DDC type of DDC2 is equal to 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 DDC type index of DDC1 is above 5, DDC type index of DDC2 is always 5. Changing of DDC type of DDC1 can cause change of DDC type of DDC2, so it is useful to call ICohG35DDCDeviceSet::GetDDC2 immediately after the ICohG35DDCDeviceSet::SetDDC1 method to determine 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.


ICohG35DDCDeviceSet::SetDDC2Frequency

Sets relative center frequency of DDC2 for specified device of the device set.

C/C++ declaration

BOOL __stdcall SetDDC2Frequency(UINT32 DeviceIndex,INT32 Frequency);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Frequency
[in] Specifies 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, call GetLastError.

Remarks

Value of the Frequency parameter is center frequency of the DDC2 relative to center of the DDC1. The value can be negative.

Absolute frequency of the DDC2 is given by the following formula:

faDDC2 = fDDC1 + frDDC2

Where faDDC2 is absolute center frequency of DDC2, fDDC1 is center frequency of the DDC1 in Hz (set using the ICohG35DDCDeviceSet::SetDDC1Frequency method) and frDDC2 is relative center frequency of DDC2 in Hz (set using ICohG35DDCDeviceSet::SetDDC2Frequency).

Changing of DDC2 relative frequency changes absolute frequency of the DDC2 and demodulator of specified device.

Use the ICohG35DDCDeviceSet::GetDDC2Frequency method to determine current relative center frequency of the DDC2.

The following example shows three methods how it is possible to set 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);


ICohG35DDCDeviceSet::GetDDC2Frequency

Retrieves current relative DDC2 center frequency of specified device in the device set.

C/C++ declaration

BOOL __stdcall GetDDC2Frequency(UINT32 DeviceIndex,INT32 *Frequency);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Frequency
[out] Pointer to a variable that receives 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 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, call GetLastError.

ICohG35DDCDeviceSet::StartDDC2

Starts DDC2 streaming on specified device.

C/C++ declaration

BOOL __stdcall StartDDC2(UINT32 DeviceIndex,UINT32 SamplesPerBuffer);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
SamplesPerBuffer
[in] Specifies number of I/Q sample sets in each buffer passed to the 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 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, call GetLastError.

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 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 give device. ICohG35DDCDeviceSet::StartDDC2 does not restart audio streaming.

Use the ICohG35DDCDeviceSet::StopDDC2 method to stop DDC2 streaming.

Decreasing value of the SamplesPerBuffer parameter decreases latency and it may increase CPU usage. Increasing value of the SamplesPerBuffer parameter increases latency and it may decrease CPU usage.


ICohG35DDCDeviceSet::StopDDC2

Stops DDC2 streaming on specified device.

C/C++ declaration

BOOL __stdcall StopDDC2(UINT32 DeviceIndex);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than 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, call GetLastError.

Remarks

If audio streaming for 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.


ICohG35DDCDeviceSet::SetDDC2NoiseBlanker

Enables or disables noise blanker on DDC2 stream of specified device.

C/C++ declaration

BOOL __stdcall SetDDC2NoiseBlanker(UINT32 DeviceIndex,BOOL Enabled);

Parameters

DeviceIndex
[in] Specifies index of 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 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetDDC2NoiseBlanker method to determine current state of the noise blanker.

ICohG35DDCDeviceSet::GetDDC2NoiseBlanker

Retrieves current DDC2 noise blanker state of specified device.

C/C++ declaration

BOOL __stdcall GetDDC2NoiseBlanker(UINT32 DeviceIndex,BOOL *Enabled);

Parameters

DeviceIndex
[in] Specifies index of 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 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, call GetLastError.

ICohG35DDCDeviceSet::SetDDC2NoiseBlankerThreshold

Specifies DDC2 noise blanker threshold of specified device.

C/C++ declaration

BOOL __stdcall SetDDC2NoiseBlankerThreshold(UINT32 DeviceIndex,double Threshold);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetDDC2NoiseBlankerThreshold method to retrieve current threshold of the noise blanker.

ICohG35DDCDeviceSet::GetDDC2NoiseBlankerThreshold

Retrieves DDC2 noise blanker threshold of specified device.

C/C++ declaration

BOOL __stdcall GetDDC2NoiseBlankerThreshold(UINT32 DeviceIndex,double *Threshold);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Threshold
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::GetDDC2NoiseBlankerExcessValue

Determines value which indicates percentage ratio between short time average signal level and maximum level.

C/C++ declaration

BOOL __stdcall GetDDC2NoiseBlankerExcessValue(UINT32 DeviceIndex,double *Value);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than 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, call GetLastError.

ICohG35DDCDeviceSet::GetSignalLevel

Determines current signal level for specified device.

C/C++ declaration

BOOL __stdcall GetSignalLevel(UINT32 DeviceIndex,FLOAT *Peak,FLOAT *RMS);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Peak
[out] Pointer to a variable that receives 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 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, call GetLastError.

Remarks

DDC2 streaming has to be active (started using the ICohG35DDCDeviceSet::StartDDC2 method) before calling of ICohG35DDCDeviceSet::GetSignalLevel, otherwise returned peak and RMS signal levels are zero.

Signal level is evaluated from 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 that processed by the demoduletor 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 the callback, i.e. for each buffer used in signal level evaluation. This provides way to get signal level from each processed buffer without need of 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, P[dBm] is power in dBm and 1000 is conversion coefficient W -> mW.

The following example shows how to obtain 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);


ICohG35DDCDeviceSet::SetNotchFilter

Enables or disables notch filter of specified device.

C/C++ declaration

BOOL __stdcall SetNotchFilter(UINT32 DeviceIndex,UINT32 NotchFilterIndex,BOOL Enabled);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Enabled
[in] Specifies whether to enable or disable 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetNotchFilter method to determine whether the filter is enabled or disabled.

ICohG35DDCDeviceSet::GetNotchFilter

Retrieves current notch filter state of specified device.

C/C++ declaration

BOOL __stdcall GetNotchFilter(UINT32 DeviceIndex,UINT32 NotchFilterIndex,BOOL *Enabled);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Enabled
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetNotchFilterFrequency

Specifies relative center frequency of the notch filter for specified device.

C/C++ declaration

BOOL __stdcall SetNotchFilterFrequency(UINT32 DeviceIndex,UINT32 NotchFilterIndex,INT32 Frequency);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Frequency
[in] Specifies 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, call GetLastError.

Remarks

Value of the Frequency parameter is 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 current center frequency of the notch filter.


ICohG35DDCDeviceSet::GetNotchFilterFrequency

Retrieves current relative center frequency of the notch filter.

C/C++ declaration

BOOL __stdcall GetNotchFilterFrequency(UINT32 DeviceIndex,UINT32 NotchFilterIndex,INT32 *Frequency);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Frequency
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetNotchFilterBandwidth

Specifies bandwidth of the notch filter of specified device.

C/C++ declaration

BOOL __stdcall SetNotchFilterBandwidth(UINT32 DeviceIndex,UINT32 NotchFilterIndex,UINT32 Bandwidth);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Bandwidth
[in] Specifies 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetNotchFilterBandwidth method to retrieve current bandwidth of the notch filter.


ICohG35DDCDeviceSet::GetNotchFilterBandwidth

Retrieves current bandwidth of the notch filter for specified device.

C/C++ declaration

BOOL __stdcall GetNotchFilterBandwidth(UINT32 DeviceIndex,UINT32 NotchFilterIndex,UINT32 *Bandwidth);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Bandwidth
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetNotchFilterLength

Specifies notch filter length for specified device. The notch filter is implemented as FIR filter. This method specifies number of coefficients used in filtration procedure.

C/C++ declaration

BOOL __stdcall SetNotchFilterLength(UINT32 DeviceIndex,UINT32 NotchFilterIndex,UINT32 Length);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies 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 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, call GetLastError.

Remarks

Increasing the filter length increases filter steepness and it may increase CPU usage.

Use the ICohG35DDCDeviceSet::GetNotchFilterLength method to determine current length of the notch filter.


ICohG35DDCDeviceSet::GetNotchFilterLength

Retrieves current notch filter length of specified device.

C/C++ declaration

BOOL __stdcall GetNotchFilterLength(UINT32 DeviceIndex,UINT32 NotchFilterIndex,UINT32 *Length);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
NotchFilterIndex
[in] Specifies notch filter index. Possible values are: 0, 1.
Length
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetAGC

Enables or disables AGC for specified device.

C/C++ declaration

BOOL __stdcall SetAGC(UINT32 DeviceIndex,BOOL Enabled);

Parameters

DeviceIndex
[in] Specifies index of 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 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, call GetLastError.

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 current state of the AGC.


ICohG35DDCDeviceSet::GetAGC

Retrieves current state of the AGC for specified device.

C/C++ declaration

BOOL __stdcall GetAGC(UINT32 DeviceIndex,BOOL *Enabled);

Parameters

DeviceIndex
[in] Specifies index of 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 that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetAGCParams

Sets parameters of the AGC of specified device.

C/C++ declaration

BOOL __stdcall SetAGCParams(UINT32 DeviceIndex,double AttackTime,double DecayTime,double ReferenceLevel);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
AttackTime
[in] Specifies new attack time of the AGC in seconds.
DecayTime
[in] Specifies new decay time of the AGC in seconds.
ReferenceLevel
[in] Specifies 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetAGCParams method to determine current parameters of the AGC.


ICohG35DDCDeviceSet::GetAGCParams

Retrieves current parameters of the AGC for specified device.

C/C++ declaration

BOOL __stdcall GetAGCParams(UINT32 DeviceIndex,double *AttackTime,double *DecayTime,double *ReferenceLevel);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
AttackTime
[out] Pointer to a variable that receives 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 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 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, call GetLastError.

ICohG35DDCDeviceSet::SetMaxAGCGain

Sets maximum gain of the AGC for specified device.

C/C++ declaration

BOOL __stdcall SetMaxAGCGain(UINT32 DeviceIndex,double MaxGain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
MaxGain
[in] Specifies 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetMaxAGCGain method to determine maximum gain of the AGC.


ICohG35DDCDeviceSet::GetMaxAGCGain

Retrieves current maximum gain of the AGC of specified device.

C/C++ declaration

BOOL __stdcall GetMaxAGCGain(UINT32 DeviceIndex,double *MaxGain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
MaxGain
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetGain

Sets fixed gain for specified device. This gain is applied to I/Q signal if the AGC is disabled, otherwise it is not used.

C/C++ declaration

BOOL __stdcall SetGain(UINT32 DeviceIndex,double Gain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Gain
[in] Specifies 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetGain method to determine current fixed gain.


ICohG35DDCDeviceSet::GetGain

Retrieves current fixed gain of specified device.

C/C++ declaration

BOOL __stdcall GetGain(UINT32 DeviceIndex,double *Gain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Gain
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::GetCurrentGain

Retrieves current gain that is applied to I/Q signal of specified device.

C/C++ declaration

BOOL __stdcall GetCurrentGain(UINT32 DeviceIndex,double *CurrentGain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
CurrentGain
[out] Pointer to a variable that receives 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, call GetLastError.

Remarks

If the AGC is enabled (using the ICohG35DDCDeviceSet::SetAGC method), the variable pointed to by the CurrentGain parameter is filled by 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.

ICohG35DDCDeviceSet::SetDemodulatorFilterBandwidth

Sets bandwidth of the demodulator filter of specified device.

C/C++ declaration

BOOL __stdcall SetDemodulatorFilterBandwidth(UINT32 DeviceIndex,UINT32 Bandwidth);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Bandwidth
[in] Specified new bandwidth of the demodulator filter in Hz. Possible values are from range 1 Hz to current DDC2 bandwidth. Use the ICohG35DDCDeviceSet::GetDDC2 method to retrieve information about 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, call GetLastError.

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 new bandwidth of DDC2, the demodulator filter bandwidth is reduced. So it is useful to call the ICohG35DDCDeviceSet::GetDemodulatorFilterBandwidth method immediately after ICohG35DDCDeviceSet::SetDDC1.

ICohG35DDCDeviceSet::GetDemodulatorFilterBandwidth

Retrieves current demodulator filter bandwidth of specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorFilterBandwidth(UINT32 DeviceIndex,UINT32 *Bandwidth);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Bandwidth
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDemodulatorFilterShift

Sets demodulator filter shift of specified device.

C/C++ declaration

BOOL __stdcall SetDemodulatorFilterShift(UINT32 DeviceIndex,INT32 Shift);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Shift
[in] Specified 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, call GetLastError.

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 shift the filter from demodulator's centre.

Use the ICohG35DDCDeviceSet::GetDemodulatorFilterShift method to determine current demodulator filter shift.


ICohG35DDCDeviceSet::GetDemodulatorFilterShift

Retrieves current shift of the demodulator filter for specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorFilterShift(UINT32 DeviceIndex,INT32 *Shift);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Shift
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDemodulatorFilterLength

Specifies demodulator filter length of specified device. The demodulator filter is implemented as FIR filter. This method specifies number of coefficients used in filtration procedure.

C/C++ declaration

BOOL __stdcall SetDemodulatorFilterLength(UINT32 DeviceIndex,UINT32 Length);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Length
[in] Specifies 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 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, call GetLastError.

Remarks

Increasing the filter length increases filter steepness and it may increase CPU usage.

Use the ICohG35DDCDeviceSet::GetDemodulatorFilterLength method to determine current length of the demodulator filter.


ICohG35DDCDeviceSet::GetDemodulatorFilterLength

Retrieves current length of the demodulator filter for specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorFilterLength(UINT32 DeviceIndex,UINT32 *Length);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Length
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDemodulatorMode

Sets demodulator mode of specified device.

C/C++ declaration

BOOL __stdcall SetDemodulatorMode(UINT32 DeviceIndex,UINT32 Mode);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Mode
[in] Specifies new demodulator mode. This value can be one of the following:

ValueMeaning
G3XDDC_MODE_CWContinuous wave
G3XDDC_MODE_AMAmplitude modulation
G3XDDC_MODE_FMFrequency modulation
G3XDDC_MODE_LSBLower sideband modulation
G3XDDC_MODE_USBUpper sideband modulation
G3XDDC_MODE_AMSAmplitude modulation
G3XDDC_MODE_DSBDouble sideband modulation
G3XDDC_MODE_ISBIndependent sideband modulation
G3XDDC_MODE_DRMDigital Radio Mondiale

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

DRM demodulation is only available if valid DRM key is loaded using the ICohG35DDCDeviceSet::SetDRMKey method. More information about obtaining DRM key at http://www.winradio.com/home/drm.htm.

Use the ICohG35DDCDeviceSet::GetDemodulatorMode method to retrieve current demodulator mode.


ICohG35DDCDeviceSet::GetDemodulatorMode

Retrieves current demodulator mode of specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorMode(UINT32 DeviceIndex,UINT32 *Mode);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Mode
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDemodulatorFrequency

Sets relative center frequency of demodulator for specified device.

C/C++ declaration

BOOL __stdcall SetDemodulatorFrequency(UINT32 DeviceIndex,INT32 Frequency);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Frequency
[in] Specified 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, call GetLastError.

Remarks

Value of the Frequency parameter is center frequency of the demodulator relative to center of the DDC2. The value can be negative.

Absolute frequency of the demodulator is given by the following formula:

faDEM = fDDC1 + frDDC2 + frDEM

Where faDEM is absolute center frequency of the demodulator in Hz, fDDC1 is center frequency of the DDC1 in Hz (set using the ICohG35DDCDeviceSet::SetDDC1Frequency method), frDDC2 is 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).

Absolute center frequency of the demodulator is the real-world frequency that you are listening to.

Use the ICohG35DDCDeviceSet::GetDemodulatorFrequency method to determine current relative center frequency of the demodulator for given device.

The following example shows four methods how it is possible to set absolute demodulator center frequency of 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);


ICohG35DDCDeviceSet::GetDemodulatorFrequency

Retrieves current relative center frequency of the demodulator for specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorFrequency(UINT32 DeviceIndex,INT32 *Frequency);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Frequency
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDemodulatorParam

Sets a parameter of demodulation of specified device.

C/C++ declaration

BOOL __stdcall SetDemodulatorParam(UINT32 DeviceIndex,UINT32 Code,CONST VOID *Buffer,UINT32 BufferSize);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Code
[in] Specifies code of the demodulator parameter to be set by the method. The code can be one of the following:

ValueMeaning
G3XDDC_DEMODULATOR_PARAM_AMS_SIDE_BAND

Side band for synchronous AM demodulation.

The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).

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 sideband

G3XDDC_SIDE_BAND_UPPER
AMS demodulator will use upper sideband

G3XDDC_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 variable, and the BufferSize parameter has to be sizeof(INT32).

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 variable, and the BufferSize parameter has to be sizeof(UINT32).

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 sideband

G3XDDC_SIDE_BAND_UPPER
DSB demodulator will use upper sideband

G3XDDC_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 variable, and the BufferSize parameter has to be sizeof(UINT32).

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 sideband

G3XDDC_SIDE_BAND_UPPER
ISB demodulator will use upper sideband

G3XDDC_SIDE_BAND_BOTH
ISB demodulator will use both side bands.

G3XDDC_DEMODULATOR_PARAM_DRM_AUDIO_SERVICE

Audio service of DRM demodulator/decoder to be listening to.

The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).

Value of the variable pointed to by the Buffer parameter is index of the audio service. Possible values are: 1, 2, 3, 4, where 1 is the first audio service, 2 is the second one, etc. Use the ICohG35DDCDeviceSet::GetDemodulatorState method with G3XDDC_DEMODULATOR_STATE_DRM_STATUS to retrieve information about available audio services for currently received DRM station.

G3XDDC_DEMODULATOR_PARAM_DRM_MULTIMEDIA_SERVICE

Multimedia service of DRM demodulator/decoder to be decoded.

The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).

Value of the variable pointed to by the Buffer parameter is index of the multimedia service. Possible values are: 1, 2, 3, 4, where 1 is the first audio service, 2 is the second one, etc. Use the ICohG35DDCDeviceSet::GetDemodulatorState method with G3XDDC_DEMODULATOR_STATE_DRM_STATUS to retrieve information about available multimedia services for currently received DRM station.

It is required that DRM multimedia player has to be installed to display multimedia content. It is included in G35DDC software installer as optional.

Buffer
[in] Pointer to a buffer containing value of the demodulator parameter the 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, call GetLastError.

ICohG35DDCDeviceSet::GetDemodulatorParam

Retrieves a parameter of demodulation of specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorParam(UINT32 DeviceIndex,UINT32 Code,VOID *Buffer,UINT32 BufferSize);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Code
[in] Specifies code of the demodulator parameter to be retrieved. For detailed information about available codes see SetDemodulatorParam.
Buffer
[out] Pointer to a buffer that receives 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, call GetLastError.

ICohG35DDCDeviceSet::GetDemodulatorState

Retrieves information about current demodulator state of specified device.

C/C++ declaration

BOOL __stdcall GetDemodulatorState(UINT32 DeviceIndex,UINT32 Code,VOID *Buffer,UINT32 BufferSize);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Code
[in] Specifies code of the demodulator state to be retrieved. It can be one of the following:

ValueMeaning
G3XDDC_DEMODULATOR_STATE_AMS_LOCK

Lock state of synchronous AM demodulation.

The Buffer parameter has to be pointer to a BOOL variable, and the BufferSize parameter has to be sizeof(BOOL).

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 BOOL variable, and the BufferSize parameter has to be sizeof(BOOL).

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 variable, and the BufferSize parameter has to be sizeof(INT32).

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_DRM_STATUS

Status of DRM demodulator/decoder.

The Buffer parameter has to be pointer to a G3XDDC_DRM_STATUS structure, and the BufferSize parameter has to be sizeof(G3XDDC_DRM_STATUS).

G3XDDC_DEMODULATOR_STATE_FM_DEVIATION

Estimated frequency deviation in Hz.

The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).

Buffer
[out] Pointer to a buffer that receives 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, call GetLastError.

ICohG35DDCDeviceSet::StartAudio

Starts audio streaming for specified device.

C/C++ declaration

BOOL __stdcall StartAudio(UINT32 DeviceIndex,UINT32 SamplesPerBuffer);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
SamplesPerBuffer
[in] Specifies number of samples in each buffer passed to the 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, call GetLastError.

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 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 value of the SamplesPerBuffer parameter decreases latency and it may increase CPU usage. Increasing value of the SamplesPerBuffer parameter increases latency and it may decrease CPU usage.


ICohG35DDCDeviceSet::StopAudio

Stops audio streaming for specified device.

C/C++ declaration

BOOL __stdcall StopAudio(UINT32 DeviceIndex);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than 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, call GetLastError.

Remarks

If audio streaming is not active, ICohG35DDCDeviceSet::StopAudio does nothing.

The ICohG35DDCDeviceSetCallback::CohG35DDC_AudioStreamCallback callback are not called after ICohG35DDCDeviceSet::StopAudio returns.


ICohG35DDCDeviceSet::SetAudioGain

Sets fixed audio gain of specified device.

C/C++ declaration

BOOL __stdcall SetAudioGain(UINT32 DeviceIndex,double Gain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Gain
[in] Specifies 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetAudioGain method to retrieve current audio gain.

ICohG35DDCDeviceSet::GetAudioGain

Retrieves current fixed audio gain of specified device.

C/C++ declaration

BOOL __stdcall GetAudioGain(UINT32 DeviceIndex,double *Gain);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Gain
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetAudioFilter

Enabled or disables audio filter of device index.

C/C++ declaration

BOOL __stdcall SetAudioFilter(UINT32 DeviceIndex,BOOL Enabled);

Parameters

DeviceIndex
[in] Specifies index of 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 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetAudioFiler method to retrieve current state of the audio filter.

ICohG35DDCDeviceSet::GetAudioFilter

Retrieves current state of the audio filter for specific device.

C/C++ declaration

BOOL __stdcall GetAudioFilter(UINT32 DeviceIndex,BOOL *Enabled);

Parameters

DeviceIndex
[in] Specifies index of 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 that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetAudioFilterParams

Sets parameters of the audio filter for specified device.

C/C++ declaration

BOOL __stdcall SetAudioFilterParams(UINT32 DeviceIndex,UINT32 CutOffLow,UINT32 CutOffHigh,double Deemphasis);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
CutOffLow
[in] Specifies cut-off low frequency of the filter in Hz. This is the start frequency of filter's passband, it can be from range 0 to 23999 Hz. The value has to be less then the cut-off high frequency specified by the CutOffHigh parameter.
CutOffHigh
[in] Specifies cut-off high frequency of the filter in Hz. This is the end frequency of filter's passband it can be from range 1 - 24000 Hz. The value has to be greater than the cut-off low frequency specified by the CutOffLow parameter.
Deemphasis
[in] Specifies de-emphasis the filter in dB per octave. De-emphasis starts at cut-off low frequency of the filter. This value can be from range -9.9 to 0.0 dB/octave. Zero means the 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, call GetLastError.

Remarks

Use the ICohG35DDCDeviceSet::GetAudioFilerParams method to retrieve current parameters of the audio filter.

ICohG35DDCDeviceSet::GetAudioFilterParams

Retrieves current parameters of the audio filter for specified device.

C/C++ declaration

BOOL __stdcall GetAudioFilterParams(UINT32 DeviceIndex,UINT32 *CutOffLow,UINT32 *CutOffHigh,double *Deemphasis);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
CutOffLow
[out] Pointer to a variable that receives 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 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 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, call GetLastError.

ICohG35DDCDeviceSet::SetAudioFilterLength

Specifies audio filter length of specified device. The audio filter is implemented as FIR filter. This method specifies number of coefficients used in filtration procedure.

C/C++ declaration

BOOL __stdcall SetAudioFilterLength(UINT32 DeviceIndex,UINT32 Length);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Length
[in] Specifies 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 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, call GetLastError.

Remarks

Increasing the filter length increases filter steepness and it may increase CPU usage.

Use the ICohG35DDCDeviceSet::GetAudioFilterLength method to determine current length of the audio filter.


ICohG35DDCDeviceSet::GetAudioFilterLength

Retrieves current audio filter length of specified device.

C/C++ declaration

BOOL __stdcall GetAudioFilterLength(UINT32 DeviceIndex,UINT32 *Length);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Length
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetVolume

Sets audio volume of specified device.

C/C++ declaration

BOOL __stdcall SetVolume(UINT32 DeviceIndex,BYTE Volume);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Volume
[in] Specifies 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, call GetLastError.

Remarks

If the G35DDC receiver has audio output connector (optional), the ICohG35DDCDeviceSet::SetVolume method affects the audio signal level at this output (see also ICohG35DDCDeviceSet::SetDAC).

Use the ICohG35DDCDeviceSet::GetVolume method to retrieve current volume.


ICohG35DDCDeviceSet::GetVolume

Retrieve current volume of specified device.

C/C++ declaration

BOOL __stdcall GetVolume(UINT32 DeviceIndex,BYTE *Volume);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Volume
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetMute

Mutes or unmutes audio of specified device.

C/C++ declaration

BOOL __stdcall SetMute(UINT32 DeviceIndex,BOOL Mute);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than 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, call GetLastError.

Remarks

If the G35DDC receiver has audio output connector (optional), the ICohG35DDCDeviceSet::SetMute method affects the audio signal at this output (see also ICohG35DDCDeviceSet::SetDAC).

Use the ICohG35DDCDeviceSet::GetMute method to retrieve current mute state.


ICohG35DDCDeviceSet::GetMute

Retrieves current mute state of specified device.

C/C++ declaration

BOOL __stdcall GetMute(UINT32 DeviceIndex,BOOL *Mute);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Mute
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::SetDAC

Allows to route audio output to DAC (Digital-to-analog converter). DAC output is connected to audio output connector of the receiver.

C/C++ declaration

BOOL __stdcall SetDAC(UINT32 DeviceIndex,UINT32 DAC);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
DAC
[in] Specifies routed audio to the DAC.

BitMeaning
0If it is set, audio output is routed to left channel of the audio output connector.
1If it is set, audio output is routed to right channel of the audio output connector.
2 - 31Reserved. 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, call GetLastError.

Remarks

The audio output connector is optional. If the receiver does not have audio output connector, ICohG35DDCDeviceSet::SetDAC fails. The following example shows how to determine the receive has audio output connector.

    G35DDC_DEVICE_INFO DeviceInfo;

    ICohG35DDCDeviceSet *DeviceSet;  //Interface of the G35DDC device set object, created using CreateInstance function

    UINT32 DeviceIndex; //index of device in the device set

    

    DeviceSet->GetDeviceInfo(DeviceIndex,&DeviceInfo,sizeof(DeviceInfo));

    

    if(DeviceInfo.Flags & G35DDC_FLAGS_AUDIO_OUTPUT)

    {

        //the receiver has audio output connector

        //route audio output of all the channels to the audio output connector

        

        DeviceSet->SetDAC(0x3F);

    }

    else

    {

        //the receiver does not have audio output connector

    }


ICohG35DDCDeviceSet::GetDAC

Determines if audio output is routed to audio output connector (DAC).

C/C++ declaration

BOOL __stdcall GetDAC(UINT32 DeviceIndex,UINT32 *DAC);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
DAC
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSet::GetSpectrumCompensation

Determines compensation data for 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

BOOL __stdcall GetSpectrumCompensation(UINT32 DeviceIndex,UINT64 CenterFrequency,UINT32 Width,FLOAT *Buffer,UINT32 Count);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
CenterFrequency
[in] Specifies absolute center frequency of requested compensation data in Hz.
Width
[in] Specifies width of 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 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, call GetLastError.

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 AbsDDC2Frequency; //Absolute frequency of the DDC2

INT32 RelDDC2Frequency; //Relative frequency of the DDC2

UINT32 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 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 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 __stdcall MY_CALLBACK_OBJECT::CohG35DDC_DDC2StreamCallback(ICohG35DDCDeviceSet *DeviceSet,UINT32 DeviceIndex,CONST FLOAT *Buffer,UINT32 NumberOfSamples)

{

 UINT32 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.

}




ICohG35DDCDeviceSet::SetCallback

Registers 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

BOOL __stdcall SetCallback(ICohG35DDCDeviceSetCallback *Callback);

Parameters

Callback
[in] Interface to user-defined object to be registered as callback object. If this parameter is NULL, 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, call GetLastError.

ICohG35DDCDeviceSet::GetCallback

Returns pointer to current user-defined callback object.

C/C++ declaration

ICohG35DDCDeviceSetCallback* __stdcall GetCallback(void);

Parameters

None

Return value

The method returns pointer to current user-defined callback object, previously set by the ICohG35DDCDeviceSet::SetCallback method.

ICohG35DDCDeviceSet::SetDRMKey

Sets directory with DRM key file to unlock DRM demodulator/decoder.

C/C++ declaration

BOOL __stdcall SetDRMKey(CONST CHAR *DRMKeyFileDirectory);

Parameters

DRMKeyFileDirectory
[in] Pointer to a null-terminated string that specifies the directory which contains valid DRM key file.

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

If the specfied directory contains valid DRM key file, the key is loaded and the DRM demodulator/decoder is unlocked and available for use, otherwise the method fails.

If the DRM demodulator/decoder is already unlocked, the method does nothing.

Use the ICohG35DDCDeviceSet::IsDRMUnlocked method to determine whether DRM demodulator/decoder is unlocked or not.

Information about obtaining DRM key at http://www.winradio.com/home/drm.htm.


ICohG35DDCDeviceSet::IsDRMUnlocked

Determines whether DRM demodulator/decoder is unlocked or not.

C/C++ declaration

BOOL __stdcall IsDRMUnlocked(void);

Parameters

None

Return value

If the method succeeds and the DRM demodulator/decoder is unlocked, the return value is non-zero.
If the method fails or the DRM demodulator/decoder is locked, the return value is zero. To get extended error information, call GetLastError.

ICohG35DDCDeviceSet::GetTemperature

Retrieves current internal temperature of the G35DDC device in the device set.

C/C++ declaration

BOOL __stdcall GetTemperature(UINT32 DeviceIndex,UINT32 *Temperature);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Temperature
[out] Pointer to a variable that receives 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, call GetLastError.

Remarks

The G35DDC devices have to be turned on using the ICohG35DDCDeviceSet::SetPower method before ICohG35DDCDeviceSet::GetTemperature is used. Otherwise ICohG35DDCDeviceSet::GetTemperature fails.


ICohG35DDCDeviceSet::GetDeviceState

Retrieves current error state of the G35DDC device.

C/C++ declaration

BOOL __stdcall GetDeviceState(UINT32 DeviceIndex,UINT32 *State);

Parameters

DeviceIndex
[in] Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
State
[out] Pointer to a variable that receives 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, call GetLastError.

ICohG35DDCDeviceSetCallback interface

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 inside method of this interface, otherwise it can cause deadlock or the application can become to unpredictable state.


ICohG35DDCDeviceSetCallback::CohG35DDC_DDC1StreamCallback

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 __stdcall CohG35DDC_DDC1StreamCallback(ICohG35DDCDeviceSet *DeviceSet,UINT32 DeviceCount,CONST VOID **Buffers,UINT32 NumberOfSamples,UINT32 BitsPerSample);

Parameters

DeviceSet
Interface of the device set object which called the callback.
DeviceCount
Specifies 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).
Buffers
Pointer 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 used DDC type, see the ICohG35DDCDeviceSet::SetDDC1 method. One I/Q sample set consists of two samples. Order of the buffers in the array corresponds to hardware interconnect of G35DDC devices.
NumberOfSamples
Specifies 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.
BitsPerSample
Specifies 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, sample is 16bit integer (32bits per I/Q sample set), signed, little endian, from range -32768 to 32767. If it is 32, sample is 32bit integer (64bits per I/Q sample set), signed, little endian, from range -2147483648 to 2147483647.

ICohG35DDCDeviceSetCallback::CohG35DDC_IFCallback

It is called by the API to pass IF snapshots to the application from specific device of the device set. Sending of IF snapshots is started using the ICohG35DDCDeviceSet::StartIF method.

C/C++ declaration

VOID __stdcall CohG35DDC_IFCallback(ICohG35DDCDeviceSet *DeviceSet,UINT32 DeviceIndex,CONST SHORT *Buffer,UINT32 NumberOfSamples,

                             WORD MaxADCAmplitude,UINT32 ADCSamplingRate);

Parameters

DeviceSet
Interface of the device object which called the method.
DeviceIndex
Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Buffer
Pointer to the buffer which contains samples directly received from ADC. Sample rate is 100 MHz, sample is 16bit signed little endian.
NumberOfSamples
Specifies number of samples in the buffer pointed to be the Buffer parameter. This is usually 65536.
MaxADCAmplitude
Specifies 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.
ADCSamplingRate
Specifies sample rate of the ADC in Hz. It can vary a little bit because of temperature instability.

ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2StreamCallback

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 __stdcall CohG35DDC_DDC2StreamCallback(ICohG35DDCDeviceSet *DeviceSet,UINT32 DeviceIndex,CONST FLOAT *Buffer,UINT32 NumberOfSamples);

Parameters

DeviceSet
Interface of the device set object which called the method.
DeviceIndex
Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Buffer
Pointer 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 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.
NumberOfSamples
Specifies 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.

ICohG35DDCDeviceSetCallback::CohG35DDC_DDC2PreprocessedStreamCallback

It is called by the API to pass preprocessed 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 __stdcall CohG35DDC_DDC2PreprocessedStreamCallback(ICohG35DDCDeviceSet *Device,UINT32 DeviceIndex,CONST FLOAT *Buffer,

                    UINT32 NumberOfSamples,FLOAT SlevelPeak,FLOAT SlevelRMS);

Parameters

DeviceSet
Interface of the device set object which called the method.
DeviceIndex
Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Buffer
Pointer 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 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.
NumberOfSamples
Specifies 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.
SlevelPeak
Specifies peak signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter.
SlevelRMS
Specifies RMS signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter. For detailed information how to convert RMS signal level to dBm, see remarks of the ICohG35DDCDeviceSet::GetSignalLevel method.

ICohG35DDCDeviceSetCallback::CohG35DDC_AudioStreamCallback

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 __stdcall CohG35DDC_AudioStreamCallback(ICohG35DDCDeviceSet *Device,UINT32 DeviceIndex,UINT32 Type,CONST FLOAT *Buffer,UINT32 NumberOfSamples);

Parameters

DeviceSet
Interface of the device set object which called the method.
DeviceIndex
Specifies index of device in the device set. It can vary from zero to one less than number of devices in the device set.
Type
Specifies type (stage) of audio samples stored in the buffer pointed to by the Buffer parameter. Value of this parameter can be one of the following:

ValueMeaning
0The buffer contains audio samples affected by audio gain (see ICohG35DDCDeviceSet::SetAudioGain).
1The buffer contains audio samples affected by audio gain and audio filter (see ICohG35DDCDeviceSet::SetAudioGain and ICohG35DDCDeviceSet::SetAudioFilter).
2The buffer contains audio samples affected by audio gain, audio filter and volume (see ICohG35DDCDeviceSet::SetAudioGain, ICohG35DDCDeviceSet::SetAudioFilter, ICohG35DDCDeviceSet::SetVolume and ICohG35DDCDeviceSet::SetMute).
Buffer
Pointer to the buffer which contains samples of audio signal. The signal is mono, sample rate is 48000 Hz, sample is 32bit IEEE float from range -1.0 to 1.0.
NumberOfSamples
Specifies number of samples stored in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the ICohG35DDCDeviceSet::StartAudio function.

Structures

G35DDC_DEVICE_INFO

Contains information about G35DDC device.

C/C++ declaration


#pragma pack(push,1)



typedef struct

{

    CHAR        DevicePath[MAX_PATH];

    BYTE        InterfaceType;

    CHAR        SerialNumber[9];

    WORD        HWVersion;

    WORD        FWVersion;

    BYTE        EEPROMVersion;    

    UINT32      Flags;

    UINT32      ChannelCount;

    UINT32      DDCTypeCount;   

} G35DDC_DEVICE_INFO;



#pragma pack(pop

Members

DevicePath
Device system path in a null-terminated string. It is used to open the device using object interface.
InterfaceType

Device 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.

SerialNumber
Serial number in null-terminated string.
HWVersion
Version of the hardware.
FWVersion
Version of the firmware.
EEPROMVersion
EEPROM structure version.
Flags
Hardware configuration flags. It can be combination of the following values:

ValueMeaning
G35DDC_FLAGS_EXTERNAL_REFERENCEThe device supports external reference.
G35DDC_FLAGS_AUDIO_OUTPUTThe device has audio output connector.
G35DDC_FLAGS_COHERENTThe device supports coherent mode.

ChannelCount
Number of channels. It is always 3. In coherent mode each device has single processing channel.
DDCTypeCount
Number of DDC types supported by the DDC1.

G3XDDC_DDC_INFO

Contains information about DDC type.

C/C++ declaration


#pragma pack(push,1)



typedef struct

{

    UINT32  SampleRate;

    UINT32  Bandwidth;

    UINT32  BitsPerSample;

} G3XDDC_DDC_INFO;



#pragma pack(pop

Members

SampleRate
Sample rate of I/Q signal in Hz.
Bandwidth
Useful bandwidth in Hz.
BitsPerSample
Number of bits per sample. It can be 16 or 32. It is used to determine bits per sample for DDC1.

G3XDDC_AMS_CAPTURE_RANGE

Contains information about DDC type.

C/C++ declaration


#pragma pack(push,1)



typedef struct

{

    UINT32  Tune;

    UINT32  Lock;

} G3XDDC_AMS_CAPTURE_RANGE;



#pragma pack(pop

Members

Tune
Initial capture range in Hz.
Lock
Capture range (in Hz) used when AMS demodulator is locked.

G3XDDC_DRM_STATUS

Contains information about DRM demodulator/decoder status.

C/C++ declaration


#pragma pack(push,1)



typedef struct

{

    BOOL            Valid;



    struct

    {

        BOOL        SyncFound;

        BOOL        FACDecoded;

        BOOL        SDCDecoded;

        BOOL        AudioDecoded;

        SHORT       NumberOfAudioFrames;

        SHORT       NumberOfAudioErrors;

    } DecodingState;



    INT32           Mode;

    double          RFBandwidth;

    BYTE            Interleaver;

    SHORT           SDCQam;

    SHORT           MSCQam;

    BYTE            MSCQamType;

    double          CoderateH;

    double          CoderateA;

    double          CoderateB;

    double          EstimatedSNR;

    WCHAR           TextMessage[128 + 1 + 16];

   

    struct

    {

        BYTE        Content;

        WCHAR       DynamicLabel[256];

        WCHAR       Country[256];

        WCHAR       Language[256];

        WCHAR       ProgramType[256];

        double      AudioBitrate;

        double      TextMsgBitrate;

        double      MultimediaBitrate;

        double      DataBitrate;

    } ServiceInfo[4];



    struct

    {

        BOOL        Valid;

        BYTE        AudioCoding;

        BOOL        SBR;

        INT32       AudioMode;

    } AudioDecoderInfo[4];

} G3XDDC_DRM_STATUS;



#pragma pack(pop)

Members

Valid
The value is non-zero if content of the structure is valid. It is zero, if content of the structure is not valid.
DecodingState

Structure that contains status of the decoder modules.

Members

SyncFound
Status of the sync detection. It is non-zero if sync detected.
FACDecoded
Status of the FAC decoder. It is non-zero if FAC decoded.
SDCDecoded
Status of the SDC decoder. It is non-zero if SDC decoded.
AudioDecoded
Status of the audio decoder. It is non-zero if audio decoded.
NumberOfAudioFrames
Number of audio frames in the transmission frame. It is -1 if this information is not available.
NumberOfAudioErrors
Number of audio frames that were invalid.
Mode
Used DRM robustness mode. It can be one of the following:

ValueMeaning
G3XDDC_DRM_STATE_MODE_NOT_DETERMINED_YETRobustness mode is not determined yet.
G3XDDC_DRM_STATE_MODE_ABroadcast is using DRM robustness mode A.
G3XDDC_DRM_STATE_MODE_BDRM robustness mode B.
G3XDDC_DRM_STATE_MODE_CDRM robustness mode C.
G3XDDC_DRM_STATE_MODE_DDRM robustness mode D.

RFBandwidth
Occupied RF bandwidth in kHz. It is zero if it is invalid or this information is not available (yet).
Interleaver
Interleaver length. It can be one of the following:

ValueMeaning
G3XDDC_DRM_STATE_INTERLEAVER_LONGLong interleaver used (2 sec).
G3XDDC_DRM_STATE_INTERLEAVER_SHORTShort interleaver used (400 msec).

SDCQam
Coding of the SDC (QAM). It is zero if this information is not available (yet).
MSCQam
Coding of the MSC (QAM). It is zero if this information is not available (yet).
MSCQamType
Used QAM coding for the MSC. It can be one of the following:

ValueMeaning
G3XDDC_DRM_STATE_QAM_TYPE_STDStandard
G3XDDC_DRM_STATE_QAM_TYPE_HIER_SYMHierarchical symmetrical
G3XDDC_DRM_STATE_QAM_TYPE_HIER_MIXHierarchical mixed

CoderateH
Used code-rate for hierarchical coding, values less than or equal to zero indicate not available or not used.
CoderateA
Used code-rate for protection level A, values less than or equal to zero indicate indicate not available or not used.
CoderateB
Used code-rate for protection level B, values less than or equal to zero indicate indicate not available or not used.
EstimatedSNR
Estimated SNR in dB of the decoded signal.
TextMessage
Decoded text message for the selected service in 16bit Unicode null-terminated string.
ServiceInfo

Array of four structures which contain general information on the services.

Members

Content
Type of the service. It can be combination of the following:

ValueMeaning
G3XDDC_DRM_STATE_SERVICE_CONTENT_EMPTYGiven service is not used, it contains no data, all other members of the structure are invalid.
G3XDDC_DRM_STATE_SERVICE_CONTENT_AUDIOGiven service contains audio data.
G3XDDC_DRM_STATE_SERVICE_CONTENT_TEXTMSGGiven service contains text messages.
G3XDDC_DRM_STATE_SERVICE_CONTENT_MULTIMEDIAGiven service contains multimedia data.
G3XDDC_DRM_STATE_SERVICE_CONTENT_DATAGiven service contains application specific data.

DynamicLabel
16bit Unicode null-terminated string containing dynamic label of the service.
Country
16bit Unicode null-terminated string containing the signaled country for this service.
Language
16bit Unicode null-terminated string containing the signaled language for this service.
ProgramType
16bit Unicode null-terminated string containing the signaled program type for this service.
AudioBitrate
Data rate for the audio content. It is zero if this information is not available.
TextMsgBitrate
Data rate for the text message content. It is zero if this information is not available.
MultimediaBitrate
Data rate for the multimedia content. It is zero if this information is not available.
DataBitrate
Data rate for the data content. It is zero if this information is not available.
AudioDecoderInfo

Array of four structures which contain audio decoder specific information on the services.

Members

Valid
If it is non-zero, audio decoder information are valid, if it is zero, audio decoder information are invalid and all other members of the structure contain no valid data.
AudioCoding
Used audio coding. It can be one of the following:

ValueMeaning
G3XDDC_DRM_STATE_AUDIO_CODING_AACAudio coding for given service is AAC.
G3XDDC_DRM_STATE_AUDIO_CODING_CELPAudio coding for given service is CELP.
G3XDDC_DRM_STATE_AUDIO_CODING_HVXCAudio coding for given service is HVXC.
G3XDDC_DRM_STATE_AUDIO_CODING_RFUReserved for future use.

SBR
If it is non-zero, SBR is used, if it is zero, SBR is not used.
AudioMode
The value depends on audio coding. It can be one of the following:

ValueMeaning
G3XDDC_DRM_STATE_AUDIO_MODE_AAC_MONOMono
G3XDDC_DRM_STATE_AUDIO_MODE_AAC_PARAM_STEREOParametric stereo
G3XDDC_DRM_STATE_AUDIO_MODE_AAC_STEREOStereo
G3XDDC_DRM_STATE_AUDIO_MODE_AAC_RFUReserved for future use
G3XDDC_DRM_STATE_AUDIO_MODE_CELP_NO_CRCAudio data is without CRC
G3XDDC_DRM_STATE_AUDIO_MODE_CELP_CRCCRC used
G3XDDC_DRM_STATE_AUDIO_MODE_CELP_RFU_10Reserved for future use
G3XDDC_DRM_STATE_AUDIO_MODE_CELP_RFU_11Reserved for future use
G3XDDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_00Reserved for future use
G3XDDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_01Reserved for future use
G3XDDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_10Reserved for future use
G3XDDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_11Reserved for future use