home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enigma Amiga Life 109
/
EnigmaAmiga109CD.iso
/
software
/
musica
/
resample
/
src
/
remez.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-12-03
|
2KB
|
42 lines
/*************************************************************************\
"remez.h": include file for programs to link with "remez.o"
(for design of FIR linear phase filters by the Remez Exchange algorithm)
\*************************************************************************/
#define NFMAX 256 /* max. filter length */
extern float h[ NFMAX ]; /* impulse response of the computed filter */
extern int remez_talk; /* terminal output while calculating? */
extern int remez_dot; /* simple output: one dot for each iteration */
int makefilter(int length); /* call this to do the job */
#define REMEZ_OK 0 /* possible return values: */
#define REMEZ_UNSURE 1 /* <- indicate convergence problems */
#define REMEZ_FAIL 2 /* <- */
#define FILTER_TOO_LONG 3 /* length > NFMAX? */
float extreme(float freq); /* Returns an extremal value of the frequency
* response, to be precise: the one that is
* nearest to the specified frequency
* (0<=freq<=0.5). Example: for a low pass
* filter you could call extreme(0) and
* extreme(0.5). Let the return values be
* 0.985 and -0.0015, then you can tell that
* the pass band ripple is +/-1.5 %, the stop
* band attenuation -56 dB.
*/
/* These two functions must be implemented in the calling program: */
float desire(float freq); /* Magnitude of response,
* where freq is the normalized frequency.
* Prepare for values 0<=freq<=0.5.
*/
float weight(float freq); /* Which parts of the frequency response are
* more importantant?
* Stop bands usually are, and make sure that
* there are always transition bands (with a
* weight of 0, i. e. undefined response)
* between pass bands and stop bands. The wider
* the transition bands, the less ripples in
* the other bands can be achieved.
*/