intel Signal Processing Library
(iSPL)
version 4.1
Delphi interface patch and examples
by Robert Rossmair
______________________________________
Overview
Hints for users of my iSPL 4.0 interface unit
Current patch level
Examples
File list
New versions
Copyright
Unlike the previous versions, version 4.1 comes with a Delphi interface of its own. However, a closer examination reveals some shortcomings. First of all, with the exception of the filter design functions all functions using Double data types are missing. Further, there are some bugs and typos which need fixing, and the translation of some function headers IMHO at least falls short of the optimum. And finally, I wanted to include some declarations to facilitate switching to library version 4.1 for those who used my interface unit for version 4.0.
Hence I decided to provide a patch file, nsp.dif. To apply this patch to your iSPL installation, you need GNU patch v2.5 (click here to download). Earlier versions might work, but I did not test them. Note that this binary of patch is part of DJGPP and that it is not able to handle long filenames.
Important: nsp.pas and all the *.int
and *.imp files in <your iSPL installation directory>\Delphi\Include
should be unaltered, otherwise the patch won't work properly.
Make a backup of all the files in this directory before applying
the patch!
With patch.exe on your path and nsp.dif in the current directory, execute the batch file patchnsp.bat with your iSPL installation directory as a parameter, for example:
patchnsp "C:\Program Files\Intel\PLSuite"
NSP.pas (iSPL 4.0 interface unit) by RR:
procedure nspsRealFftl(iSPL 4.1 interface:
Samps: PFloatArray;
Order: Integer;
Flags: TNspFourierTrOptions); stdcall;
procedure nspsRealFftl(For this reason, you'll have to change a function call like
Samps : PFloat;
Order : Integer;
Flags : Integer); stdcall;
nspdRealFft(Buf, FFTOrder, [NSP_Forw]);into
nspdRealFft(@Buf[0], FFTOrder, NSP_Forw);I'm not very happy about that, it makes the code less readable in my opinion, but I decided to better stay compatible.
The above example reveals another difference: To take advantage of Pascal's type checking capabilities, I declared a set type, TNspFourierTrOptions, for the Flags parameter of the Fourier transformation functions. To reduce the amount of source code changes needed when switching to v4.1's Delphi interface, the patch includes, in addition to all the array types provided by my NSP.pas unit, the following declaration:
type(Smart, huh?)
TNspFourierTrOptions = Integer;
In the case of some wavelet functions I decided to abandon compatibility.
For example, without the patch the nspsWtSetState procedure
declaration is
procedure nspsWtSetState(
var State
: TNSPWtState; WtType : Integer;
Par1 : Integer;
Par2 : Integer;
DataOrder : Integer; Level :
Integer;
fTaps : PFloat;
fLen : PInteger;
fOffset : PInteger);
stdcall;
Applying the patch changes it into:
procedure nspsWtSetState(
var State
: TNSPWtState; WtType : Integer;
Par1 : Integer;
Par2 : Integer;
DataOrder : Integer; Level :
Integer;
const fTaps
: TPFloatArray4;
const fLen
: TIntArray4;
const fOffset
: TIntArray4); stdcall;
This will break the Demo project dsnptest.dpr in the Delphi\examples\source directory, but it shouldn't be difficult to change the code appropriately. I cannot provide a patch file for this one, since I don't have the TeeChart component and hence couldn't test it.
This is a (freely translated) Delphi port of the demo that can be found in <ISPL installation directory>\examples\firdemo.
This is a somewhat elaborated version of example 8.7 from the Reference Manual (project Examples.dpr).To compile the examples, you need version 3.2 or greater of my Signal Display package.
File | Description |
nsp.dif | patch file |
patchNSP.bat | batch file to facilitate patch application |
Examples.dpr | reference manual examples project file |
Examples.dof | Examples project options |
Exampl87.dfm | example form (example 8.7 from the Reference Manual) |
Exampl87.pas | example unit (example 8.7 from the Reference Manual) |
Exampl51.inc | Include file (example 5.1 from the Reference Manual) |
FIRDemo.zip | FIR filter demo project |
NSP package readme.htm | This file |
Last updated May 20, 1999.