📄 map_qpsk.c
字号:
/*
* MATLAB Compiler: 3.0
* Date: Fri Mar 24 11:31:37 2006
* Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
* "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
* "array_indexing:on" "-O" "optimize_conditionals:on" "-m" "-W" "main" "-L"
* "C" "-t" "-T" "link:exe" "-h" "libmmfile.mlib"
* "adptive_bitpow_allocate_systems"
*/
#include "map_qpsk.h"
#include "libmatlbm.h"
static double _array1_[2] = { 0.0, 0.0 };
static mxArray * _mxarray0_;
static mxArray * _mxarray2_;
static double _array4_[2] = { 0.0, 1.0 };
static mxArray * _mxarray3_;
static mxArray * _mxarray5_;
static double _array7_[2] = { 1.0, 1.0 };
static mxArray * _mxarray6_;
static mxArray * _mxarray8_;
static mxArray * _mxarray9_;
void InitializeModule_map_qpsk(void) {
_mxarray0_ = mclInitializeDoubleVector(1, 2, _array1_);
_mxarray2_ = mclInitializeComplex(0.0, 2.356194490192345);
_mxarray3_ = mclInitializeDoubleVector(1, 2, _array4_);
_mxarray5_ = mclInitializeComplex(0.0, .7853981633974483);
_mxarray6_ = mclInitializeDoubleVector(1, 2, _array7_);
_mxarray8_ = mclInitializeComplex(0.0, -.7853981633974483);
_mxarray9_ = mclInitializeComplex(0.0, 3.9269908169872414);
}
void TerminateModule_map_qpsk(void) {
mxDestroyArray(_mxarray9_);
mxDestroyArray(_mxarray8_);
mxDestroyArray(_mxarray6_);
mxDestroyArray(_mxarray5_);
mxDestroyArray(_mxarray3_);
mxDestroyArray(_mxarray2_);
mxDestroyArray(_mxarray0_);
}
static mxArray * Mmap_qpsk(int nargout_, mxArray * input);
_mexLocalFunctionTable _local_function_table_map_qpsk
= { 0, (mexFunctionTableEntry *)NULL };
/*
* The function "mlfMap_qpsk" contains the normal interface for the "map_qpsk"
* M-function from file
* "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\map_qpsk.m" (lines 1-12). This
* function processes any input arguments and passes them to the implementation
* version of the function, appearing above.
*/
mxArray * mlfMap_qpsk(mxArray * input) {
int nargout = 1;
mxArray * output = NULL;
mlfEnterNewContext(0, 1, input);
output = Mmap_qpsk(nargout, input);
mlfRestorePreviousContext(0, 1, input);
return mlfReturnValue(output);
}
/*
* The function "mlxMap_qpsk" contains the feval interface for the "map_qpsk"
* M-function from file
* "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\map_qpsk.m" (lines 1-12). The
* feval function calls the implementation version of map_qpsk through this
* function. This function processes any input arguments and passes them to the
* implementation version of the function, appearing above.
*/
void mlxMap_qpsk(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
mxArray * mprhs[1];
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: map_qpsk Line: 1 Column:"
" 1 The function \"map_qpsk\" was called with m"
"ore than the declared number of outputs (1)."),
NULL);
}
if (nrhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: map_qpsk Line: 1 Column:"
" 1 The function \"map_qpsk\" was called with m"
"ore than the declared number of inputs (1)."),
NULL);
}
for (i = 0; i < 1; ++i) {
mplhs[i] = NULL;
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 1; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 1, mprhs[0]);
mplhs[0] = Mmap_qpsk(nlhs, mprhs[0]);
mlfRestorePreviousContext(0, 1, mprhs[0]);
plhs[0] = mplhs[0];
}
/*
* The function "Mmap_qpsk" is the implementation version of the "map_qpsk"
* M-function from file
* "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\map_qpsk.m" (lines 1-12). It
* contains the actual compiled code for that M-function. It is a static
* function and must only be called from one of the interface functions,
* appearing below.
*/
/*
* function output=map_qpsk(input)
*/
static mxArray * Mmap_qpsk(int nargout_, mxArray * input) {
mexLocalFunctionTable save_local_function_table_
= mclSetCurrentLocalFunctionTable(&_local_function_table_map_qpsk);
mxArray * output = NULL;
mclCopyArray(&input);
/*
* if input==[0 0]
*/
if (mclEqBool(mclVa(input, "input"), _mxarray0_)) {
/*
* output=exp(j*3/4*pi);
*/
mlfAssign(&output, mlfExp(_mxarray2_));
/*
* elseif input==[0 1]
*/
} else if (mclEqBool(mclVa(input, "input"), _mxarray3_)) {
/*
* output=exp(j*1/4*pi);
*/
mlfAssign(&output, mlfExp(_mxarray5_));
/*
* elseif input==[1 1]
*/
} else if (mclEqBool(mclVa(input, "input"), _mxarray6_)) {
/*
* output=exp(-j*1/4*pi);
*/
mlfAssign(&output, mlfExp(_mxarray8_));
/*
* else
*/
} else {
/*
* output=exp(j*5/4*pi);
*/
mlfAssign(&output, mlfExp(_mxarray9_));
/*
* end
*/
}
mclValidateOutput(output, 1, nargout_, "output", "map_qpsk");
mxDestroyArray(input);
mclSetCurrentLocalFunctionTable(save_local_function_table_);
return output;
/*
*
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -