.TH FASTFIR 1carl CARL
.SH NAME
fastfir \- program for easy design of simple FIR filters
.SH SYNOPSIS
.B fastfir
.SH DESCRIPTION
.B fastfir
[
.B flags
] filter_file [ > floatsams ]
.sp
.nf
flags:	(defaults in parenthesis)
	-n	length of impulse response in samples (127)
	-x	filter type: (1)
		1	lowpass
		2	highpass
		3	bandpass
		4	bandstop
	-w	window type: (6)
		1	rectangular
		2	triangular
		3	Hamming
		4	generalized Hamming
		5	Hanning
		6	Kaiser
		7	Chebyshev
	-f	filter cutoff frequency (use two -f's for bandpass or bandstop)
	-a	Kaiser only:  stopband attenuation in db (70)
	-b	generalized Hamming only:  w(i) = b + (1-b) * cos(2*pi*i/(n-1))
	-c	Chebyshev only:  desired filter ripple attenuation in db (70)
	-d	Chebyshev only:  transition width (0)
		(for Chebyshev, any two of -n, -c, and -d is sufficient)

	 if filter_file is not specified the file tmp.flt will be created

.fi
This program designs lowpass, highpass, bandpass, and bandstop
FIR filters by the classical windowing technique.  It is much
easier to use than \fIfir\fR and produces filters which are
nearly as good.  The impulse response is written into the 
specified filter_file in standard format.  The resulting filter
can be implemented using either \fIfilter\fR or \fIconvolve\fR,
but \fIconvolve\fR is strongly preferred due to its much greater
computational efficiency.  The impulse response is also available
as an optional output to stdout.  To see the frequency response, type
.IP
.B fastfir [flags] [filter_file] | spect -f
.LP
or
.IP
.B impulse 1024 512 | convolve filter_file
.B | spect -f
.PP
The basic idea behind the design is that an ideal filter has an infinitely
sharp transition from passband to stopband.  As a consequence,
it also has an infinitely long impulse response.  Simply
taking a finite number of samples of the ideal impulse
response does not produce a very good filter.  But 
multiplying the finite impulse response by a smoothly varying
window can produce a surprisingly good filter.  Hence, the
filter design reduces to four simple steps:
.IP
1) Specify the number of samples in the impulse response via the -n flag. 
.IP
2) Specify the filter type (i.e., lowpass, highpass, bandpass, or bandstop)
via the -x flag.
.IP
3) Specify the window type (e.g., hamming, kaiser, etc.) via the -w flag.
.IP
4) Specify the cutoff frequency(s) via the -f flag.  If the filter
is a passband or stopband filter, then two -f specifications are
required: one for the lower edge of the pass(stop) band and one for
the upper edge.  It is standard to state these values as decimal
fractions of the sample rate (e.g., .15), but they may also be
expressed as actual frequencies provided that the -R flag specifies
the intended sample rate.
.PP
For a more detailed discussion of these four steps, the reader is
strongly encouraged to consult the associated helpfile for this
program.  Another useful reference may be the 
.I Programs for Digital Signal Processing, 
published by the IEEE.  This program is essentially a direct
translation of the program WINDOW in that book.
.SH FILES
.SH AUTHOR
Mark Dolson
.SH SEE ALSO
impulse(1carl), filter(1carl), convolve(1carl)
.SH BUGS

