⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bdc.m

📁 dpcm matlab code in zip format
💻 M
字号:
function [x]=bdc(b0,b);%  [X]=BDC(b0,b) %%  Binary-to-Decimal  conversion %% b0 : sign bit ( 0 represent + sign, and 1 represents - sign)% y  : binary bits after the binary point% x  : a constant in decimal% ---------------------------------------------------------------------------% Example: x=-0.778; b=4;%          [x]=bdc(b0,b);    % returns decimal result.%%      see also QROUND and DBC%% Sabri Gurbuz, 7-27-98% Drexel University
% E-mail:sabrig@cbis.ece.drexel.edu% ***************************************************************************  N=length(b);      % finds the bit precision, By=0;for i=1:N,y=y+b(i)*2^(-i);  % for  x >0, converts from binary to decimalendx=-b0+y;if x < 0 [b0,b,bb]=dbc(x,N+1); %+1 bit is for signy=0;  for i=1:N,  y=y+b(i)*2^(-i);  % for x < 0, converts from binary to decimal  endendx=-b0+y;

⌨️ 快捷键说明

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