Source code for Matlab 5.1 MEX interface for GCVSPL


Woltring's Generalized Cross-Variance (GCV) natural B-spline filter

The following mex files will perform the Woltring Generalized Cross-Variance B-spline filter using MATLAB 5.1. The original FORTRAN programs (gcvspl.f and splder.f) were converted to C by Dwight Meglan. ChunXiang Tian converted the C routines to a MATLAB 4.2 mex file (7/4/96). These files were updated by David Carta (3/7/97). I have re-written the mex files from scratch for use with MATLAB 5.1 based on Dwight Meglan's C routines (gcvspl.c and splder.c).

The source files were originally compiled on a Silicon Graphics Indy running IRIX 6.2; however, they should be able to recompile with MATLAB's cmex onto any platform. For example,

        cmex mat_gcvspl.c gcvspl.c -output gcvspl.xxx

        cmex mat_splder.c gcvspl.c -output splder.xxx

where xxx is the extension MATLAB uses for your platform.
(NOTE: MATLAB for Windows uses the extension .dll, Matlab for SGI uses .mexsg)

30 April 1999: A newly ported .dll for MATLAB 5.3 has been created for this site courtesy of Alan Morris at the Bloorview MacMillan Centre's Gait Laboratory in Toronto.

Files you'll need:

1. gcvspl.c
 Dwight Meglan's C version of Woltring's GCV B-spline filter. User-callable C functions are:
2. gcvspl.m
A .m function which explains how to use gcvspl.mexsg (in MATLAB, this function will be printed when you type 'help gcvspl.m')
3. splder.m
 A .m function which explains how to use splder.mexsg (in MATLAB, this function will be printed when you type 'help splder.m')
4. woltring_filter.m
 A sample .m program to demonstrate how to use gcvspl.mexsg and splder.mexsg. The program will input a waveform of arbitrary size, filter it with Woltring's filter, output the coefficients to a datafile, and plot the original and filtered signals on the same graph.
5. mat_gcvspl.c
 This file is the original Matlab mex gateway code for gcvspl. You'll need this file to recompile the gcvspl.mexxxx file for your operating system.
6. mat_splder.c
 This file is the original Matlab mex gateway code for splder. You'll need this file to recompile the splder.mexxxx file for your operating system.
7. f2c.h
 Header file required for re-compiling the mex files
8. strings.h
This should be part of your standard C libraries but apparently does not come with some of the Windows compilers. If you already have a strings.h file, then you won't need this.
9.FRL031.001
 Sample data file (some EMG data) used by the sample MATLAB script woltring_filter.m.
Tony Reina


The Neurosciences Institute
San Diego, CA
4/10/1998
reina@nsi.edu

NOTE: These programs are intended for freeware distribution. No warranty or support is offered with the use of this product. By using the software, the user agrees not to hold the author or The Neurociences Institute responsible for bugs, problems, or inaccurate results in conjuntion with the use of this product.


Back to ISB home page