📄 de_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 "de_qpsk.h"
#include "libmatlbm.h"
static mxArray * _mxarray0_;
static mxArray * _mxarray1_;
static mxArray * _mxarray2_;
void InitializeModule_de_qpsk(void) {
_mxarray0_ = mclInitializeDouble(1.0);
_mxarray1_ = mclInitializeDouble(2.0);
_mxarray2_ = mclInitializeDouble(0.0);
}
void TerminateModule_de_qpsk(void) {
mxDestroyArray(_mxarray2_);
mxDestroyArray(_mxarray1_);
mxDestroyArray(_mxarray0_);
}
static mxArray * Mde_qpsk(int nargout_, mxArray * input);
_mexLocalFunctionTable _local_function_table_de_qpsk
= { 0, (mexFunctionTableEntry *)NULL };
/*
* The function "mlfDe_qpsk" contains the normal interface for the "de_qpsk"
* M-function from file "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\de_qpsk.m"
* (lines 1-14). This function processes any input arguments and passes them to
* the implementation version of the function, appearing above.
*/
mxArray * mlfDe_qpsk(mxArray * input) {
int nargout = 1;
mxArray * output = NULL;
mlfEnterNewContext(0, 1, input);
output = Mde_qpsk(nargout, input);
mlfRestorePreviousContext(0, 1, input);
return mlfReturnValue(output);
}
/*
* The function "mlxDe_qpsk" contains the feval interface for the "de_qpsk"
* M-function from file "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\de_qpsk.m"
* (lines 1-14). The feval function calls the implementation version of de_qpsk
* through this function. This function processes any input arguments and
* passes them to the implementation version of the function, appearing above.
*/
void mlxDe_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: de_qpsk Line: 1 Column: "
"1 The function \"de_qpsk\" was called with mor"
"e than the declared number of outputs (1)."),
NULL);
}
if (nrhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: de_qpsk Line: 1 Column:"
" 1 The function \"de_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] = Mde_qpsk(nlhs, mprhs[0]);
mlfRestorePreviousContext(0, 1, mprhs[0]);
plhs[0] = mplhs[0];
}
/*
* The function "Mde_qpsk" is the implementation version of the "de_qpsk"
* M-function from file "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\de_qpsk.m"
* (lines 1-14). 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=de_qpsk(input)
*/
static mxArray * Mde_qpsk(int nargout_, mxArray * input) {
mexLocalFunctionTable save_local_function_table_
= mclSetCurrentLocalFunctionTable(&_local_function_table_de_qpsk);
mxArray * output = NULL;
mclCopyArray(&input);
/*
* output=zeros(1,2);
*/
mlfAssign(&output, mlfZeros(_mxarray0_, _mxarray1_, NULL));
/*
* if real(input)>=0
*/
if (mclGeBool(mlfReal(mclVa(input, "input")), _mxarray2_)) {
/*
* output(2)=1;
*/
mclIntArrayAssign1(&output, _mxarray0_, 2);
/*
* else
*/
} else {
/*
* output(2)=0;
*/
mclIntArrayAssign1(&output, _mxarray2_, 2);
/*
* end
*/
}
/*
* if imag(input)>=0
*/
if (mclGeBool(mlfImag(mclVa(input, "input")), _mxarray2_)) {
/*
* output(1)=0;
*/
mclIntArrayAssign1(&output, _mxarray2_, 1);
/*
* else
*/
} else {
/*
* output(1)=1;
*/
mclIntArrayAssign1(&output, _mxarray0_, 1);
/*
* end
*/
}
mclValidateOutput(output, 1, nargout_, "output", "de_qpsk");
mxDestroyArray(input);
mclSetCurrentLocalFunctionTable(save_local_function_table_);
return output;
/*
*
*
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -