0
0
Simulinkdata~7 mins

Digital filter implementation in Simulink

Choose your learning style9 modes available
Introduction

A digital filter helps clean or change signals by removing unwanted parts or enhancing useful parts.

Removing noise from audio recordings to hear voices clearly.
Smoothing sensor data from a wearable device to get steady readings.
Separating different frequency parts in a music track for effects.
Improving image quality by filtering pixel values.
Extracting heartbeats from noisy ECG signals.
Syntax
Simulink
1. Open Simulink.
2. Add a 'Digital Filter' block from the DSP System Toolbox.
3. Set filter parameters (type, order, cutoff frequencies).
4. Connect input signal to the filter block.
5. Connect filter output to display or sink block.
6. Run the simulation.

You can choose filter types like low-pass, high-pass, band-pass, or band-stop.

Filter order controls how sharp the filter works; higher order means sharper filtering but more computation.

Examples
This keeps signals below 1000 Hz and removes higher frequencies.
Simulink
Use a low-pass filter block with cutoff frequency 1000 Hz to remove high-frequency noise.
This allows only signals in this range to pass through, blocking others.
Simulink
Set a band-pass filter block to pass frequencies between 300 Hz and 3000 Hz.
This removes slow changes or trends in the signal below 500 Hz.
Simulink
Use a high-pass filter block with cutoff frequency 500 Hz to remove low-frequency drift.
Sample Program

This example shows how to filter a sine wave signal to remove frequencies above 50 Hz using a low-pass FIR filter in Simulink.

Simulink
1. Open Simulink and create a new model.
2. Add a 'Sine Wave' block to generate a signal.
3. Add a 'Digital Filter' block (from DSP System Toolbox).
4. Double-click the filter block and set it to 'Lowpass FIR' with cutoff frequency 50 Hz.
5. Connect the Sine Wave output to the filter input.
6. Add a 'Scope' block to see the output.
7. Connect the filter output to the Scope input.
8. Run the simulation.

% This setup filters the sine wave signal to keep frequencies below 50 Hz.
OutputSuccess
Important Notes

Always check the filter type and parameters to match your signal needs.

Simulation speed may slow down with very high filter orders.

Use the Scope block to visually check how the filter changes the signal.

Summary

Digital filters clean or change signals by removing or keeping certain frequencies.

Simulink uses blocks to build and run digital filters visually.

Choose filter type and parameters carefully to get the desired signal effect.