/*M*
//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 1995 Intel Corporation. All Rights Reserved.
//
//  RCS:
//      $Source: d:/rcs/nsp20/include/nsptone.h $
//      $Revision: 1.4 $
//      $Date: 1995/08/14 13:07:46 $
//
//  Purpose: NSP Tone Generator. Declarator
*M*/

/*==========================================================================*/

#if !defined _NSPTONE_H || defined _NSP_BLDPCS
#define _NSPTONE_H

/* -------------------------------------------------------------------------*/
/* ToneInit, Tone, bTone                                                    */
/*                                                                          */
/* Provides  samples of  a sinusoid  of arbitrary  frequency, phase,  and   */
/* magnitude.                                                               */
/*                                                                          */

/*--- Tone structures ------------------------------------------------------*/
#ifndef _NSP_BLDPCS

typedef struct _NSPWToneState {
   char   isInit[4];
   short  mag;
   float  rfreq;
   float  phase;
   double cosBase;
   double cosCurr;
   double cosPrev;
} NSPWToneState;

typedef struct _NSPSToneState {
   char   isInit[4];
   float  mag;
   float  rfreq;
   float  phase;
   double cosBase;
   double cosCurr;
   double cosPrev;
} NSPSToneState;

typedef struct _NSPCToneState {
   char   isInit[4];
   float  mag;
   float  rfreq;
   float  phase;
   double cosBase;
   DCplx  cosCurr;
   DCplx  cosPrev;
} NSPCToneState;

typedef struct _NSPDToneState {
   char   isInit[4];
   double mag;
   double rfreq;
   double phase;
   double cosBase;
   double cosCurr;
   double cosPrev;
} NSPDToneState;

typedef struct _NSPZToneState {
   char   isInit[4];
   double mag;
   double rfreq;
   double phase;
   double cosBase;
   DCplx  cosCurr;
   DCplx  cosPrev;
} NSPZToneState;

#endif

/*--- Initialization -------------------------------------------------------*/

NSPAPI(void,nspwToneInit,(float  rfreq, float  phase, short mag,
                          NSPWToneState* statePtr));

NSPAPI(void,nspsToneInit,(float  rfreq, float  phase, float mag,
                          NSPSToneState* statePtr));

NSPAPI(void,nspcToneInit,(float  rfreq, float  phase, float mag,
                          NSPCToneState* statePtr));

NSPAPI(void,nspdToneInit,(double rfreq, double phase, double mag,
                          NSPDToneState* statePtr));

NSPAPI(void,nspzToneInit,(double rfreq, double phase, double mag,
                          NSPZToneState* statePtr));

/*--- Dot product tone functions -------------------------------------------*/

NSPAPI(short, nspwTone,(NSPWToneState* statePtr));
NSPAPI(float, nspsTone,(NSPSToneState* statePtr));
NSPAPI(SCplx, nspcTone,(NSPCToneState* statePtr));
NSPAPI(double,nspdTone,(NSPDToneState* statePtr));
NSPAPI(DCplx, nspzTone,(NSPZToneState* statePtr));

/*--- Array product tone functions -----------------------------------------*/

NSPAPI(void,nspwbTone,(NSPWToneState* statePtr, short*  samps, int sampsLen));
NSPAPI(void,nspsbTone,(NSPSToneState* statePtr, float*  samps, int sampsLen));
NSPAPI(void,nspcbTone,(NSPCToneState* statePtr, SCplx*  samps, int sampsLen));
NSPAPI(void,nspdbTone,(NSPDToneState* statePtr, double* samps, int sampsLen));
NSPAPI(void,nspzbTone,(NSPZToneState* statePtr, DCplx*  samps, int sampsLen));

#endif /* _NSPTONE_H */
