hB

function Coef = LowPassHb(Fs,Fpass,Apass,n)

% -- Fs sample frequency

% -- Fpass

% -- Apass(dB)

% -- n stage of the half band fir

fp = Fpass*2/(Fs);

dev = [(10^(Apass/20)-1)/(10^(Apass/20)+1)];

% dev = Apass;

switch nargin

    case 3

        Coef = firhalfband('minorder',fp,dev);

    case 4

        Coef = firhalfband(n,fp);

    otherwise

        error('error');

end

        Coef = Coef';

   

 vpa(Coef,16);

fft_coe = 20*log(abs(fft(Coef,1024)))/log(10);

 

% x_f = [0:(Fs/length(fft_coe)):Fs/2];

% m = fft_coe(1:length(x_f));

% plot(x_f,m),grid

 

fft_shift_coe = fftshift(fft_coe);

x_f = [-Fs/2+(Fs/length(fft_shift_coe)):(Fs/length(fft_shift_coe)):Fs/2];

plot(x_f,fft_shift_coe);grid

转载于:https://www.cnblogs.com/zhongguo135/p/5579461.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值