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

📄 qam.m

📁 linear time-frequency toolbox
💻 M
字号:
function xo=qam(xi,order)%QAM  QAM modulation of input signal.%    Usage:  xo=qam(xi,order);%%    xi must be a vector of 0's and 1's. %    order must be a power of 2.% Verify inputif ~all((xi==0) + (xi==1))  error('Input vector must consist of only 0s and 1s');end;if mod(log2(order),1)~=0  error('order must be a power of 2.');end;% Get the optimal ordering of bitsbitorder=circbitflip(order);% nbits is number of bits used. Everything will be ordered% in groups of this size.nbits=log2(order);L=length(xi);symbols=L/nbits;% nbits must divide Lif rem(symbols,1)~=0  error('Length of input must be a multiple of log2(order)');end;xi=reshape(xi,nbits,symbols);two_power=(2.^(0:nbits-1)).';% This could be vectorized by a repmat.xo=zeros(symbols,1);for ii=1:symbols  xo(ii)=sum(xi(:,ii).*two_power);end;% xo now consist of numbers in the range 0:order-1% Convert to the corresponding complex root of unity.xo=exp(2*pi*i*bitorder(xo+1)/order);

⌨️ 快捷键说明

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