DSP Blockset Previous page   Next Page

Filtering High-Frequency Noise

In this topic, you create a model that simulates high-frequency noise being output by a highpass filter that is excited by a uniform random signal. This high frequency noise is added to a sine wave. This noisy sine wave is fed through a lowpass filter that filters out the high-frequency noise.

  1. Open the model that contains the highpass and lowpass filter described in Creating a Lowpass Filter and Creating a Highpass Filter.
  2. Click and drag the blocks in this table into your model file.

    Block
    Library
    Quantity
    Matrix Concatenation
    Math Functions / Matrices and Linear Algebra / Matrix Operations
    1
    Random Source
    DSP Sources
    1
    Sine Wave
    DSP Sources
    1
    Sum
    The Simulink Math Operations library
    1
    Vector Scope
    DSP Sinks
    1
  3. Set the parameters for the rest of the blocks as indicated in the following table. Leave the parameters not listed in the table at their default settings.

    Parameter Settings for the Other Blocks  
    Block
    Parameter Setting
    Matrix Concatenation
    • Number of inputs -- 3
    • Concatenation method -- Horizontal

    Random Source
    • Source type -- Uniform
    • Minimum -- 0
    • Maximum -- 4
    • Sample mode -- Discrete
    • Sample time -- 1/1000
    • Samples per frame -- 50

    Sine Wave
    • Frequency (Hz) -- 75
    • Sample time -- 1/1000
    • Samples per frame -- 50

    Sum
    • Icon shape -- rectangular
    • List of signs -- ++

    Vector Scope
    Scope properties:
    • Input domain -- Time
    • Time display span (number of frames) -- 1

  4. Connect the blocks as shown in the following figure. You might need to resize some of the blocks to make your model look like the figure.

  5. From the Simulation menu, choose Simulation parameters.
  6. Set the Simulation parameters as indicated in the following figure.

  7. Click OK.
  8. In the model window, from the Simulation menu, choose Start.

  1. The model simulation begins and the scope displays the three input signals. When you finish observing the running model, from the Simulation menu, choose Stop.

  1. Double-click the Vector Scope block and select the Show display properties check box. Select the Channel legend check box and click OK. Next time you run the simulation, a legend appears in the Vector Scope window.

  1. You can also set the color, style, and marker of each channel.

  1. In the Vector Scope window, from the Channels menu, point to Ch 1 and set the Style to -, Marker to None, and Color to Black.

  1. Point to Ch 2 and set the Style to -, Marker to Diamond, and Color to Red.

    Point to Ch 3 and set the Style to None, Marker to *, and Color to Blue.

  1. Rerun the simulation and compare the original sine wave, noisy sine wave, and filtered noisy sine wave in the Vector Scope display.

  1. You can see that the lowpass filter filters out the high-frequency noise in the noisy sine wave.

In this example, Digital Filter Design blocks were used to design and implement lowpass and highpass filters. For information on another block capable of designing and implementing filters, see Filter Realization Wizard.

To learn how to save your filter designs, see the Saving and Opening Filter Design Sessions section of the Signal Processing Toolbox documentation. To learn how to import and export your filter designs, see the Importing and Exporting Quantized Filters section of the Filter Design Toolbox documentation.


Previous page  Creating a Highpass Filter Filter Realization Wizard 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