fdesign.lowpass; error messages of one of examples
11 ビュー (過去 30 日間)
古いコメントを表示
D = fdesign.lowpass('Fp,Fst,Ap,Ast',0.2,0.25,1,60);
Hd = design(D,'equiripple','StopbandShape','linear','StopbandDecay',20);
Why does the above example, which is provided as one of exmaples of fdesign.lowpass, generate the following error messages?
'StopbandShape' is not a valid design option for EQUIRIPPLE.
Hd = feval(method, this, varargin{:},sysObjArgsDesign{:});
varargout{1} = superdesign(this, varargin{:});
Any suggestion to make it work.
0 件のコメント
回答 (3 件)
Aditya
2024 年 7 月 3 日
編集済み: Aditya
2024 年 7 月 3 日
Hi Jongsoo,
Please refer to this MATLAB Answer Post: the error information when i use fdesign.lowpass to design a filter. - MATLAB Answers - MATLAB Central (mathworks.com)
Also refer to this "fdesign.lowpass" function document: https://in.mathworks.com/help/dsp/ref/fdesign.lowpass.html#:~:text=Specifications%20options%20marked%20with%20an%20asterisk%20require%20the%20DSP%20System%20Toolbox%E2%84%A2%20software.
I hope this clarifies your issue!
0 件のコメント
Jongsoo Kim
2024 年 7 月 3 日
1 件のコメント
Aditya
2024 年 7 月 3 日
The issue you are encountering is likely due to the absence of the DSP System Toolbox in your MATLAB installation. The fdesign.lowpass function and some of its advanced design options, such as 'StopbandShape' and 'StopbandDecay', require the DSP System Toolbox to be installed. Without this toolbox, these options are not available, leading to the error messages you are seeing.
To verify whether the DSP System Toolbox is installed and whether you can access the 'StopbandShape' option, try the following commands:
>> D = fdesign.lowpass('Fp,Fst,Ap,Ast',0.2,0.25,1,60);
>> help(D, 'equiripple')
If the DSP System Toolbox is installed, you should see the following information, which includes the 'StopbandShape' option:
>> help(D, 'equiripple')
DESIGN Design a Equiripple FIR filter.
HD = DESIGN(D, 'equiripple') designs a Equiripple filter specified by the
FDESIGN object D, and returns the DFILT/MFILT object HD.
HD = DESIGN(D, ..., 'SystemObject', true) implements the filter, HD,
using a System object instead of a DFILT/MFILT object.
HD = DESIGN(..., 'FilterStructure', STRUCTURE) returns a filter with the
structure STRUCTURE. STRUCTURE is 'dffir' by default and can be any of
the following:
'dffir'
'dffirt'
'dfsymfir'
'fftfir'
Some of the listed structures may not be supported by System object
filters. Type validstructures(D, 'equiripple', 'SystemObject', true) to
get a list of structures supported by System objects.
HD = DESIGN(..., 'DensityFactor', DENS) specifies the grid density DENS
used in the optimization. DENS is 16 by default.
HD = DESIGN(..., 'MinPhase', MPHASE) designs a minimum-phase filter
when MPHASE is TRUE. MPHASE is FALSE by default.
HD = DESIGN(..., 'MaxPhase', MPHASE) designs a maximum-phase filter
when MPHASE is TRUE. MPHASE is FALSE by default.
HD = DESIGN(..., 'MinOrder', 'any') designs a minimum-order filter.
The order of the filter can be even or odd. This is the default.
HD = DESIGN(..., 'MinOrder', 'even') designs a minimum-even-order filter.
HD = DESIGN(..., 'MinOrder', 'odd') designs a minimum-odd-order filter.
HD = DESIGN(..., 'StopbandShape', SHAPE) designs a filter whose stopband
has the shape defined by SHAPE. SHAPE can be 'flat', '1/f', or 'linear'.
SHAPE is 'flat' by default.
HD = DESIGN(..., 'StopbandDecay', DECAY) specifies the decay to use when
'StopbandShape' is not set to 'flat'. When the shape is '1/f' this
specifies the power that 1/f is raised. When shaped is 'linear' this
specifies the slope of the stopband in dB/rad/s.
HD = DESIGN(..., 'UniformGrid', UGRID) specifies the type of frequency
grid that is used to measure the error between the actual and the desired
frequency response of the filter. When UGRID is TRUE, approximation errors
are measured over a uniform frequency grid. When UGRID is FALSE, a non-uniform
frequency grid is used. In some cases, emphasizing the number of frequency
points in the proximity of transition regions of the filter response may
improve the design. If omitted, UGRID defaults to TRUE except when 'MinPhase'
'MaxPhase', 'MinOrder', or 'StopbandShape' options are set to non-default values.
% Example #1 - Design a lowpass Equiripple filter in a transposed structure.
h = fdesign.lowpass('Fp,Fst,Ap,Ast');
Hd = design(h, 'equiripple', 'FilterStructure', 'dffirt');
Star Strider
2024 年 7 月 3 日
@Jongsoo Kim — Your posted code works in R2024a, as demonsttrated here. You did not post the version you are using, and there could be version differences. The current online documentation is for R2024a only.
Run this in your Command Window:
help fdesign.lowpass
or to open the help browser entry for it:
doc fdesign.lowpass
again as I did here however in your Command Window, to see what tthe options are in your version.
D = fdesign.lowpass('Fp,Fst,Ap,Ast',0.2,0.25,1,60);
Hd = design(D,'equiripple','StopbandShape','linear','StopbandDecay',20);
figure
freqz(Hd.Numerator,1, 2^16)
help fdesign.lowpass
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Filter Design についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!