Coefficient File Formats

ScopeFIR can export and import FIR filter coefficients to and from a wide variety of text and binary file formats. Text formats encode the data as numerical characters on lines in a text file; Binary formats encode the data directly in binary form. Text formats are often easier to work with because you can examine the data using a text editor, but Binary formats usually are more compact. (Tip: You can easily generate an example of any of ScopeFIR's data file formats. Just use the Fill Filter With Sine function to generate coefficients, then write the coefficients out to a file.)

One special subcategory of text formats is Assembly. Assembly files are simply text files in a special format that is required by the assembler of a particular DSP microprocessor.

Almost all ScopeFIR data file formats are read/write, but the few that are read-only or write-only are so noted below.

ScopeFIR supports the following Text file formats:

Floating-Point formats

  • Text:Decimal. This is a floating-point format which holds one data sample per line. If the file is Complex, each line holds an Inphase, Quadrature data pair, delimited by one or more spaces or tabs.
  • Text:Plot. This format holds X-Y data, with optional titles. The first column, X, is always ignored. (The X-values are calculated automatically based on the sampling frequency, and starting at zero. Note that this assumes that the data is equally X-spaced.) The second column holds the Real sample data. If the file is Complex, the third column holds the Quadrature sample data. Titles may optionally be included in the file in the following order: Main Title (line 1), Y-Title (line 2), X-Title (line 3). Note: if you include any title, you must include all three.
  • Text:FIR. This format is identical to Text:Decimal except that the first line holds the number of data points in the file.
  • Text:C. This format outputs the data as C-language code. See C Options for details.
  • Text:Analyzer. This format is produced by Hewlett-Packard logic analyzers. (Read only.)

Fractional Formats (N-Bit Signed)

  • Text:Fract. This format is similar to Text:Decimal except that the data consists of decimal integers representing N-bit fractional data. For example, if N is 16, "32767" represents "+0.999969482" and "-32768" represents -1.0.
  • Text:Hex. This format is similar to Text:Fract except that the data consists of hexadecimal integers representing N-bit fractional data. For example, if N is 16, "7FFF" represents "+0.999969482" and "8000" represents "-1.0."
  • Text:Binary. This format is similar to Text:Decimal except that the data consists of binary integers representing N-bit fractional data. For example, if N is 16, "0111111111111111" represents "+0.999969482" and "1000000000000000" represents "-1.0."

ScopeFIR supports the following Assembly file formats:

  • Asm:TI Fixed. This format is used to generate assembly code data for Texas Instruments fixed-point devices. It creates a 16-bit fractional representation (like Text:Fract above.) See TI Fixed-Point Assembly Options for details. (Write only.)
  • Asm:ADI PM. This format is used for initializing Program Memory (PM) of Analog Devices fixed-point DSP microprocessors. PM data consists of 24-bits (6 hex digits.) On read, all 24 bits are read; on right, the lower 8 bits are rounded up into the upper 16 bits, and the lower 8 bits are given as "00". This provides 16-bit coefficients when FIR filter coefficients are read from PM in the usual way.

ScopeFIR supports the following Binary file formats:

  • Binary:Float. This format represents data as IEEE 4-byte floating-point numbers. If the file is Complex, the data is stored in Inphase, Quadrature pairs.
  • Binary:Double. This format is identical to binary:float except that it holds IEEE 8-byte floating-point numbers.
  • Binary:Wave. This format is the "Wave" format used by Microsoft Windows. If the data is "mono" it is a treated as a Real file holding an Inphase signal; if it is "stereo", it can be treated as a Complex file holding Inphase data in the Left channel and Quadrature data in the Right channel. (Note that this is not strictly correct because "stereo" is not the same as "quadrature", but mapping Stereo to Complex is a pragmatic approach.)

ScopeFIR 5 Help