📄 read.me
字号:
COMMENTS ABOUT THE PROGRAMS IN PC DIRECTORY
-------------------------------------------
In order to compile the DSP programs on this disk, a C compiler
which implements the ANSI C standard is required. A C
compiler which is only "K & R" compatible will not compile these
programs primarily because of the prototypes used in the include
files. By removing the argument type checking in all the
prototypes in all the include files, the code should compile on
non-ANSI compilers. These programs have been tested using
Borland's TURBO C version 2.0-4.0, Microsoft C versions 4.0-7.0
for the IBM/PC. The programs have also been tested on several
UNIX platforms. The following instructions provide an easy
method to compile and run the DSP programs using TURBO C or
Microsoft C. The first step is to copy the entire contents of
this directory to a sub directory where all compilation will take
place.
All 19 of the executable (*.EXE) contained in this directory are
compiled for DOS on an IBM/PC using the Microsoft C compiler.
The programs can be run under Microsoft Windows by simply clicking
on the *.EXE file name in FILE MANAGER.
NOTE: Many of the programs (such as MUSIC.C, WAVETAB.C and
OSC.C) generate a large number of samples and will create large
disk files.
PROGRAMS FOR USE WITH WAV FILES
-------------------------------
Many of the programs in this directory can be compiled with
GETWAV.C and SENDWAV.C such that the getinput() and sendout()
functions will read and write files in the Microsoft Windows
(TM) compatible Resource Interchange File Format (RIFF). This
file format is used by many sound cards which are widely used in
IBM-PC compatible computers. The files have a .WAV extension and
can have a 8 or 16 bit format and can also be stereo or mono
recordings. If the input file is recorded in stereo, the user
will be requested to enter the channel number to be processed (0
or 1 for left or right channel). If you want to generate 16 bit
samples, you must define BITS16 when you compile SENDWAV.C. This
can be done using a -DBITS16 switch on the compile line for SENDWAV.C
(on most compilers). Another way to get 16 bit samples is
to add the following line to the beginning of the SENDWAV.C file:
#define BITS16 1
PROGRAMS FOR USE WITH MATLAB (TM)
---------------------------------
The program WAV2MAT.C can be used to convert a WAV file
generated using the programs in this directory to a binary
format which can be used with the popular MATLAB program (The
MathWorks, Inc, Natick, MA).
If you do not wish to use GETWAV.C and SENDWAV.C to generate
.WAV files (see above), you can use the GETSEND.C program which
will generate ASCII text outputs which can be read directly
using the MATLAB load command. By using the MATLAB save command
with the /ascii option MATLAB can also generate ASCII text which
can be read by the getinput() function in GETSEND.C.
The program ARMA.C generates a multi-column ASCII text file for
use with MATLAB. To run this program use redirection of the
output with a command like 'ARMA > armaout.dat' and then read in
the data file ARMAOUT.DAT using the MATLAB load command.
The programs (and their make files) RTPSE.C, RADPROC.C, ARFREQ.C
and INSTF.C are currently designed to be used with GETSEND.C
because the output and input sampling rates are different.
Also, these programs do not generate an audio output although
RTPSE and ARFREQ can be used with an audio input.
MAKE FILES
----------
Each make file in this directory is a stand alone make file for
the PC based program. Each make file is designed to work with
Microsoft C versions 4.0-7.0 for the IBM/PC. Either make
program MAKE or NMAKE can be used. These files can be modified
to work with Borland C compilers by changing the name of the
compiler used in each make file from "cl" to "bcc", "tcc", or
"bc4" (depending on which version you may have).
The programs REMEZ.C and KSRFIR.C do not have make files because
they are stand alone programs which can be compiled using the
commands 'cl remez.c' and 'cl ksrfir.c'.
DATA FILE LIST
--------------
Each of the following data files in this directory are stored in
ASCII text format:
Data Description
File Name
---------- -----------------------------------------
CHKL.WAV "chicken little" Speech in WAV format
CHKL.DAT "chicken little" Speech in ASCII text format
RADAR.DAT Radar test signal in ASCII text format
WAVE3.DAT Sum of 3 cosine waves signal (see section 4.3.3)
DSP LIBRARY AND EXECUTABLE PROGRAMS
-----------------------------------
One way to use the code on this disk is to create a library
of DSP functions which can be linked with the main programs to
form executable code. For TURBO C this is accomplished using
the following two commands:
tcc -c -mc *.c
tlib dsp +getsend+filter
For Microsoft C the following two commands are used:
cl /AC /c *.c
lib dsp getsend+filter;
In either case, these commands will compile all of the source
code on the disk (which can take a while) using the compact
memory model (so that large amounts of data can be manipulated
on the PC) and then create a library file called DSP.LIB. The
source code for the executable programs is also compiled so that
only a link is required to run one of the executable programs
(see below).
The following table indicates the name of each function, the
source file name and the section in the text where more
information is located:
Source Function Text
filename names Section
-------- --------------------------------- -------
GETSEND.C getinput, sendout 3.1
FILTER.C iir_filter, fir_filter 4.3, 4.4
gaussian
After compiling all the source code on the disk and creating the
DSP library, any of the executable programs (programs which
contain a main program) can be linked using TURBO C as follows:
tcc -mc <filename>.obj dsp.lib
Where <filename> is the name of one of the executable programs.
If an executable program is changed, it can be compiled and
linked using:
tcc -mc <filename>.c dsp.lib
The integrated environment of TURBO C can also be used by making
a two line project file consisting of the executable name on the
first line and DSP.LIB on the second. The executable can then
be changed, compiled and linked in the integrated environment.
For Microsoft C the command to do only the link is:
cl <filename> /link dsp
For Microsoft C to compile and link the command is:
cl /AC <filename>.c /link dsp
PROGRAM LIST
------------
The following table indicates the name of each program, a short
description of its purpose, and the section in the text where
more information is located:
Program Section Description
File Name Number
---------- -------- -----------------------------------------
arfreq.c 5.2.2 AR Frequency Estimation
arma.c 5.2.1 ARMA Modeling of Signals
equaliz.c 5.4.1 Equalization
fft1k.c 3.3.3 1024-Point FFT Test
filter.c 4.1.1 FIR and IIR filter functions
g722.c 5.3.2 ADPCM (G.722 fixed point) functions
g722main.c 5.3.2 ADPCM (G.722 fixed point)
g722pc.c 5.3.2 ADPCM (G.722 fixed point) Test Program
getsend.c 4.1.4 ASCII text getinput, sendout and flush functions
getwav.c 4.1.4 WAV file format getinput function
instf.c 5.5.2 Frequency Tracking with Noise
interp3.c 4.3.3 Sample Rate Conversion Example
intfft2.c 4.4.2 Interpolation Using the FFT
ksrfir.c 4.1.2 FIR filter coefficients
lms.c 5.5.1 LMS Signal Enhancement
mkgwn.c 4.2.2 SNR Improvement
mulaw.c 5.3.1 Speech Compression
music.c 5.4.3 Music Synthesis
note.c 5.4.3 Music Synthesis function
osc.c 4.5.1 IIR Filters as Oscillators
pshift.c 5.4.2 Pitch Shifting
radproc.c 5.1.2 Doppler Radar Processing
remez.c 4.1.2 FIR filter coefficients
rfast.c 4.4.1 Fast Convolution using FFT
rtpse.c 5.1.1 Spectrum Analysis
sendwav.c 4.1.4 WAV file format sendout function
wav2mat.c A.1 WAV file format to MATLAB file format converter
wavetab.c 4.5.2 Table generated waveforms
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -