?? 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 + -