Nexus 发表于 2012-11-10 20:00:30

Matlab IIR滤波器设计,求教

本帖最后由 Nexus 于 2012-11-10 20:01 编辑

用MatLab的fdatool设计了滤波器,然后导出头文件,参数什么的先不管,有以下疑问:
1.NL这个数组是干嘛用的?
2.const real32_T NUM = {....这个为什么要二维数组呢?如果单纯是系数的话,一维的就够了。
3.const real32_T NUM和 const real32_T DEN 这两个数组如何配合使用?分别什么意思啊·???
4.这个图片里Order是22,那这个section是什么意思?

求指教大神,数字信号处理学过,都忘记了。。。

最后贴一下代码:
/*
* Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool
*
* Generated by MATLAB(R) 7.12 and the Signal Processing Toolbox 6.15.
*
* Generated on: 10-Nov-2012 19:57:29
*
*/

/*
* Discrete-Time IIR Filter (real)
* -------------------------------
* Filter Structure    : Direct-Form II, Second-Order Sections
* Number of Sections: 11
* Stable            : Yes
* Linear Phase      : No
*/

/* General type conversion for MATLAB generated C-code*/
#include "tmwtypes.h"
/*
* Expected path to tmwtypes.h
* C:\Program Files\MATLAB\R2011a\extern\include\tmwtypes.h
*/
/*
* Warning - Filter coefficients were truncated to fit specified data type.
*   The resulting response may not match generated theoretical response.
*   Use the Filter Design & Analysis Tool to design accurate
*   single-precision filter coefficients.
*/
#define MWSPT_NSEC 23
const int NL = { 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1 };
const real32_T NUM = {
{
    0.09686300904,            0,            0
},
{
                1,            2,            1
},
{
    0.08955428004,            0,            0
},
{
                1,            2,            1
},
{
    0.08345051855,            0,            0
},
{
                1,            2,            1
},
{
    0.07838561386,            0,            0
},
{
                1,            2,            1
},
{
    0.07421958447,            0,            0
},
{
                1,            2,            1
},
{
    0.07083738595,            0,            0
},
{
                1,            2,            1
},
{
    0.06814649701,            0,            0
},
{
                1,            2,            1
},
{
    0.06607432663,            0,            0
},
{
                1,            2,            1
},
{
    0.06456578523,            0,            0
},
{
                1,            2,            1
},
{
    0.06358129531,            0,            0
},
{
                1,            2,            1
},
{
    0.06309531629,            0,            0
},
{
                1,            2,            1
},
{
                1,            0,            0
}
};
const int DL = { 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1 };
const real32_T DEN = {
{
                1,            0,            0
},
{
                1,   -1.530096531,   0.9175485373
},
{
                1,            0,            0
},
{
                1,   -1.414644241,   0.7728613615
},
{
                1,            0,            0
},
{
                1,   -1.318226099,    0.652028203
},
{
                1,            0,            0
},
{
                1,   -1.238218307,   0.5517607927
},
{
                1,            0,            0
},
{
                1,   -1.172409654,   0.4692879915
},
{
                1,            0,            0
},
{
                1,   -1.118982673,   0.4023322761
},
{
                1,            0,            0
},
{
                1,   -1.076476097,    0.349062115
},
{
                1,            0,            0
},
{
                1,   -1.043743134,   0.3080404103
},
{
                1,            0,            0
},
{
                1,   -1.019913435,   0.2781765163
},
{
                1,            0,            0
},
{
                1,   -1.004361987,   0.2586871684
},
{
                1,            0,            0
},
{
                1,-0.9966852069,    0.249066487
},
{
                1,            0,            0
}
};

Nexus 发表于 2012-11-11 08:51:46

求大神的指导啊。。。。

skystalker 发表于 2012-11-20 09:37:21

order是滤波器的阶数 好久没搞了 也忘得差不多了

Nexus 发表于 2012-11-20 09:43:16

skystalker 发表于 2012-11-20 09:37 static/image/common/back.gif
order是滤波器的阶数 好久没搞了 也忘得差不多了

谢谢指导,不过还是没搞清楚,可能需要一次实践过程才能搞明白。。。

skystalker 发表于 2012-11-20 10:02:36

Nexus 发表于 2012-11-20 09:43 static/image/common/back.gif
谢谢指导,不过还是没搞清楚,可能需要一次实践过程才能搞明白。。。

IIR和FIR都不复杂 就是求卷积之类的 自己推一次就明白了

MidoriYakumo 发表于 2015-5-11 00:42:32

一般都用直接2型吧, 是n个二阶滤波器的串联
http://zlgc.seu.edu.cn/jpkc2/ipkc/signal/new/importent/zhang5_6/gif/iisstrgai.gif

Nexus 发表于 2015-5-11 09:10:59

MidoriYakumo 发表于 2015-5-11 00:42
一般都用直接2型吧, 是n个二阶滤波器的串联

我现在明白了,谢谢,直接二型。

xuekcd 发表于 2015-5-11 11:15:51

22阶,延迟会不会太长了呀?

Nexus 发表于 2015-5-11 12:49:21

xuekcd 发表于 2015-5-11 11:15
22阶,延迟会不会太长了呀?

只要频率响应过得去就可以的。阶数高主要是截止频率下降快。
页: [1]
查看完整版本: Matlab IIR滤波器设计,求教