How to Design a Low Pass Filter in Simulink: Step-by-Step Guide
To design a low pass filter in Simulink, use the
Digital Filter block or the Filter Designer app to specify filter type and cutoff frequency. Connect the filter block to your signal source and configure parameters like filter order and cutoff frequency to achieve the desired filtering effect.Syntax
In Simulink, the low pass filter is typically created using the Digital Filter block or by designing a filter in the Filter Designer app and then importing it into your model.
The basic syntax for using the Digital Filter block involves setting these parameters:
- Filter type: Choose 'Lowpass' to allow low frequencies and block high frequencies.
- Filter order: Determines the steepness of the filter cutoff.
- Cutoff frequency: The frequency threshold below which signals pass.
simulink
Digital Filter block parameters: - Filter type: 'Lowpass' - Filter order: integer (e.g., 4) - Cutoff frequency: normalized frequency (0 to 1, where 1 = Nyquist frequency)
Example
This example shows how to design a 4th order low pass Butterworth filter with a cutoff frequency of 100 Hz for a signal sampled at 1000 Hz.
Steps:
- Open Simulink and create a new model.
- Add a
Sine Waveblock as the input signal. - Add a
Digital Filterblock from the DSP System Toolbox. - Double-click the filter block and set:
- Filter type: Lowpass
- Design method: Butterworth
- Filter order: 4
- Cutoff frequency: 0.2 (normalized, since 100/500 = 0.2)
- Connect the blocks and add a
Scopeblock to visualize the filtered output.
matlab
simulink_model = sim('lowpass_filter_example'); % This is a conceptual script to represent the model setup steps. % Actual filter design is done inside Simulink GUI as described.
Output
Simulink model runs and the Scope shows the sine wave with high frequencies filtered out, leaving only frequencies below 100 Hz.
Common Pitfalls
Common mistakes when designing low pass filters in Simulink include:
- Setting cutoff frequency incorrectly without normalizing by Nyquist frequency (half the sample rate).
- Choosing too low filter order, resulting in a gentle slope and poor filtering.
- Using the wrong filter type (e.g., highpass instead of lowpass).
- Not connecting the blocks properly, so the filter does not affect the signal.
Always verify the filter response using the Filter Designer app or by visualizing the output signal.
matlab
%% Wrong cutoff frequency example % Setting cutoff frequency without normalization filter_cutoff = 100; % Incorrect if sample rate is 1000 Hz %% Correct cutoff frequency example sample_rate = 1000; nyquist = sample_rate / 2; filter_cutoff = 100 / nyquist; % Correct normalized cutoff frequency = 0.2
Quick Reference
| Parameter | Description | Example Value |
|---|---|---|
| Filter type | Type of filter to design | Lowpass |
| Filter order | Controls filter steepness | 4 |
| Cutoff frequency | Frequency threshold normalized to Nyquist | 0.2 (for 100 Hz cutoff at 1000 Hz sample rate) |
| Design method | Filter design algorithm | Butterworth |
| Sample rate | Signal sampling frequency | 1000 Hz |
Key Takeaways
Use the Digital Filter block or Filter Designer app to create low pass filters in Simulink.
Always normalize the cutoff frequency by the Nyquist frequency (half the sample rate).
Choose an appropriate filter order to balance sharpness and stability.
Visualize the filtered signal with a Scope block to verify filter performance.
Avoid common mistakes like wrong cutoff frequency or filter type selection.