Filter design differences between DSP System and Signal Processing toolboxes (fdesign/design)

6 次查看(过去 30 天)
The following two lines have different behavior depending on installed toolboxes:
d = fdesign.highpass('N,F3db',3,1,1000);
Hd = design(d);
Normally, I have BOTH DSP System and Signal Processing toolboxes installed. When I run these lines with both toolboxes installed I get the following error:
Error using fdesign.abstracttype/superdesign (line 90)
For symmetric FIR filters, only even orders are allowed.
Now, if I uninstall DSP System toolbox this pair of lines runs as I expect, and makes a 1Hz highpass filter through which I can run my data in lines following the fdesign/design pair of statements. I presume this means that fdesign/design are available in both toolboxes but for some reason only the one in the Signal Processing toolbox works as I expect, meanwhile if I have DSP System installed that version takes precedence and gives me errors.
Is this behavior correct or is it a bug to be reported to Mathworks? I inherited the code from which these lines are excerpted. I also inherited a Matlab license with several toolboxes I know little about (such as DSP System). Though I've been working with Matlab on and off for decades I've never encountered a case of a function with a "split personality" such as I'm describing with fdesign/design. So from my point of view (limited DSP knowledge) this looks like a bug, but it is possible in my lack of understanding these functions are working correctly with both toolboxes, and therefore I need to learn what I have done (or not done) to cause my errors.

采纳的回答

Abhinav Aravindan
Abhinav Aravindan 2024-9-16
Hi Tim,
The behaviour you are observing seems to be due to the default filter design method selected for filter design. With the “DSP System Toolbox” installed, the default method is selected as “maxflatwhile without the toolbox, the default design specification is selected as “butter, due to which the error occurs. The following function can be used to identify the default design method.
designmethods(d,'default')
As a workaround, you may try to provide the designSpecs parameter in the “design” function as follows:
d = fdesign.highpass('N,F3db',3,1,1000);
Hd = design(d,'butter');
Please find below the related documentation for your reference.
I hope this helps resolve the issue you are facing!
  2 个评论
Tim Betzner
Tim Betzner 2024-9-17
Thank you. I verified this answer using designmethods with and without DSP System installed, confirm 'maxflat' and 'butter' as defaults, respectively. I added 'butter' to my Hd statement and my code runs with DSP System installed now.
Tim Betzner
Tim Betzner 2024-9-17
Curious if there is a solid reason why the default filter is different between the two toolboxes. Otherwise this situation leads to unnecessary confusion.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Filter Design and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by