分享

Matlab freqs 函数

 mzsm 2017-08-17

freqs

模拟滤波器的频率响应

语法:

h = freqs(b,a,w)
[h,w] = freqs(b,a)
[h,w] = freqs(b,a,f)
freqs(b,a)

描述:

freqs 返回一个模拟滤波器的H(jw)的复频域响应(拉普拉斯格式)

 

请给出分子b和分母a

h = freqs(b, a, w) 根据系数向量计算返回模拟滤波器的复频域响应。freqs 计算在复平面虚轴上的频率响应h,角频率w确定了输入的实向量,因此必须包含至少一个频率点。

[h, w] = freqs(b, a) 自动挑选200个频率点来计算频率响应h

[h, w] = freqs(b, a, f) 挑选f个频率点来计算频率响应h

例子:

找到并画出下面传递函数的频率响应

 

Matlab代码:

 

a = [1 0.4 1];

b = [0.2 0.3 1];

w = logspace(-1, 1);

logspace 功能:生成从10的a次方到10的b次方之间按对数等分的n个元素的行向量。n如果省略,则默认值为50。

freqs(b, a, w);

You can also create the plot with:

h = freqs(b,a,w);
mag = abs(h);
phase = angle(h);
subplot(2,1,1), loglog(w,mag)
subplot(2,1,2), semilogx(w,phase)

To convert to hertz, decibels, and degrees, use:

f = w/(2*pi);
mag = 20*log10(mag);
phase = phase*180/pi;

算法:

freqs evaluates the polynomials at each frequency point, then divides the numerator response by the denominator response:

s = i*w;
h = polyval(b,s)./polyval(a,s)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多