International Society of Biomechanics
Gold sponsor

Members

Tony Reina

A Matlab MEX interface for the GCVSPL and SPLDER packages based on Dwight Meglan's C Code.

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

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). See further below for:

  • Files for SGI Matlab 5.1
  • Files for MS Windows Matlab 5.3
  • Source files and instructions to recompile the package for other platforms

Tony Reina 
The Neurosciences Institute 
San Diego, CA 
4/10/1998 
This email address is being protected from spambots. You need JavaScript enabled to view it.

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.


 

Matlab 5.1 MEX interface for GCVSPL (SGI version)


Files to download:

1. gcvspl.mexsg
 A GCVSPL function in mex for MATLAB 5.1 (SGI binary). Download binaries using the right mouse button in Netscape.
2. splder.mexsg
 A SPLDER function in mex for MATLAB 5.1 (SGI binary). Download binaries using the right mouse button in Netscape.
3. 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')
4. 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')
5. 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.
6.FRL031.001
 Sample data file (some EMG data) used by the sample MATLAB script woltring_filter.m.

Matlab 5.1 MEX interface for GCVSPL (Windows version)


A newly ported .dll for MATLAB 5.3 has been created for this site courtesy of Alan Morris (This email address is being protected from spambots. You need JavaScript enabled to view it.) at the Bloorview MacMillan Centre's Gait Laboratory in Toronto.

Files to download:

1. gcvspl.dll
The Windows mex binary of GCVSPL for use with MATLAB 5.3. Download binaries using the right mouse button in Netscape.
2. splder.dll
The Windows mex binary of SPLDER for use with MATLAB 5.3. Download binaries using the right mouse button in Netscape.
3. 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')
4. 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')
5. 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.
6.FRL031.001
 Sample data file (some EMG data) used by the sample MATLAB script woltring_filter.m.

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: 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:
  • gcvspl: computes coefficients for the spline fit of the filtered signal
  • splder: re-creates the filtered signal from the coefficients obtained from gcvspl
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.