📄 s_pulse_shaping.c
字号:
/* | Project: WCDMA simulation environment | Module: Pulse shaping filter | THIS HAS NOT BEEN IMPLEMENTED YET. | THIS MODULE IS ONLY AN EMPTY INTERFACE | | Author: | Date: June, 1999 | | History: | June 23, 1999 Maarit Melvasalo | * * File : s_pulse_shaping.c * Abstract: * * USER GIVEN PARAMETERS * * 1: SIZE_P = Size of real input vector (= packet size) * 2: ROLL = roll of factor for pulse shaping * 3: SLOTS = Number of slot in a frame * * Inputs: * Modulated and spread chips * * Outputs: * Shaped * | | Copyright disclaimer: | This software was developed at the National Institute of Standards | and Technology by employees of the Federal Government in the course | of their official duties. Pursuant to title 17 Section 105 of the | United States Code this software is not subject to copyright | protection and is in the public domain. | | We would appreciate acknowledgement if the software is used. | */#define S_FUNCTION_NAME s_pulse_shaping#define S_FUNCTION_LEVEL 2#include <math.h>#include "simstruc.h"#include "tmwtypes.h"#include "config_wcdma.h"#include "wcdma_simulink.h"/* USER GIVEN PARAMETERS AND DEFINITIONS /**//*Number of inputs and outputs/**/#define NINPUTS 1#define NOUTPUTS 1/* Number of user given parameters/**/ #define NPARAMS 3 /* Input and Output Size parameters /**/#define SIZE_P(S) ssGetSFcnParam(S,0) #define nIn (int_T)(mxGetPr(SIZE_P(S))[0]) /* Roll of factor for /**/#define ROLL(S) ssGetSFcnParam(S,1) #define SLOTS(S) ssGetSFcnParam(S,2)#define nSlots mxGetPr(SLOTS(S))[0] /* Pointers to Input Ports */#define U(element) (*uPtrs[element]) /* Sampletime -- defined in config_cdma /**/#define td TD_FRAME / (real_T)nSlots /*====================* */static void mdlInitializeSizes(SimStruct *S){ ssSetNumSFcnParams(S, NPARAMS); /* Number of expected parameters */ if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { return; } if (!ssSetNumInputPorts(S, NINPUTS)) return; ssSetInputPortWidth(S, 0, nIn); ssSetInputPortDirectFeedThrough(S, 0, 1); if (!ssSetNumOutputPorts(S, NOUTPUTS)) return; ssSetOutputPortWidth(S, 0, nIn); ssSetNumSampleTimes(S, 1); ssSetSFcnParamNotTunable(S,0); ssSetSFcnParamNotTunable(S,1); ssSetSFcnParamNotTunable(S,2); /* Take care when specifying exception free code - see sfuntmpl.doc */ ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE);} /* ei saa kayttaa mxCalloc tai mexErrMsgTxt tms rutiineita *//* Function: mdlInitializeSampleTimes ========================================= */static void mdlInitializeSampleTimes(SimStruct *S){ ssSetSampleTime(S, 0, td); ssSetOffsetTime(S, 0, 0.0);}/* Function: mdlOutputs ======================================================= */static void mdlOutputs(SimStruct *S, int_T tid){ real_T *y = ssGetOutputPortRealSignal(S,0); InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0); real_T roll = mxGetPr(ROLL(S))[0]; int_T i,tmp; for (i = 0; i < nIn; i++) y[i] = U(i); /**/}/* Function: mdlTerminate ===================================================== */static void mdlTerminate(SimStruct *S){}#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */#include "simulink.c" /* MEX-file interface mechanism */#else#include "cg_sfun.h" /* Code generation registration function */#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -