MityDSP Documentation Index

MityDSP::tcDspFpgaIir Class Reference

Instances of this class handle configuring and setting up the coefficients for the IIR Filter core. More...

#include <core/DspFpgaIir.h>

List of all members.

Public Member Functions

 tcDspFpgaIir (void *apAddress)
 This constructor is used to open an IIR core instance.
 ~tcDspFpgaIir ()
 Default destructor.
int GetNumPaths (void)
 Return the number of paths configured in the IIR firmware core.
bool SetNumFilters (int anFilters)
 Update the number of cascaded filters (per path) configured in the IIR firmware core.
int GetNumFilters (void)
 Return the number of cascaded filters (per path) configured in the IIR firmware core.
bool SetCoeffs (int anPath, int anFilter, int anB0, int anB1, int anB2, int anA1, int anA2)
 Update the coefficients for the selected filter path and filter number.
bool SetCoeffs (int anPath, int anFilter, float anB0, float anB1, float anB2, float anA1, float anA2)
 Update the coefficients for the selected filter path and filter number.
bool GetCoeffs (int anPath, int anFilter, int &arB0, int &arB1, int &arB2, int &arA1, int &arA2)
 Return the current filter coefficients (as 16-bit integers) for the given path and filter.
bool GetCoeffs (int anPath, int anFilter, float &arB0, float &arB1, float &arB2, float &arA1, float &arA2)
 Return the current filter coefficients for the given path and filter.

Static Public Attributes

static const int gnCoeffScale = 0x00010000
 Filter coefficients are scaled to this value.
static const int gnMaxCoeff = 131071
 Minimum and maximum allowed integer coefficient (signed 18-bit value).
static const int gnMinCoeff = -131072
static const int gnMaxFilters = 4
 Number of paths and filters supported.
static const int gnMaxPaths = 4
static const int gnNumACoeffs = 2
static const int gnNumBCoeffs = 3

Protected Member Functions

void CopyCoes (unsigned char anFilter, int *anB, int *anA)
 Definition of sample data holding area.
void FetchCoes (unsigned char anFilter, int *anB, int *anA)
 Return the currently configured coefficients for the specified filter directly from the IIR core.
int GetFilterID (int anPath, int anFilter)
 Determing the actual filter index based on the specified path and filter and the configured number of paths (NP) and number of filters (NF).

Protected Attributes

SEM_Handle mhMutex
 Mutex to serialize access.
volatile unsigned int * mpBaseAddr
 IIR Core base address.
int mnPaths
 Number of IIR paths.
int mnFilters
 Number of filters per paths.
int maACoes [gnMaxFilters][gnNumACoeffs]
 A[] Coefficients.
int maBCoes [gnMaxFilters][gnNumBCoeffs]
 B[] Coefficients.

Detailed Description

Instances of this class handle configuring and setting up the coefficients for the IIR Filter core.

Each instance provides four filters, which may be cascaded along up to 4 different paths. The number of paths available is implementation specific, and is provided as a read-only value. The number of filters along each path may be configured.

See also:
tcDspFpgaIir Page

Constructor & Destructor Documentation

tcDspFpgaIir::tcDspFpgaIir ( void *  apAddress  ) 

This constructor is used to open an IIR core instance.

The base address of the FPGA core must be provided.

Parameters:
[in] apAddress The base address of the IIR core.
Returns:
None.
See also:
DspFpgaIir.h
tcDspFpgaIir::~tcDspFpgaIir (  ) 

Default destructor.


Member Function Documentation

int tcDspFpgaIir::GetNumPaths ( void   ) 

Return the number of paths configured in the IIR firmware core.

Returns:
Number of filter paths configured.
See also:
DspFpgaIir.h
bool tcDspFpgaIir::SetNumFilters ( int  anFilters  ) 

Update the number of cascaded filters (per path) configured in the IIR firmware core.

The following are valid combinations:

  • NumPaths=1, NumFilters=1,2,3,4
  • NumPaths=2, NumFilters=1,2
  • NumPaths=3, NumFilters=1
  • NumPaths=4, NumFilters=1
Parameters:
[in] anFilters Requested number of cascaded filters.
Returns:
True if successful.
See also:
DspFpgaIir.h
int tcDspFpgaIir::GetNumFilters ( void   ) 

Return the number of cascaded filters (per path) configured in the IIR firmware core.

Returns:
Number of cascaded filters configured.
See also:
DspFpgaIir.h
bool tcDspFpgaIir::SetCoeffs ( int  anPath,
int  anFilter,
int  anB0,
int  anB1,
int  anB2,
int  anA1,
int  anA2 
)

Update the coefficients for the selected filter path and filter number.

Parameters:
[in] anPath Filter path requested.
[in] anFilter Cascaded filter within the selected path.
[in] anB0 New B0 coefficient.
[in] anB1 New B1 coefficient.
[in] anB2 New B2 coefficient.
[in] anA1 New A1 coefficient.
[in] anA2 New A2 coefficient.
Returns:
True if successful.
See also:
DspFpgaIir.h
bool tcDspFpgaIir::SetCoeffs ( int  anPath,
int  anFilter,
float  anB0,
float  anB1,
float  anB2,
float  anA1,
float  anA2 
)

Update the coefficients for the selected filter path and filter number.

Parameters:
[in] anPath Filter path requested.
[in] anFilter Cascaded filter within the selected path.
[in] anB0 New B0 coefficient.
[in] anB1 New B1 coefficient.
[in] anB2 New B2 coefficient.
[in] anA1 New A1 coefficient.
[in] anA2 New A2 coefficient.
Returns:
True if successful.
See also:
DspFpgaIir.h
bool tcDspFpgaIir::GetCoeffs ( int  anPath,
int  anFilter,
int &  arB0,
int &  arB1,
int &  arB2,
int &  arA1,
int &  arA2 
)

Return the current filter coefficients (as 16-bit integers) for the given path and filter.

Parameters:
[in] anPath Filter path requested.
[in] anFilter Cascaded filter within the selected path.
[out] arB0 Reference to B0 coeff storage.
[out] arB1 Reference to B1 coeff storage.
[out] arB2 Reference to B2 coeff storage.
[out] arA1 Reference to A1 coeff storage.
[out] arA2 Reference to A2 coeff storage.
Returns:
True, if request succeeded.
See also:
DspFpgaIir.h
bool tcDspFpgaIir::GetCoeffs ( int  anPath,
int  anFilter,
float &  arB0,
float &  arB1,
float &  arB2,
float &  arA1,
float &  arA2 
)

Return the current filter coefficients for the given path and filter.

Parameters:
[in] anPath Filter path requested.
[in] anFilter Cascaded filter within the selected path.
[out] arB0 Reference to B0 coeff storage.
[out] arB1 Reference to B1 coeff storage.
[out] arB2 Reference to B2 coeff storage.
[out] arA1 Reference to A1 coeff storage.
[out] arA2 Reference to A2 coeff storage.
Returns:
True, if request succeeded.
See also:
DspFpgaIir.h
void tcDspFpgaIir::CopyCoes ( unsigned char  anFilter,
int *  anB,
int *  anA 
) [protected]

Definition of sample data holding area.

Copy the provided coefficients for the specified filter to the IIR core.

Parameters:
[in] anFilter The requested filter.
[in] anB Pointer to the new "B" coefficients.
[in] anA Pointer to the new "A" coefficients.
Returns:
None.
See also:
DspFpgaIir.h
void tcDspFpgaIir::FetchCoes ( unsigned char  anFilter,
int *  anB,
int *  anA 
) [protected]

Return the currently configured coefficients for the specified filter directly from the IIR core.

Parameters:
[in] anFilter The requested filter.
[out] anB Pointer to storage for the "B" coefficients.
[out] anA Pointer to storage for the "A" coefficients.
Returns:
None.
See also:
DspFpgaIir.h
int tcDspFpgaIir::GetFilterID ( int  anPath,
int  anFilter 
) [protected]

Determing the actual filter index based on the specified path and filter and the configured number of paths (NP) and number of filters (NF).

Parameters:
[in] anPath The filter path.
[in] anFilter The cascaded filter number.
Returns:
The actual filter index (-1 if invalid).
See also:
DspFpgaIir.h

Member Data Documentation

const int MityDSP::tcDspFpgaIir::gnCoeffScale = 0x00010000 [static]

Filter coefficients are scaled to this value.

const int MityDSP::tcDspFpgaIir::gnMaxCoeff = 131071 [static]

Minimum and maximum allowed integer coefficient (signed 18-bit value).

const int MityDSP::tcDspFpgaIir::gnMinCoeff = -131072 [static]
const int MityDSP::tcDspFpgaIir::gnMaxFilters = 4 [static]

Number of paths and filters supported.

const int MityDSP::tcDspFpgaIir::gnMaxPaths = 4 [static]
const int MityDSP::tcDspFpgaIir::gnNumACoeffs = 2 [static]
const int MityDSP::tcDspFpgaIir::gnNumBCoeffs = 3 [static]
SEM_Handle MityDSP::tcDspFpgaIir::mhMutex [protected]

Mutex to serialize access.

volatile unsigned int* MityDSP::tcDspFpgaIir::mpBaseAddr [protected]

IIR Core base address.

Number of IIR paths.

Number of filters per paths.

A[] Coefficients.

B[] Coefficients.


  
Generated on Fri Sep 23 16:33:50 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.