DSP Blockset Previous page   Next Page

Filtering High-Frequency Noise

In the model, digitalfilter_tut.mdl, high-frequency noise is output by a highpass filter 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. In this procedure, you create this model and simulate its behavior.

  1. Open the model that contains the highpass and lowpass filter described in Implementing a Lowpass Filter and Implementing 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. For any parameters not listed in the table, leave them 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.


Previous page  Implementing a Highpass Filter Digital Filter Design Block 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