Design an FIR lowpass filter. The passband ranges from DC to 4647935d45a634390b3b36ab0fb60a73.png rad/sample. The stopband ranges from 60fbbc83219d3fad8e0a1644ebee2d31.png rad/sample to the Nyquist frequency. Produce three different designs, changing the weights of the bands in the least-squares fit.

In the first design, make the stopband weight higher than the passband weight by a factor of 100. Use this specification when it is critical that the magnitude response in the stopband is flat and close to 0. The passband ripple is about 100 times higher than the stopband ripple.

bhi = firls(18,[0 0.45 0.55 1],[1 1 0 0],[1 100]);

In the second design, reverse the weights so that the passband weight is 100 times the stopband weight. Use this specification when it is critical that the magnitude response in the passband is flat and close to 1. The stopband ripple is about 100 times higher than the passband ripple.

blo = firls(18,[0 0.45 0.55 1],[1 1 0 0],[100 1]);

In the third design, give the same weight to both bands. The result is a filter with similar ripple in the passband and the stopband.

b = firls(18,[0 0.45 0.55 1],[1 1 0 0],[1 1]);

Visualize the magnitude responses of the three filters.

hfvt = fvtool(bhi,1,blo,1,b,1,'MagnitudeDisplay','Zero-phase');

legend(hfvt,'bhi: w = [1 100]','blo: w = [100 1]','b: w = [1 1]')

0aed615a4e2467a03f3c84868f04a5f2.png

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐