Filter Designer
Design filters starting with algorithm selection
Description
The Filter Designer app enables you to design and analyze digital filters. You can also import and modify existing filter designs.
Using the app, you can:
Choose a response type and filter design method
Set filter design specifications
Analyze, edit, and optimize a filter design
Export a filter design or generate MATLAB® code
For more information, see Introduction to Filter Designer.
More
If the DSP System Toolbox™ product is installed, Filter Designer integrates advanced
filter design methods and the ability to quantize filters. For more information, see
filterDesigner
(DSP System Toolbox).
Note
This app requires a screen resolution greater than 640 × 480.
Open the Filter Designer App
MATLAB Toolstrip: On the Apps tab, under Signal Processing and Communications, click the app icon.
Enter
filterDesigner
in the MATLAB command prompt.
Examples
FIR Bandpass Filter with Asymmetric Attenuation
Use the Filter Designer app to create a 50th-order equiripple FIR bandpass filter to be used with signals sampled at 1 kHz.
N = 50; Fs = 1e3;
Specify that the passband spans frequencies of 200–300 Hz and that the transition region on either side has a width of 50 Hz.
Fstop1 = 150; Fpass1 = 200; Fpass2 = 300; Fstop2 = 350;
Specify weights for the optimization fit:
3 for the low-frequency stopband
1 for the passband
100 for the high-frequency stopband
Open the Filter Designer app.
Wstop1 = 3; Wpass = 1; Wstop2 = 100; filterDesigner
Use the app to design the rest of the filter. To specify the frequency constraints and magnitude specifications, use the variables you created.
Set Response Type to
Bandpass
.Set Design Method to
FIR
. From the drop-down list, selectEquiripple
.Under Filter Order, specify the order as
N
.Under Frequency Specifications, specify Fs as
Fs
.Click Design Filter.
Arbitrary Magnitude Filter
Design an FIR filter with the following piecewise frequency response:
A sinusoid between 0 and 0.19π rad/sample.
F1 = 0:0.01:0.19; A1 = 0.5+sin(2*pi*7.5*F1)/4;
A piecewise linear section between 0.2π rad/sample and 0.78π rad/sample.
F2 = [0.2 0.38 0.4 0.55 0.562 0.585 0.6 0.78]; A2 = [0.5 2.3 1 1 -0.2 -0.2 1 1];
A quadratic section between 0.79π rad/sample and the Nyquist frequency.
F3 = 0.79:0.01:1; A3 = 0.2+18*(1-F3).^2;
Specify a filter order of 50. Consolidate the frequency and amplitude vectors. To give all bands equal weights during the optimization fit, specify a weight vector of all ones. Open the Filter Designer app.
N = 50; FreqVect = [F1 F2 F3]; AmplVect = [A1 A2 A3]; WghtVect = ones(1,N/2); filterDesigner
Use the app to design the filter.
Under Response Type, select the button next to
Differentiator
. From the drop-down list, chooseArbitrary Magnitude
.Set Design Method to
FIR
. From the drop-down list, selectLeast-squares
.Under Filter Order, specify the order as the variable
N
.Under Frequency and Magnitude Specifications, specify the variables you created:
Freq. vector —
FreqVect
.Mag. vector —
AmplVect
.Weight vector —
WghtVect
.
Click Design Filter.
Right-click the y-axis of the plot and select Magnitude to express the magnitude response in linear units.
Related Examples
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)