Below are the C programs that accompany the book, Recursive Digital Filters: A Concise Guide. You can download each as you need it, or all of them in a zip file. For other programs not listed here, see our digital signal processing page.
This software is free and distributed under the terms of the GNU General Public License. It is written in ANSI C and should compile with any C compiler. If you have questions or comments contact: Stefan (stefan at exstrom dot com) or Richard (richard at exstrom dot com).
Usage: lpf s f s = sampling frequency f = half power frequency < s/2
Usage: hpf s f s = sampling frequency f = half power frequency < s/2
Usage: bpf s f b s = sampling frequency f = center frequency b = half power bandwidth
Usage: bsf s f b s = sampling frequency f = stop frequency b = half power bandwidth
Usage: bsfb s b f1 f2 ... s = sampling frequency b = half power bandwidth fi = stop frequencies
Usage: brownrv n m a seed n = number of samples m = mean of gaussian a = standard deviation of gaussian seed = optional random number seed
Usage: sines file s n s = sampling frequency
Usage: noise m a seed m = mean of gaussian a = standard deviation of gaussian seed = optional random number seed
Usage: fft n n = number of points read from stdin If number of points read < n then zeros are added.
Usage: extract info info = m for magnitude p for phase r for real part i for imaginary part
Below are awk scripts that have been converted from the C programs above. They are also included in the zip file with the C programs. These awk scripts are executable like a shell script. They should run as is on any Unix related operating system (Linux, BSD, OSX), with the exception of having to possibly change the path of the awk executable on the first line. You need to make the script executable with a command like this: chmod u+x file.awk In Windoze, you can just delete the first line of the file (starts with #!), then run it as a regular non-executable awk file like this: awk -f file.awk ...
Example: brownrv 1000 0 0.5 13 | lpf.awk -v s=1000 -v f=10 where s = sampling frequency, f = half power frequency < s/2 This produces the same output as running lpf.c like so: brownrv 1000 0 0.5 13 | lpf 1000 10
Example: brownrv 1000 0 0.5 13 | hpf.awk -v s=1000 -v f=20 where s = sampling frequency, f = half power frequency < s/2 This produces the same output as running hpf.c like so: brownrv 1000 0 0.5 13 | hpf 1000 20
Example: brownrv 1000 0 0.5 13 | bpf.awk -v s=1000 -v f=20 -v b=10 where s = sampling frequency, f = center frequency, b = half power bandwidth This produces the same output as running bpf.c like so: brownrv 1000 0 0.5 13 | bpf 1000 20 10
Example: brownrv 1000 0 0.5 13 | bsf.awk -v s=1000 -v f=20 -v b=10 where s = sampling frequency, f = stop frequency, b = half power bandwidth This produces the same output as running bsf.c like so: brownrv 1000 0 0.5 13 | bsf 1000 20 10
Send comments to: Richard Hollos (richard[AT]exstrom DOT com)
Copyright 2022 by Exstrom Laboratories LLC