DSP Blockset Previous page   Next Page

Customizing an Adaptive Filter

In the previous topic, Creating an Adaptive Filter, you created an adaptive filter and used it to remove the noise generated by the Acoustic Environment subsystem. In this topic, you modify the adaptive filter and adjust its parameters during simulation. This topic assumes that you are working on a Windows operating system and that you completed the procedures discussed in Creating an Adaptive Filter:

  1. Double-click the LMS filter block.
  2. From the Specify step-size via list, choose Input port.
  3. Select the Show additional parameters check box.
  4. For the Initial value of filter weights parameter, enter 0 to set the initial filter coefficients to 0.
  5. Select the Enable/disable adaptation via input port check box.
  6. From the Reset input list, select Non-zero sample.

  1. The Block Parameters: LMS Filter dialog box should now look similar to the following figure.

  1. Click OK.

  1. Step-size, Adapt, and Reset ports appear on the LMS Filter block.

  1. Click-and-drag the following blocks into your model.

    Block
    Library
    Quantity
    Constant
    Simulink/Sources
    6
    Manual Switch
    Simulink/Signal Routing
    3
  2. Connect the blocks as shown in the following figure.

  3. Double-click the Constant2 block. Set the parameters as shown in the following figure.

  1. Click OK.
  2. Double-click the Constant3 block. Set the parameters as shown below.

  3. Click OK.
  4. Double-click the Constant4 block and set the Constant value parameter to 0.
  5. Click OK.
  6. Double-click the Constant6 block and set the Constant value parameter to 0.
  7. Click OK.
  8. In the model window, from the Format menu, select Wide nonscalar lines and Signal dimensions.
  9. Double-click Manual Switch2 so that the input to the Adapt port is 1.
  10. Run the simulation and view the results in the Waterfall scope window. You can also listen to the simulation using the speakers attached to your computer.
  11. Double-click the Manual Switch so that the input to the Acoustic Environment subsystem is 1. Then, double-click Manual Switch2 so that the input to the Adapt port to 0.

  1. The filter weights displayed in the Waterfall scope window remain constant. When the input to the Adapt port is 0, the filter weights are not updated.

  1. Double-click Manual Switch2 so that the input to the Adapt port is 1.

  1. The LMS Filter block updates the coefficients.

  1. Connect the Manual Switch1 block to the Constant block that represents 0.002. Then, change the input to the Acoustic Environment subsystem. Repeat this procedure with the Constant block that represents 0.04.

  1. You can see that the system reaches steady state faster when the step-size is larger.

  1. Double-click Manual Switch3 so that the input to the Reset port is 1.

  1. The block resets the filter weights to their initial values. In the Block Parameters: LMS Filter dialog box, from the Reset input list, you chose Non-zero sample. This means that any nonzero input to the Reset port triggers a reset operation.

You have now experimented with adaptive noise cancellation using the LMS Filter block. You adjusted the parameters of your adaptive filter and viewed the effects of your changes while the model was running.

For more information about adaptive filters, see the following block reference pages: LMS Filter, RLS Filter, Block LMS Filter, and Fast Block LMS Filter.


Previous page  Creating an Adaptive Filter Adaptive Filtering Demos Next page

Learn more about the latest releases of MathWorks products:

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