亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mssfuninterleaver.m

?? cdma2000的下行連路仿真模塊(matlab模塊)
?? M
字號:
function [sys,x0,str,ts] = MSSFUNInterleaver(t,x,u,flag,interleaver_size)
%SFUNTMPL General M-file S-function template
%   With M-file S-functions, you can define you own ordinary differential
%   equations (ODEs), discrete system equations, and/or just about
%   any type of algorithm to be used within a Simulink block diagram.
%
%   The general form of an M-File S-function syntax is:
%       [SYS,X0,STR,TS] = SFUNC(T,X,U,FLAG,P1,...,Pn)
%
%   What is returned by SFUNC at a given point in time, T, depends on the
%   value of the FLAG, the current state vector, X, and the current
%   input vector, U.
%
%   FLAG   RESULT             DESCRIPTION
%   -----  ------             --------------------------------------------
%   0      [SIZES,X0,STR,TS]  Initialization, return system sizes in SYS,
%                             initial state in X0, state ordering strings
%                             in STR, and sample times in TS.
%   1      DX                 Return continuous state derivatives in SYS.
%   2      DS                 Update discrete states SYS = X(n+1)
%   3      Y                  Return outputs in SYS.
%   4      TNEXT              Return next time hit for variable step sample
%                             time in SYS.
%   5                         Reserved for future (root finding).
%   9      []                 Termination, perform any cleanup SYS=[].
%
%
%   The state vectors, X and X0 consists of continuous states followed
%   by discrete states.
%
%   Optional parameters, P1,...,Pn can be provided to the S-function and
%   used during any FLAG operation.
%
%   When SFUNC is called with FLAG = 0, the following information
%   should be returned:
%
%      SYS(1) = Number of continuous states.
%      SYS(2) = Number of discrete states.
%      SYS(3) = Number of outputs.
%      SYS(4) = Number of inputs.
%               Any of the first four elements in SYS can be specified
%               as -1 indicating that they are dynamically sized. The
%               actual length for all other flags will be equal to the
%               length of the input, U.
%      SYS(5) = Reserved for root finding. Must be zero.
%      SYS(6) = Direct feedthrough flag (1=yes, 0=no). The s-function
%               has direct feedthrough if U is used during the FLAG=3
%               call. Setting this to 0 is akin to making a promise that
%               U will not be used during FLAG=3. If you break the promise
%               then unpredictable results will occur.
%      SYS(7) = Number of sample times. This is the number of rows in TS.
%
%
%      X0     = Initial state conditions or [] if no states.
%
%      STR    = State ordering strings which is generally specified as [].
%
%      TS     = An m-by-2 matrix containing the sample time
%               (period, offset) information. Where m = number of sample
%               times. The ordering of the sample times must be:
%
%               TS = [0      0,      : Continuous sample time.
%                     0      1,      : Continuous, but fixed in minor step
%                                      sample time.
%                     PERIOD OFFSET, : Discrete sample time where
%                                      PERIOD > 0 & OFFSET < PERIOD.
%                     -2     0];     : Variable step discrete sample time
%                                      where FLAG=4 is used to get time of
%                                      next hit.
%
%               There can be more than one sample time providing
%               they are ordered such that they are monotonically
%               increasing. Only the needed sample times should be
%               specified in TS. When specifying than one
%               sample time, you must check for sample hits explicitly by
%               seeing if
%                  abs(round((T-OFFSET)/PERIOD) - (T-OFFSET)/PERIOD)
%               is within a specified tolerance, generally 1e-8. This
%               tolerance is dependent upon your model's sampling times
%               and simulation time.
%
%               You can also specify that the sample time of the S-function
%               is inherited from the driving block. For functions which
%               change during minor steps, this is done by
%               specifying SYS(7) = 1 and TS = [-1 0]. For functions which
%               are held during minor steps, this is done by specifying
%               SYS(7) = 1 and TS = [-1 1].

%   Copyright 1990-2002 The MathWorks, Inc.
%   $Revision: 1.18 $

%
% The following outlines the general structure of an S-function.
%
switch flag,

  %%%%%%%%%%%%%%%%%%
  % Initialization %
  %%%%%%%%%%%%%%%%%%
  case 0,
    [sys,x0,str,ts]=mdlInitializeSizes(interleaver_size);

  %%%%%%%%%%%%%%%
  % Derivatives %
  %%%%%%%%%%%%%%%
  %case 1,
    %sys=mdlDerivatives(t,x,u);

  %%%%%%%%%%
  % Update %
  %%%%%%%%%%
  case 2,
    sys=mdlUpdate(t,x,u,interleaver_size);

  %%%%%%%%%%%
  % Outputs %
  %%%%%%%%%%%
  case 3,
    sys=mdlOutputs(t,x,u);

  %%%%%%%%%%%%%%%%%%%%%%%
  % GetTimeOfNextVarHit %
  %%%%%%%%%%%%%%%%%%%%%%%
  case {1,4,9}
   % sys=mdlGetTimeOfNextVarHit(t,x,u);
   sys=[];

  %%%%%%%%%%%%%
  % Terminate %
  %%%%%%%%%%%%%
  %case 9,
    %sys=mdlTerminate(t,x,u);

  %%%%%%%%%%%%%%%%%%%%
  % Unexpected flags %
  %%%%%%%%%%%%%%%%%%%%
  otherwise
    error(['Unhandled flag = ',num2str(flag)]);

end

% end sfuntmpl

%
%=============================================================================
% mdlInitializeSizes
% Return the sizes, initial conditions, and sample times for the S-function.
%=============================================================================
%
function [sys,x0,str,ts]=mdlInitializeSizes(interleaver_size)

%
% call simsizes for a sizes structure, fill it in and convert it to a
% sizes array.
%
% Note that in this example, the values are hard coded.  This is not a
% recommended practice as the characteristics of the block are typically
% defined by the S-function parameters.
%
sizes = simsizes;

sizes.NumContStates  = 0;
sizes.NumDiscStates  = 2;
sizes.NumOutputs     = -1;
sizes.NumInputs      = -1;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;   % at least one sample time is needed

sys = simsizes(sizes);

%
% initialize the initial conditions
%
%設置S函數的初始狀態x0
[m J]=mdlInterleaverInit(interleaver_size);
x0  = [m J]';

%
% str is always an empty matrix
%
str = [];

%
% initialize the array of sample times初始化抽樣時間
%
ts  = [-1 0];

% end mdlInitializeSizes

%
%=============================================================================
% mdlDerivatives
% Return the derivatives for the continuous states.
%=============================================================================
%
%function sys=mdlDerivatives(t,x,u)

%sys = [];

% end mdlDerivatives

%
%=============================================================================
% mdlUpdate
% Handle discrete state updates, sample time hits, and major time step
% requirements.
%=============================================================================
%
function sys=mdlUpdate(t,x,u,interleaver_size)
%計算S函數的離散狀態并且通過sys參數返回給Simulink
[m J]=mdlInterleaverInit(interleaver_size);
sys = [m J]';

% end mdlUpdate

%
%=============================================================================
% mdlOutputs
% Return the block outputs.
%=============================================================================
%
function sys=mdlOutputs(t,x,u)
%計算S函數的輸出信號并且通過sys參數返回給Simulink
m=x(1);
J=x(2);
exp_m=2^m;
A=zeros(exp_m*J,1);
for i=0:length(u)-1
    quotient=fix(i/J);
    BRO=0;
    for k=1:m
        if bitget(quotient,k)==1
            BRO=bitset(BRO,m-k+1);
        end
    end
    A(exp_m*mod(i,J)+BRO+1)=u(i+1);
end
sys=A;

%sys = [];

% end mdlOutputs

%
%=============================================================================
% mdlGetTimeOfNextVarHit
% Return the time of the next hit for this block.  Note that the result is
% absolute time.  Note that this function is only used when you specify a
% variable discrete-time sample time [-2 0] in the sample time array in
% mdlInitializeSizes.
%=============================================================================
%
%function sys=mdlGetTimeOfNextVarHit(t,x,u)

%sampleTime = 1;    %  Example, set the next hit to be one second later.
%sys = t + sampleTime;

% end mdlGetTimeOfNextVarHit

%
%=============================================================================
% mdlTerminate
% Perform any end of simulation tasks.
%=============================================================================
%
%function sys=mdlTerminate(t,x,u)

%sys = [];

% end mdlTerminate
%初始化交織器的長度
function [m,J]=mdlInterleaverInit(interleaver_size)
switch interleaver_size
    case 384
        m=6;
        J=6;
    case 768
        m=6;
        J=12;
    case 1536
        m=6;
        J=24;
    case 3072
        m=6;
        J=48;
    case 6144
        m=7;
        J=48;
    case 12288
        m=7;
        J=96;
    case 576
        m=5;
        J=18;
    case 2304
        m=6;
        J=36;
    case 4608
        m=7;
        J=36;
    case 9216
        m=7;
        J=72;
    case 18432
        m=8;
        J=72;
    case 36864
        m=8;
        J=144;
    otherwise
        error('Error:Invalid Interleaver Size in MS_SFUN_Interleaver');
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区三区四区在线视频 | 久久精品人人爽人人爽| av网站一区二区三区| 日本精品视频一区二区| 日韩成人伦理电影在线观看| 国产精品国产三级国产三级人妇| 欧美丰满美乳xxx高潮www| 成人av集中营| 国产制服丝袜一区| 日韩国产精品久久| 亚洲成人黄色影院| 中文字幕一区二区三中文字幕| ww亚洲ww在线观看国产| 欧美肥妇bbw| 色婷婷久久一区二区三区麻豆| 国产成人免费视频一区| 久久精品二区亚洲w码| 亚洲国产精品影院| 亚洲欧美电影院| 国产精品成人网| 中文字幕二三区不卡| 久久综合资源网| 欧美日韩一区二区在线观看视频| 91视频在线观看免费| www.日韩av| av中文字幕亚洲| 成人精品亚洲人成在线| 国产精品一级片| 国产一区二区精品久久99| 日本欧美加勒比视频| 视频在线观看一区二区三区| 亚洲妇女屁股眼交7| 亚洲综合激情另类小说区| 亚洲欧美福利一区二区| 精品美女被调教视频大全网站| 国产精品人妖ts系列视频| 欧美一级一区二区| 亚洲三级久久久| 欧美日韩激情在线| 在线观看亚洲成人| 色欧美日韩亚洲| 日本韩国欧美在线| 日本高清不卡一区| 91精品福利在线| 在线中文字幕一区二区| 色av综合在线| 欧美日韩国产电影| 欧美一级二级三级蜜桃| 精品欧美黑人一区二区三区| wwww国产精品欧美| 欧美激情一区在线观看| 日韩伦理免费电影| 一区二区三区四区中文字幕| 香蕉久久夜色精品国产使用方法| 性感美女极品91精品| 久久成人麻豆午夜电影| 国产成人精品影视| 色噜噜久久综合| 欧美日韩精品福利| 欧美不卡一区二区三区四区| 亚洲国产成人自拍| 伊人色综合久久天天人手人婷| 亚洲成人免费av| 久久精品国产一区二区三区免费看| 国产乱国产乱300精品| 成人av免费在线观看| 欧美日韩欧美一区二区| 久久综合色综合88| 椎名由奈av一区二区三区| 午夜视频在线观看一区二区 | 欧美精品一区视频| 日本不卡一区二区| 国产原创一区二区| 91麻豆免费观看| 日韩一二三区不卡| 国产精品理论片在线观看| 成人在线视频首页| 91成人在线观看喷潮| 国产精品一区久久久久| 色94色欧美sute亚洲线路一ni| 欧美日韩精品专区| 国产午夜精品久久久久久久| 一区二区三区国产精华| 精品一区二区成人精品| 在线精品国精品国产尤物884a| 欧美xxxx在线观看| 亚洲精品久久嫩草网站秘色| 久久国内精品自在自线400部| 一本色道久久综合狠狠躁的推荐| 欧美一区二区三级| 一区二区久久久久久| 国产精品99久久久久久久女警 | 国产999精品久久| 欧美日韩一区三区| 欧美经典一区二区三区| 青青国产91久久久久久 | 欧美午夜寂寞影院| 国产精品毛片久久久久久久| 蜜臀精品一区二区三区在线观看| 国产成人欧美日韩在线电影| 中日韩免费视频中文字幕| 国产亚洲婷婷免费| 天天亚洲美女在线视频| av一区二区三区| 欧美精品一区二区三区蜜桃| 亚洲123区在线观看| 欧美一区二区三区性视频| 亚洲蜜臀av乱码久久精品| 国产乱码精品一区二区三区忘忧草| 欧美精品日日鲁夜夜添| 一区二区三区在线播放| www.爱久久.com| 久久久久久久综合| 美女网站色91| 欧美老女人第四色| 一区二区三区久久| 一本大道av一区二区在线播放| 国产欧美精品一区| 国产一区二区精品久久99| 欧美一级搡bbbb搡bbbb| 日韩精品成人一区二区三区| 在线观看一区二区视频| 亚洲精品自拍动漫在线| 99热99精品| 综合激情网...| 99久久精品情趣| 1区2区3区精品视频| 成人久久视频在线观看| 国产精品美女久久久久久| 国产99久久久国产精品潘金网站| 久久亚洲私人国产精品va媚药| 麻豆免费看一区二区三区| 欧美一激情一区二区三区| 在线视频你懂得一区二区三区| 欧美丝袜丝交足nylons图片| 26uuu精品一区二区在线观看| 热久久一区二区| 日韩手机在线导航| 久久国产福利国产秒拍| 精品少妇一区二区三区免费观看| 久久国产精品99精品国产| 亚洲一区av在线| 欧美日韩国产成人在线91| 偷拍与自拍一区| 欧美成人aa大片| 国产精品一区二区在线播放 | 9191精品国产综合久久久久久 | 一区2区3区在线看| 欧美精品一二三区| 久久99精品一区二区三区三区| 26uuu精品一区二区三区四区在线| 国产资源在线一区| 中文字幕成人网| 一本色道久久加勒比精品| 亚洲成av人片一区二区| 日韩三级av在线播放| 国产精品主播直播| 最近中文字幕一区二区三区| 欧美性做爰猛烈叫床潮| 奇米精品一区二区三区四区| www久久精品| 91蜜桃免费观看视频| 五月天欧美精品| 久久女同性恋中文字幕| 97久久人人超碰| 日韩国产成人精品| 久久精品夜夜夜夜久久| 91在线一区二区| 免费人成精品欧美精品| 国产精品三级电影| 欧美午夜一区二区三区免费大片| 奇米综合一区二区三区精品视频| 日本一区二区高清| 欧美日韩一区精品| 国产精品 日产精品 欧美精品| 亚洲视频每日更新| 欧美成人在线直播| 91麻豆6部合集magnet| 久久精品国产免费| 亚洲精品视频在线观看网站| 日韩一级免费观看| 一本一道久久a久久精品| 久久国产精品无码网站| 亚洲女人小视频在线观看| 精品久久久久av影院| 91女厕偷拍女厕偷拍高清| 久久99精品久久久久久国产越南 | 亚洲成在线观看| 国产人伦精品一区二区| 欧美日韩综合不卡| 国产91清纯白嫩初高中在线观看 | 欧美一级片在线| 色综合视频一区二区三区高清| 精品一区二区国语对白| 亚洲国产日韩a在线播放性色| 欧美国产精品一区| 精品国产百合女同互慰| 欧美精品日日鲁夜夜添| 91美女视频网站| 国产**成人网毛片九色|