主要内容

fdesign。lowpass

低通滤波器规范

Syntax

d = fdesign.lowpass
d = fdesign.lowpass(Spec)
d = fdesign.lowpass(SPEC,specvalue1,specvalue2,...)
d = fdesign.lowpass(SpecValue1,Specvalue2,Specvalue3,SpecValue4)
d = fdesign.lowpass(...,Fs)
d = fdesign.lowpass(...,魔法)

描述

d = fdesign.lowpass构建低通滤波器规范对象D, applying default values for the default specification option'fp,fst,ap,ast'

d = fdesign.lowpass(Spec)构造对象D并设置规格进入条目的财产规格。条目规格represent various filter response features, such as the filter order, that govern the filter design. Valid entries for规格如下所示。选项不敏感。

Note

标有星号标记的规格选项需要DSP System Toolbox™软件。

  • 'fp,fst,ap,ast'(默认选项)

  • 'N,F3db'

  • 'n,f3db,ap'*

  • 'n,f3db,ap,ast'*

  • 'N,F3db,Ast'*

  • 'N,F3db,Fst'*

  • 'N,Fc'

  • 'n,fc,ap,ast'

  • 'N,Fp,Ap'

  • 'N,Fp,Ap,Ast'

  • 'n,fp,fst,ap'*

  • 'n,fp,f3db'*

  • 'n,fp,fst'

  • 'n,fp,fst,ast'*

  • 'N,Fst,Ap,Ast'*

  • 'N,Fst,Ast'

  • 'nb,na,fp,fst'*

过滤器规范定义如下:

  • Ap— amount of ripple allowed in the pass band in decibels (the default units). Also called Apass.

  • Ast— attenuation in the stop band in decibels (the default units). Also called Astop.

  • F3DB- 点3 dB点以下的截止频率。在归一化频率单元中指定。

  • FC- 点6 dB点以下的截止频率。在归一化频率单元中指定。

  • fp— frequency at the start of the pass band. Specified in normalized frequency units. Also called Fpass.

  • FST- 停止频段末端的频率。在归一化频率单元中指定。也称为FSTOP。

  • N- 过滤订单。

  • NANBare the order of the denominator and numerator.

Graphically, the filter specifications look similar to those shown in the following figure.

规范值之间的区域fpFSTare transition regions where the filter response is not explicitly defined.

d = fdesign.lowpass(SPEC,specvalue1,specvalue2,...)构建一个对象D并在施工时间设置规范值SpecValue1,SpecValue2, and so on for all of the specification variables in规格

d = fdesign.lowpass(SpecValue1,Specvalue2,Specvalue3,SpecValue4)构建一个对象Dwith values for the default规格财产'fp,fst,ap,ast'使用您提供的规格作为输入参数SpecValue1,specvalue2,specvalue3,specvalue4

d = fdesign.lowpass(...,Fs)adds the argumentFS, specified in Hz to define the sampling frequency to use. In this case, all frequencies in the specifications are in Hz as well.

d = fdesign.lowpass(...,魔法)指定您在输入参数中提供的任何规范规范的单位。MAGUNITS可以是之一

  • 'linear'— specify the magnitude in linear units

  • 'dB'- 指定DB(分贝)中的大小

  • 'squared'— specify the magnitude in power units

当您省略MAGNUNITS争论,fdesign假设所有幅度都在分贝中。注意fdesign无论您如何指定幅度如何,都将所有幅度的规格存储在分贝中(必要时转换为分贝)。

例子

全部收缩

Design a butterworth filter with lowpass and highpass frequency responses. The filter design procedure is:

  1. 使用A指定过滤器设计规范fdesign功能。

  2. 选择由设计methods功能。

  3. 要确定可供选择的可用设计选项,请使用DesignOptions功能。

  4. 使用设计功能。

低通滤波器

使用使用默认的低通滤波器设计规范对象fdesign。lowpass

designspecs = fdesign.lowpass
Designspecs= lowpass with properties: Response: 'Lowpass' Specification: 'Fp,Fst,Ap,Ast' Description: {4x1 cell} NormalizedFrequency: 1 Fpass: 0.4500 Fstop: 0.5500 Apass: 1 Astop: 60

Determine the available design methods using the设计methods功能。要设计Butterworth过滤器,请选择牛油

DesignMethods(DesignSpecs,'SystemObject',true)
支持系统对象的设计方法fdesign.l万博1manbetxowpass(FP,FST,AP,AST):Butter Cheby1 Cheby2 Ellip Equiripple ifir ifir ifir kaiserwin多阶段

While designing the filter, you can specify additional design options. View a list of the options using theDesignOptions功能。This function also shows the default design options the filter uses.

DesignOptions(DesignSpecs,'牛油','SystemObject',true)
ans =带有字段的结构:FilterStructure: {1x6 cell} SOSScaleNorm: 'ustring' SOSScaleOpts: 'fdopts.sosscaling' MatchExactly: {'passband' 'stopband'} DefaultFilterStructure: 'df2sos' DefaultMatchExactly: 'stopband' DefaultSOSScaleNorm: '' DefaultSOSScaleOpts: [1x1 fdopts.sosscaling]

Use the设计设计过滤器的功能。经过'牛油'以及变量给出的规格Designspecs,作为输入参数。指定“匹配”设计选项'passband'

lpFilter = design(designSpecs,'牛油',“匹配”,'passband','SystemObject',true);

可视化设计过滤器的频率响应。

fvtool(lpfilter)

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

Highpass Filter

使用使用高通滤波器设计规范对象fdesign.highpass。指定order to be 7 and the 3 dB frequency to be 0 6 π 弧度/样品。

designspecs = fdesign.highhighpass('N,F3dB',7,.6);

Determine the available design methods. To design a butterworth filter, pick牛油

DesignMethods(DesignSpecs,'SystemObject',true)
Design Methods that support System objects for class fdesign.highpass (N,F3dB): butter maxflat

While designing the filter, you can specify additional design options. View a list of the options using theDesignOptions功能。This function also shows the default design options the filter uses.

DesignOptions(DesignSpecs,'牛油','SystemObject',true)
ans =带有字段的结构:FilterStructure: {1x6 cell} SOSScaleNorm: 'ustring' SOSScaleOpts: 'fdopts.sosscaling' DefaultFilterStructure: 'df2sos' DefaultSOSScaleNorm: '' DefaultSOSScaleOpts: [1x1 fdopts.sosscaling]

To design the butterworth filter, use the设计function and specify'牛油'作为输入。放'FilterStructure'to“ cascadeallpass”

hpFilter = design(designSpecs,'牛油','FilterStructure',“ cascadeallpass”,'SystemObject',true);

可视化高通频率响应。

fvtool(hpfilter)

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

Lowpass filter a discrete-time signal consisting of two sine waves.

创建低通滤波器规范对象。指定通带频率为 0 1 5 π RAD/样本和停止带频率为 0 2 5 π rad/sample. Specify 1 dB of allowable passband ripple and a stopband attenuation of 60 dB.

d = fdesign.lowpass('fp,fst,ap,ast',0.15,0.25,1,60);

查询过滤器规范对象的有效设计方法,d

DesignMethods(D)
Design Methods for class fdesign.lowpass (Fp,Fst,Ap,Ast): butter cheby1 cheby2 ellip equiripple ifir kaiserwin multistage

创建一个fir equiripple滤波器,并使用fvtool

高清= design(d,'equiripple');FVTool(HD)

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

Create a signal consisting of the sum of two discrete-time sinusoids with frequencies of π / 8 π / 4 RAD/样品和幅度分别为1和0.25。用FIR Equiripple滤波器对象过滤离散的时间信号,高清

n = 0:159;x =(0.25*cos((pi/8)*n)+sin((pi/4)*n));y =过滤器(HD,X);

计算原始信号和过滤信号的傅立叶变换。验证高频组件已被过滤。

freq = 0:(2*pi)/160:pi; xdft = fft(x); ydft = fft(y); figure plot(freq/pi,abs(xdft(1:length(x)/2+1))) holdplot(freq/pi,abs(ydft(1:length(y)/2+1))) hold离开传奇(“原始信号”,“过滤信号”)ylabel('Magnitude')xlabel(“归一化频率(\ times \ pi rad/样品)”)

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent Original Signal, Filtered Signal.

创建一个过滤器的顺序10 6分贝的频率of 9.6 kHz and a sampling frequency of 48 kHz. Look at the available design methods.

d = fdesign.lowpass('N,Fc',10,9600,48000);DesignMethods(D)
Design Methods for class fdesign.lowpass (N,Fc): window

The only valid design method is the FIR window method. Design the filter.

高清= design(d);

显示滤波器量响应。如预期的那样,-6 dB点为9.6 kHz。

FVTool(HD)

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

Create an FIR equiripple filter with a passband frequency of 0 2 π RAD/样本,停止带频率 0 2 5 π RAD/样品,1 dB的通带纹波和60 dB的停止率衰减。使用20 dB/rad/示例线性挡块设计过滤器。

d = fdesign.lowpass('fp,fst,ap,ast',0.2,0.25,1,60);HD =设计(D,'equiripple',“停止式尺寸”,'linear','StopbandDecay',20);

Visualize the frequency response of the filter.

FVTool(HD)

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

Version History

Introduced in R2009a