matlab d a,谁有模数(A/D)转换的MATLAB程序啊 谢谢

function y = d2a(x,b)% d2a(x) - converts bitstream (b bits per sample) to discrete time,% continuous amplitude signal%x - bitstream%b - number bits per samplex=x';N = length(x);L=floor(N...
摘要由CSDN通过智能技术生成

function y = d2a(x,b)

% d2a(x) - converts bitstream (b bits per sample) to discrete time,

%           continuous amplitude signal

%  x - bitstream

%  b - number bits per sample

x=x';

N = length(x);

L=floor(N/b);

qinterval = 2/(2^b-1);

if b<=1;

for i=1:N

if x(i)==0

sig(i)=-1;

else

sig(i)=1;

end

end

else

sig=zeros(L,1);

for k=0:((2^b)-1)

u=dec2bin(k);

w=zeros(1,length(u)); % conversion from interval # to binary

for i=1:length(u)

w(i)=str2num(u(i));

end

v=[zeros((b-length(w)),1)',w];

p(k+1,:)=v;     % p is a vector of binary labels for interval #'s

end

if b~=4

for i=0:L-1                     % mat

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值