Dec 262017
Design Digital filters.
File REMEZ.ZIP from The Programmer’s Corner in
Category Science and Education
Design Digital filters.
File Name File Size Zip Size Zip Type
MYPLOT.COM 12419 9281 deflated
REMEZ.EXE 72560 38557 deflated
REMEZDOC.DOC 7521 3046 deflated

Download File REMEZ.ZIP Here

Contents of the REMEZDOC.DOC file


by C. Dorcey, not the author of the REMEZ program itself.

About filters:

The term "filter" in this document refers to a function which is applied to
a signal which produces a second signal, in which certain frequency
components have been enhanced or suppressed. For example,the signal from
an electrocardiogram monitor could be digitized into such a sequence of
samples. If the signal were contaminated with 60 Hz power line
interference, the signal could be put through a "notch" filter to remove
this unwanted noise, making diagnostic interpretation easier. Filters are
also commonly used in radio communications equipment, to select the station
which one wants to listen to from all other stations in the area. A
"bandpass" filter tuned to the desired station operates on the composite
signal from the radio antenna to enhance the desired station. The "tone"
control on an inexpensive stereo is often a "lowpass" filter, with a
tuneable "cutoff" frequency. And the "graphic equalizer" found in more
fancy music systems is a collection of bandpass filters, each dedicated to
a specific range of frequencies.

About digital filters:

"Digital" filters are implemented in arithmetic, rather than in networks of
electronic components with complex impedances. This arithmetic can be done
in software on a general purpose computer, in pre-programmed "firmware" in
single-chip Digital Signal Processor devices, or in hardwired digital
hardware, when highest performance is needed. The input signal to a
digital filter is a sequence of numbers, often created by periodic sampling
of a continuously varying signal voltage. On the other hand, digital
filters can be applied to any sequence of numbers: successive observations
of the position of an asteroid, successive prices of a commodity,
simultaneous temperature measurements at points within a bar of steel, or
measurements of the displacement (bending) of a beam in a large space

About FIR Digital Filters:

There are two main types of digital filters: recursive (also known as
Infinite-duration Impulse Response (IIR) or AutoRegressive (AR) filters),
and non-recursive (also known as Finite-duration Impulse Response (FIR),
Moving Average (MA), or transversal filters.) (Combining an IIR and FIR
filter produces a filter which still has an infinite-impulse response.)
Each output of an FIR filter is the weighted sum of a block of the input
samples. For example, a simple low-pass filter might be implemented with
the following equation:

y[n] := 0.276 * x[n-1] + 0.500 * x[n] + 0.276 * x[n+1];

where y[n] is the output at time "n", x[n] is the input sample at time n,
x[n-1] is the input sample at time n-1, and x[n+1] is the input sample at
time n+1. If "n" denotes the "current time", then x[n+1] is the sample
which hasn't arrived yet. Obviously, this filter can't be implemented to
run in "real time", but it may prove useful for off-line data analysis.

About this program:

The "Remez Exchange" algorithm is one of the best known computer-aided
design techniques for developing non-recursive digital filters. It was
published in Fortran by McClellan and Parks, in the book "Programs for
Digital Signal Processing", IEEE Press. This version was developed for the
IBM PC at the University of Maryland, College Park. The "myplot" program
is my own substitute for a proprietary plotting program (which includes
labeling features which I have not implemented).

When you run the REMEZ program, you'll be asked for a number of input

"Linear/dB plots?" (this is just a matter of taste, try it both ways.)

"Sampling frequency?" How often will the input signal be sampled? Typical
values might be 100 (1.0E+2) to 100000 (1.0E+5). Using values outside of
this range may make the output graph hard to read, given the label format
used. Example: "100".

"Filter length, type, number of bands, grid density?"
a. The length will determine how many terms you'll need in the
weighted sum. The more terms you use, the closer will the achievable
response match the desired response, but the more arithmetic you'll have to
do for each output sample. Experiment with it, to find the minimum number
of taps which satisfies system requirements. One of my runs used a length
of 100 "taps", requiring over one hour (on 4.7 MHz PClone, w/o 8087) to
determine optimal weights and resulting frequency response.
b. Select "type" from the three options. Describing the uses for
options 2 and 3 is beyond the scope of this document.
c. How many different parts of the spectrum will you need to control?
For a simple low-pass filter, you'll have a "pass" band, and a "stop band",
with some transition region in between. A "notch" filter would have two
pass bands, and one stop band. Naturally, the more complicated the desired
response is, the more terms will be needed in the sum to achieve a given
level of accuracy.
d. Good values for grid density are 16 or 32. Don't ask me why.


"Band edges?" Which regions of the spectrum do you need to control for
each of the bands requested above? The bands may not overlap, of course,
and allowing transition space between bands allows the algorithm to more
closely match the desired in-band responses. The high side of the highest
frequency band can be no larger than 1/2 of the sampling frequency.
Example: "0,10,40,50". Frequencies in the range 0-10 will be in the first
band, the range 40-50 is the second band, and 10-40 is an unspecified
transition region.

"...special amplitude function...?" Answer "N". This hasn't been
implemented yet.

"...special weighting function...?" Answer "N". This hasn't been
implemented yet, either.

"value" How much signal do you want to come through the filter in each
specified band? Example: "1,0", to pass low frequencies, and stop high

"weight" How important is it to match the values specified in the previous
set of parameters? The program will minimize the weighted sum of the
errors, so bands which are given more weight will be matched more closely.
Example:"1,1" to weight the errors equally.

The program then has all the information it needs to design the filter.
After the design is done, it will ask if a ".PLT" file is desired. The
plot file allows a hi-res screen plot of the filter's response to be
created, but the file will require about 27k of disk space, and use of an
auxilliary program ("") to create the plot. When the program
finishes running, you can examine the listing file to get the weighting
coefficients to use for the actual filtering process.

 December 26, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>