📄 qam_slicer.m
字号:
function y = QAM_Slicer(Y,Nbits,opt);% y = QAM_Slicer(Y,Nbits);%% Slices a QAM signal with Nbits resolution of both I and Q% components. %% Input parameters:% Y complex input (scalar or vector)% Nbits resolution of real and imag part of Y% opt opt='norm' sets re-normlaisation to unit variance%% Output parameters:% y 2*2^Nbit QAM symbol Ly = length(Y);Levels = 2^Nbits;% rescalingScale = [0.7071; 1.5811; 3.2404; 6.5192];Y = Y*Scale(Nbits);% **** decision slicer ****i = round(real(Y)+(Levels-1)/2);i(i<0) = 0;i(i>(Levels-1)) = Levels-1;q = round(imag(Y)+(Levels-1)/2);q(q<0) = 0;q(q>(Levels-1)) = Levels-1;% restore QAM symboly = i-(Levels-1)/2 + sqrt(-1)*(q-(Levels-1)/2);if exist('opt'), if opt=='renorm', y = y/Scale(Nbits); end;end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -