Filtering Of Wav Sound Files

Read Complete Research Material

Filtering of Wav Sound Files

Filtering of .wav Sound Files

Filtering of .wav Sound Files

Wav File Filtering

The development tools for WAV file processing in this package are intended to mimic the style of signal processing used on a real-time DSP board. In real-time systems, the difference equation must be evaluated sample-by-sample, as new inputs x (n) are acquired. As such a 'history' x (n-k) of recent inputs, and of recent outputs, y (n-k), must be maintained in order to compute each y(n) output value. FYI, digital signal processors feature circular addressing modes, which efficiently maintain the signal history (John, 1986, pp.679-698). With the WAV file programs, the history can be updated simply via scalar variables with appropriate assignments. (Or you can use arrays, which are better). The following diagram provides an analogy relating WAV file processing to the A/D and D/hardware of a real-time system.

The template C program in the development package includes the logic necessary to respond to the drag & drop operation and to open & create WAV files. See the 'WAV Project'. Note the programming required just involves the signal processing aspects (implementing the difference equation & history update) not any WAV file input/output. An excerpt from the main program follows. This shows the WAV input (analogous to A/D) and the WAV output (D/A). The assignment 'out = in;' is the difference equation, in this case simply y (n) = x (n) (Michael, 1991, pp.272-277). Development Cycle for Digital Filter

Installing the Software Development Environment

Go to DePiero's web site; follow the link to the software development tools. Download & install the Dev-C++ package as described on the web page. Open the 'WAV Project' under the 'C:\Dev-C++\CP\CP-Projects' folder, and double click on the 'Wav Project.dev' file. This starts the development environment. More information on these steps is provided on the web site. You may wish to setup a shortcut to the 'CP-Projects' folder. See additional notes on the web site regarding installation and use (Rachid, 1990, pp.78-87).

Design & Analyze the Digital Filter

On Paper, Complete the design calculations for the Ak, Bk filter coefficients.

On Paper, Find the magnitude and phase of the frequency response.

In SciLab, Use the following commands to find the magnitude and phase of the frequency response. Replace the 'b = [B0 B1 B2…]' and 'a = [A0 A1 A2…]' with your Ak and Bk values. Additional notes available on web see 'Filter Analysis'.

In this example, the sample rate S=16000Hz and 512 points are used for plotting the frequency response.

Implement the Digital Filter by Editing and Compiling Program

In the Dev-C++ tool, edit the main_wav.cpp file. Add variables and make any modifications needed to implement your filter or processing algorithm.

In the Dev-C++ tool, Use the 'Execute' menu to 'Compile' your program (or use the toolbar). This creates your 'WAV Project.exe' executable. Run the executable from the desktop (see below).

Run the Digital Filter to Process WAV File

On the Desktop, Drag & drop the 'noise.wav' file onto your new executable. The output file ...