CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Macros | Functions
FIR.cpp File Reference
`#include "FIR.h"`
`#include <stdlib.h>`
`#include <math.h>`
`#include <string.h>`

Go to the source code of this file.

## Macros
#define | BANDPASS 1
#define | DIFFERENTIATOR 2
#define | HILBERT 3
#define | NEGATIVE 0
#define | POSITIVE 1
#define | Pi 3.1415926535897932
#define | Pi2 6.2831853071795865
#define | GRIDDENSITY 16
#define | MAXITERATIONS 40

## Functions
void | remez (double h[], int numtaps, int numband, double bands[], double des[], double weight[], int type)
void | CreateDenseGrid (int r, int numtaps, int numband, double bands[], double des[], double weight[], int *gridsize, double Grid[], double D[], double W[], int symmetry)
void | InitialGuess (int r, int Ext[], int gridsize)
void | CalcParms (int r, int Ext[], double Grid[], double D[], double W[], double ad[], double x[], double y[])
double | ComputeA (double freq, int r, double ad[], double x[], double y[])
void | CalcError (int r, double ad[], double x[], double y[], int gridsize, double Grid[], double D[], double W[], double E[])
void | Search (int r, int Ext[], int gridsize, double E[])
void | FreqSample (int N, double A[], double h[], int symm)
short | isDone (int r, int Ext[], double E[])

## Macro Definition Documentation

#define BANDPASS 1

Definition at line 17 of file FIR.cpp.

Referenced by csl::FilterSpecification::planFilter(), and remez().

#define DIFFERENTIATOR 2

Definition at line 18 of file FIR.cpp.

Referenced by remez().

#define HILBERT 3

Definition at line 19 of file FIR.cpp.

#define NEGATIVE 0

Definition at line 215 of file FIR.cpp.

Referenced by CreateDenseGrid(), and remez().

#define POSITIVE 1

Definition at line 216 of file FIR.cpp.

Referenced by FreqSample(), and remez().

#define Pi 3.1415926535897932

Definition at line 218 of file FIR.cpp.

Referenced by FreqSample(), and remez().

#define Pi2 6.2831853071795865

Definition at line 219 of file FIR.cpp.

Referenced by CalcParms(), ComputeA(), FreqSample(), and remez().

#define GRIDDENSITY 16

Definition at line 220 of file FIR.cpp.

Referenced by CreateDenseGrid(), and remez().

#define MAXITERATIONS 40

Definition at line 221 of file FIR.cpp.

Referenced by remez().

## Function Documentation

void remez | ( | double | h[],
|  | int | numtaps,
|  | int | numband,
|  | double | bands[],
|  | double | des[],
|  | double | weight[],
|  | int | type
| ) |  |

Definition at line 738 of file FIR.cpp.

References BANDPASS, CalcError(), CalcParms(), ComputeA(), CreateDenseGrid(), DIFFERENTIATOR, FreqSample(), GRIDDENSITY, InitialGuess(), isDone(), MAXITERATIONS, NEGATIVE, Pi, Pi2, POSITIVE, and Search().

Referenced by csl::FilterSpecification::planFilter().

void CreateDenseGrid | ( | int | r,
|  | int | numtaps,
|  | int | numband,
|  | double | bands[],
|  | double | des[],
|  | double | weight[],
|  | int * | gridsize,
|  | double | Grid[],
|  | double | D[],
|  | double | W[],
|  | int | symmetry
| ) |  |

Definition at line 249 of file FIR.cpp.

References GRIDDENSITY, and NEGATIVE.

Referenced by remez().

void InitialGuess | ( | int | r,
|  | int | Ext[],
|  | int | gridsize
| ) |  |

Definition at line 314 of file FIR.cpp.

Referenced by remez().

void CalcParms | ( | int | r,
|  | int | Ext[],
|  | double | Grid[],
|  | double | D[],
|  | double | W[],
|  | double | ad[],
|  | double | x[],
|  | double | y[]
| ) |  |

Definition at line 343 of file FIR.cpp.

References Pi2.

Referenced by remez().

double ComputeA | ( | double | freq,
|  | int | r,
|  | double | ad[],
|  | double | x[],
|  | double | y[]
| ) |  |

Definition at line 420 of file FIR.cpp.

References Pi2.

Referenced by CalcError(), and remez().

void CalcError | ( | int | r,
|  | double | ad[],
|  | double | x[],
|  | double | y[],
|  | int | gridsize,
|  | double | Grid[],
|  | double | D[],
|  | double | W[],
|  | double | E[]
| ) |  |

Definition at line 468 of file FIR.cpp.

References ComputeA().

Referenced by remez().

void Search | ( | int | r,
|  | int | Ext[],
|  | int | gridsize,
|  | double | E[]
| ) |  |

Definition at line 507 of file FIR.cpp.

Referenced by remez().

void FreqSample | ( | int | N,
|  | double | A[],
|  | double | h[],
|  | int | symm
| ) |  |

Definition at line 621 of file FIR.cpp.

References Pi, Pi2, and POSITIVE.

Referenced by remez().

short isDone | ( | int | r,
|  | int | Ext[],
|  | double | E[]
| ) |  |

Definition at line 697 of file FIR.cpp.

References max, and min.

Referenced by remez().