Skip to Main Content Skip to Search
Product Documentation

Generating a C Header File

You may want to include filter information in an external C program. To create a C header file with variables that contain filter parameter data, follow this procedure:

  1. Select Targets > Generate C Header. The Generate C Header dialog box appears.

  2. Enter the variable names to be used in the C header file. The particular filter structure determines the variables that are created in the file

    Filter Structure

    Variable Parameter

    Direct-form I
    Direct-form II
    Direct-form I transposed
    Direct-form II transposed

    Numerator, Numerator length*, Denominator, Denominator length*, and Number of sections (inactive if filter has only one section)

    Lattice ARMA

    Lattice coeffs, Lattice coeffs length*, Ladder coeffs, Ladder coeffs length*, Number of sections (inactive if filter has only one section)

    Lattice MA

    Lattice coeffs, Lattice coeffs length*, and Number of sections (inactive if filter has only one section)

    Direct-form FIR Direct-form FIR transposed

    Numerator, Numerator length*, and Number of sections (inactive if filter has only one section)

    *length variables contain the total number of coefficients of that type.

      Note   Variable names cannot be C language reserved words, such as "for."

  3. Select Export Suggested to use the suggested data type or select Export As and select the desired data type from the pull-down.

      Note   If you do not have DSP System Toolbox software installed, selecting any data type other than double-precision floating point results in a filter that does not exactly match the one you designed in the FDATool. This is due to rounding and truncating differences.

  4. Click OK to save the file and close the dialog box or click Apply to save the file, but leave the dialog box open for additional C header file definitions.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS