Main Content

Exporting Filters from Filter Designer

The Filter Designer app provides a simple way to create filter objects (dfilts) from your filter designs. This is particularly useful for saving your filter design to the MATLAB® workspace for use with command line functions. You can also save your filters as MATLAB code by using File > Generate MATLAB code to run in scripts or batch files.

  1. In Filter Designer, click Filter Manager and highlight only the Bandpass Butterworth-1 filter.

  2. Select File > Export.

  3. Set Export to to Workspace. Set Export as to Objects. In Discrete Filter type Hd1. Click Export to export the first filter in your filter bank to an Hd1 dfilt object in the workspace.

  4. Repeat steps 1 through 3 for each of the remaining nine filters. Highlight each filter individually to make it the active filter and change the Discrete Filter name to match the filter number. When you finish you will have 10 dfilt objects in the workspace.

  5. Close the app by selecting File > Close.

  6. On the MATLAB command line, verify that your objects were exported by using the whos command.

    whos
      Name      Size            Bytes  Class           Attributes
    
      Hd1       1x1                    dfilt.df2sos              
      Hd10      1x1                    dfilt.df2sos              
      Hd2       1x1                    dfilt.df2sos              
      Hd3       1x1                    dfilt.df2sos              
      Hd4       1x1                    dfilt.df2sos              
      Hd5       1x1                    dfilt.df2sos              
      Hd6       1x1                    dfilt.df2sos              
      Hd7       1x1                    dfilt.df2sos              
      Hd8       1x1                    dfilt.df2sos              
      Hd9       1x1                    dfilt.df2sos