码迷,mamicode.com
首页 > 其他好文 > 详细

《DSP using MATLAB》Problem 7.1

时间:2019-02-16 23:11:36      阅读:356      评论:0      收藏:0      [点我收藏+]

标签:tla   --   ima   nbsp   using   div   abs   func   code   

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

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

 

技术图片

代码:

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));

  运行结果:

技术图片

《DSP using MATLAB》Problem 7.1

标签:tla   --   ima   nbsp   using   div   abs   func   code   

原文地址:https://www.cnblogs.com/ky027wh-sx/p/10389720.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!