Software Development Tools for DSP & Image Processing

Professor DePiero, Electrical Engineering Department, CalPoly State University

    These software development tools are a convenient starting point for writing signal and image processing programs. The following capabilities are provided:

    * WAV file I/O
    * Forward and inverse FFTs
    * Random signal generation
    * BMP image I/O (Color and Grayscale)
    * Solving simultaneous equations
    * Matrix arithmetic
    * Finding eigenvalues and eigenvectors.

Download the self-extracting file Dev-C++.exe. Double-click on Dev-C++.exe and click 'Unzip', accepting the given default folder. 'Close' the dialog when the extraction is complete. This procedure will install the development environment in the C:\Dev-C++ folder. The development environment and resulting executables should run under most PC-Windows environments.

Initial Setup - Non-Vista Windows Platforms :)

Project folders are located under C:\Dev-C++\CP\CP-Projects. It is helpful to setup a shortcut to this folder for easy access to projects. Some initial configuration is required before normal usage. Start by opening a project folder such as 'WAV project'. Right-click on 'WAV', then select 'Open'. In the dialog that appears, choose 'Select Program from List'. Then in the next dialog, click 'Browse' and navigate to 'C:\Dev-C++\devcpp.exe'. Make sure 'Always use selected program' is checked, then click 'OK' and 'Yes' in subsequent dialogs. When the 'First Time Configuration' dialog opens, select the language desired, then 'Next'. Choose 'Yes' to use the following class browser feature (then 'Next'). Also choose 'Yes' for the subsequent cache feature. Processing may take several minutes for configuration. Click 'OK' when done. Future sessions may be started by simply double-clicking on a '*.dev' file.

Initial Setup - Vista Platforms :(

Setup a shortcut to the folder 'C:\Dev-C++\CP\CP-Projects' for easy access to projects. Also setup a shortcut to the executable 'C:\Dev-C++\devcpp.exe'. Some initial configuration is required before normal usage. Begin initial setup by double-clicking on the 'devcpp' shortcut. The 'First Time Configuration' dialog should open, select the language desired, then 'Next'. Choose 'Yes' to various options that follow. When the 'First Time Configuration' completes, use the File -> 'Open Project' menu option to select a project, such as the 'WAV Project' from the Project folder.

Use the 'Tools' -> 'Compiler Options' menu item to bring up an options dialog. Click on the 'Directories' tab, then on the 'Binaries' (inner) tab. Add the following two items to the list:

Verify that the other tbas under 'Directories' ('Libraries', 'C Includes' and 'C++ Includes') are all blank.

Future sessions may be started by double-clicking on the 'devcpp' shortcut, and then using the File -> 'Open Project' menu option to select a given project, such as the 'WAV Project'.

Available Utility Programs

Also included in the distribution are several utility programs. One for high pass filtering is useful for removing 60Hz or other low frequency noise from WAV files. A Short-Time Fourier Transform utility is useful for visualization: displaying a traditional STFT magnitude & phase - with scrolling playback, along with an on-line view similar to a spectrum analyzer, a traditional spectrum of the complete WAV file, and a time-domain plot as would be observed on an oscilloscope. A simple spectrum analyzer program is also included in the package which generates BMP images of the magnitude and phase of a filter's frequency response.

The 'WAV Project' contained in this bundle is setup to easily process WAV files using a digital filter. Program execution begins when a WAV file is 'dragged-and'dropped' on top of the .exe. The WAV file is then opened and accessed sample-by-sample. Comments clearly indicate where students should experiment with the source code to implement difference equations or similar programs.

Additional notes on the development environment, on filter design, and on filter analysis using SciLab, are all available for download.

Note: if the extraction process is re-run then the files in the original distribution will be overwritten (refreshed and updated). New folders and files - not in the original distribution - should remain unchanged. (Backups are always a good idea).

    Limitations on Use and Distribution

    The software packages within this bundle are governed by various licensing agreements. See each package for complete details. The most restrictive license within the bundle limits use to scholarly, NON-PROFIT, NON-COMMERCIAL purposes. The licenses also restrict any changes being made to the stated agreements.

    Software bundle and license summary

This software bundle may be decoupled, individual licenses then apply.

    Development Cycle

When a project opens, click on the main_***.cpp file name that appears in the file list on the left side of the C-Dev++ window, under the 'Project' tab. This will make the main file ready to edit. Then:

    1. Edit the main program as needed.
    2. Compile via the 'Execute' menu, or via the toolbar.
    3. Run by using the toolbar (within C-Dev++ environment) or by double-clicking on your .exe file (on the Desktop), or by dragging & dropping a WAV file onto the .exe file.

The drag & drop mode of execution is supported by the WAV Project and is the most convenient. When a WAV file is dropped onto the .exe executable, it is opened automatically and the program runs. The output file is written into the same folder as the input. Alternatively, you may wish to update the default name of a WAV file that is used in your example program (see source listing...)

To test the frequency response of a filter created using the WAV Project, drag & drop the 'noise_input.wav' onto the .exe file. This will cause the file 'digital_filter_output.wav' to be generated. Then drag & drop the 'digital_filter_output.wav' onto the 'spectrum analyzer' shortcut, which generates BMP images for the magnitude and phase.

Further discussion is available on developing a digital filter to process WAV files.

Only the main program should require editing for class projects. (No support can be provided if the other source files are altered.).

    Example Programs & Creation of New Project Folders

    Several projects have been setup to demonstrate the WAV file & BMP file I/O, and various math routines (FFT, eigenvalues and solving simultaneous equations). To create a new project folder, first copy and paste then entire folder (from the Windows desktop, for example) and then rename it, and place it alongside the other Project folders.

Suggestions for Plotting

The software contained within this bundle was written for use on multiple platforms. As a result, no facilities for plotting are provided. A simple approach for plotting in a Windows environment is to create a '.csv' file. See the following notes and example code:

    Source-Level Debugging

Source-level debugging is an excellent method for finding programming errors and can save a significant amount of development time. It is well worth taking 5 minutes to learn a source-level debugger - it can save hours! This type of debugger allows you to step through program execution, line-by-line. It also permits the value of variables to be examined when execution is paused. (This sort of evaluation is convenient before and after a given calculation, for example).

To begin using the debugger set a breakpoint. This will pause execution at a selected line of code in your program. (Set the breakpoint by right-clicking on a line of code and 'Toggle Breakpoint'). Set a breakpoint strategically, to check intermediate results to determine when problems arise. Note the debugger is also useful to verify the flow of execution through a program.

To start execution in debug mode, click on the checkmark on the toolbar. (You may be prompted that the program must be recompiled to include debugging info, 'OK' this action.) The 'Debug' window at the bottom of the Dev-C++ environment has buttons that control the flow of execution. Try using 'Next Step' to advance execution line by line. The line that is about to execute is highlighted in blue.

When execution is paused you may examine the current value of a variable. To do this, highlight the variable of interest as it appears in the source listing. Then click on 'Add Watch' in the lower 'Debug' window. The 'Continue' button will restart program execution (at full speed) and execution will continue until a breakpoint is hit.