______________________________________

intel Signal Processing Library (iSPL)
version 4.1
Delphi interface patch and examples
by Robert Rossmair
______________________________________

intel Signal Processing Library


WWW-homepage


Overview

Intels native signal processing library is a set of signal processing functions for the Intel Architecture similar to those available for most Digital Signal Processors (DSPs). NSP.DLL exports a total of 951 procedures and functions.

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"

Hints for users of my iSPL 4.0 interface unit

As you might expect, the Delphi interface files that come with iSPL 4.1 are incompatible to my v4.0 interface unit. I'll discuss here shortly some points concerning this topic.
The intel files pass array parameters in function declarations in a C-like style, that is, by using a pointer to the first array element.
Example:

NSP.pas (iSPL 4.0 interface unit) by RR:

procedure nspsRealFftl(
  Samps: PFloatArray;
  Order: Integer;
  Flags: TNspFourierTrOptions); stdcall;
iSPL 4.1 interface:
procedure nspsRealFftl(
  Samps : PFloat;
  Order : Integer;
  Flags : Integer); stdcall;
For this reason, you'll have to change a function call like
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.
As far as I can see, all pointer parameters in the intel files represent arrays. Other parameters passed by reference are seemingly always declared as var.

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
    TNspFourierTrOptions = Integer;
(Smart, huh?)

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.

Current patch level

    4.1.1 (20-May-1999)

How to get the intel Signal Processing Library

The iSPL v4.1 comes as a monolithic 11 MB executable installation package. To obtain it, click here.

Questions?

I'll try to answer all questions you ask me, but if you have questions and comments concerning the library itself (not the patch or my demos), please contact Intel.

Examples

  • FIR (finite impulse response) filter demo program
  • This is a (freely translated) Delphi port of the demo that can be found in <ISPL installation directory>\examples\firdemo.
  • LMS (least mean squares) demo
  • 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 list

     
    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

    New versions of nsp.zip

    The most recent version of nsp.zip, as well as the FIR filter demo package, is available at my WWW-homepage.
    If you want to get informed about future 
    updates, enter your email address below, 
    then click the 'Join List' button:
    Powered by ListBot | View List Archive

    Copyright

    © 1999  Robert Rossmair
    Use, modification and distribution is allowed without limitation, warranty, or liability of any kind.



    If you have any comments, bug reports etc., send me an email.

    Last updated May 20, 1999.