《DSP using MATLAB》Problem 7.1

        只有春节那么几天才能和家人团聚,看着爸爸妈妈一年比一年老,自己还是一无所有,照顾好自己尚且惭愧,真是悲从中来,又能怎么办呢,

唯有奋发努力,时不我待,多想想怎么赚钱,加油。

 

代码:

function [delta1, delta2] = db2delta(Rp, As)
% -------------------------------------------------
% Converts dB specs Rp and As into 
%   absolute specs delta1 and delta2
%  [delta1, delta2] = delta2db(Rp, As)
%  delta1 = passband tolerance ( or ripple), absolute specs
%  delta2 = stopband tolerance ( or ripple), absolute specs 
%      Rp = passband ripple in dB
%      As = stopband attenuation in dB
%
temp = 10^(-Rp/20);
delta1 = (1-temp) / (1+temp);

delta2 = (1+delta1)*(10^(-As/20));

  

function [Rp, As] = delta2db(delta1, delta2)
% -------------------------------------------------
% Converts absolute specs delta1 and delta2 into 
%   dB specs Rp and As
%  [Rp, As] = delta2db(delta1, delta2)
%  delta1 = passband tolerance ( or ripple), absolute specs
%  delta2 = stopband tolerance ( or ripple), absolute specs 
%      Rp = passband ripple in dB
%      As = stopband attenuation in dB
%

Rp = -20 * log10( (1-delta1)/(1+delta1));
As = -20 * log10( delta2 / (1+delta1));

  运行结果:

转载于:https://www.cnblogs.com/ky027wh-sx/p/10389720.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值