| DSP Blockset |
 |
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.
Note
You can open many of the example models in the online version of this document by clicking links or by typing specified commands at the MATLAB command line. The links for opening example models do not work in Web browsers; they work only in the MATLAB Help browser, which you can open by typing doc at the MATLAB command line.
|
- Open the model that contains the highpass and lowpass filter described in Implementing a Lowpass Filter and Implementing a Highpass Filter.
- Click and drag the blocks in this table into your model file.
- 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
|
- 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.
- From the Simulation menu, choose Simulation parameters.
- Set the Simulation parameters as indicated in the following figure.
- Click OK.
- In the model window, from the Simulation menu, choose Start.
- 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.
- 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.
- You can also set the color, style, and marker of each channel.
- 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.
- 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.

- Rerun the simulation and compare the original sine wave, noisy sine wave, and filtered noisy sine wave in the Vector Scope display.
- You can see that the lowpass filter filters out the high-frequency noise in the noisy sine wave.
| Implementing a Highpass Filter | | Digital Filter Design Block |  |
Learn more about the latest releases of MathWorks products:
|