DSP Builder for Intel® FPGAs (Advanced Blockset): Handbook

ID 683337
Date 6/11/2024
Document Table of Contents Creating a New Design From the DSP Builder FIR Design Example and Changing the Namespaces


  1. Open the FIR design example (demo_firi) from the Filters directory, by typing the following command at the MATLAB command prompt:


  2. In the demo_firi window (the schematic), double-click on the EditParams block to open the setup script setup_demo_firi.m in the MATLAB Editor.
  3. In the Editor, click File > Save As and save as setup_mytutorial.m in a different directory, for example \myexamples.
  4. In the demo_firi window, click File > Save As and save as mytutorial.mdl in the \myexamples directory.
  5. In the main MATLAB window, navigate to the \myexamples directory.
  6. In the Editor, click Edit > Find And Replace, enter dspb_firi in Find what: and my_tutorial in Replace with:. Click Replace All. Click Close. This step ensures all the setup variables do not interfere with any other workspace variables.
  7. Save setup_mytutorial.m.
  8. On the Debug menu click Run setup_mytutorial.m to run the script, which creates the workspace variables to use the schematic design.
  9. To ensure MATLAB runs the setup script on opening (so that the design displays correctly) and just before simulation (so that the parameters are up-to-date and reflect any edits made since opening), perform the following steps:
    1. In the mytutorial window (schematic), on the File menu click Model Properties.
    2. On the Callbacks tab click on PreLoadFcn and replace setup_demo_firi; with setup_mytutorial;.
    3. Repeat for the InitFnc.
    4. Click OK.
  10. In the mytutorial window, double-click on the FilterSystem subsystem, then double-click on InterpolatingFIR block. Replace all instances of dspb_firi with mytutorial. Click OK. These parameters set up the FIR filter.
  11. Double-click on InChanView, block replace all instances of dspb_firi with mytutorial, click OK.
  12. Repeat for the OutChanView block and the following blocks:
    • The input stimulus generation blocks:
      • Sine Wave
      • Const
      • Impulse
      • Random
      • Channel Counter
      • Valid Sequence
    • The downsample blocks:
      • InDownsample
      • OutDownsample.
    • Spectrum analyzers
      • InSpectrum (on the axis properties tab)
      • Outspectrum (on the axis properties tab)
  13. Change the simulation stop time from 20000*dspb_firi.SampleTime to 20000*mytutorial.SampleTime.
  14. Change the title and save your new design.