firls在matlab,Least-squares linear-phase FIR filter design
Design an FIR lowpass filter. The passband ranges from DC torad/sample. The stopband ranges fromrad/sample to the Nyquist frequency. Produce three different designs, changing the weights of the ba...
Design an FIR lowpass filter. The passband ranges from DC to
rad/sample. The stopband ranges from
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]')

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


所有评论(0)