alog.m

来自「很多matlab的源代码」· M 代码 · 共 34 行

M
34
字号
function y = alog(x,n)
% ALOG Anti-log and dB to gain conversion.
%
%	Z = ALOG(X,N) returns anti-log of X to the base N.
%       Z = ALOG(X)   returns the is anti-log of X to the base e.
%      	If n = 0, ALOG(X,0) returns the gain corresponding to X dB
%
%       ALOG (with no input arguments) invokes the following example:
%
%      	% Compute the gain  corresponding to 20 dB and 8 dB 
%	  >>db = [20 8]
%         >>gain = alog(db,0)


% ADSP Toolbox: Version 2.0 
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998



if nargin==0,help alog,disp('Strike a key to see results of above example')
pause,db=[20 8],gain=alog(db,0),return,end

if nargin==1,n=exp(1);
else
if n==0,n=10;x=x/20;end
end
y=n.^x;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?