📄 iqam.m
字号:
function xo=iqam(xi,order)%IQAM Inverse QAM modulation of signal.%% order must be a power of 2.% xo is a vector of 0's and 1's. % This program is free software: you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation, either version 3 of the License, or% (at your option) any later version.% % This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.% % You should have received a copy of the GNU General Public License% along with this program. If not, see <http://www.gnu.org/licenses/>.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);symbols=length(xi);L=symbols*nbits;% We round the argument of the complex numbers to the closest root of% unity of order "order"work=round(angle(xi)/(2*pi)*order);% work now contains negative numbers. Get rid of thesework=mod(work,order);% Reverse the optimal bit ordering.reversebitorder=zeros(order,1);reversebitorder(bitorder+1)=(0:order-1).';% Apply the reverse orderingwork=reversebitorder(work+1);xo=zeros(nbits,symbols);% Reconstruct the bitsfor bit=1:nbits xo(bit,:)=bitget(work,bit).';end;xo=xo(:);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -