1. 程式人生 > >《DSP using MATLAB》Problem 7.1

《DSP using MATLAB》Problem 7.1

alt pass convert converts 爸爸 brush ecs image temp

只有春節那麽幾天才能和家人團聚,看著爸爸媽媽一年比一年老,自己還是一無所有,照顧好自己尚且慚愧,真是悲從中來,又能怎麽辦呢,

唯有奮發努力,時不我待,多想想怎麽賺錢,加油。

技術分享圖片

代碼:

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