📄 c1_multitones_forhop_hard.c
字号:
/* Include files */
#include "multitones_forhop_hard_sfun.h"
#include "c1_multitones_forhop_hard.h"
#define CHARTINSTANCE_CHARTNUMBER (chartInstance.chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER (chartInstance.instanceNumber)
#include "multitones_forhop_hard_sfun_debug_macros.h"
/* Type Definitions */
/* Named Constants */
#define c1_IN_NO_ACTIVE_CHILD (0)
/* Variable Declarations */
/* Variable Definitions */
static SFc1_multitones_forhop_hardInstanceStruct chartInstance;
/* Function Declarations */
static void initialize_c1_multitones_forhop_hard(void);
static void initialize_params_c1_multitones_forhop_hard(void);
static void enable_c1_multitones_forhop_hard(void);
static void disable_c1_multitones_forhop_hard(void);
static void finalize_c1_multitones_forhop_hard(void);
static void sf_c1_multitones_forhop_hard(void);
static void c1_eML_blk_kernel(real_T *c1_b_u, real_T *c1_b_a, real_T *c1_b_y);
static const mxArray *c1_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_b_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_c_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_d_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_e_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_f_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_g_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_h_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_i_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_j_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_k_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_l_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_m_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_n_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_o_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_p_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_q_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_r_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_s_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_t_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_u_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static const mxArray *c1_v_sf_marshall(void *c1_chartInstance, void *c1_b_u);
static real_T *c1_u(void);
static real_T *c1_y(void);
static real_T *c1_a(void);
static void init_dsm_address_info(void);
/* Function Definitions */
static void initialize_c1_multitones_forhop_hard(void)
{
_sfTime_ = (real_T)ssGetT(chartInstance.S);
chartInstance.c1_is_active_c1_multitones_forhop_hard = 0U;
}
static void initialize_params_c1_multitones_forhop_hard(void)
{
}
static void enable_c1_multitones_forhop_hard(void)
{
}
static void disable_c1_multitones_forhop_hard(void)
{
}
static void finalize_c1_multitones_forhop_hard(void)
{
}
static void sf_c1_multitones_forhop_hard(void)
{
int32_T c1_i0;
int32_T c1_i1;
int32_T c1_i2;
uint8_T c1_previousEvent;
int32_T c1_i3;
real_T c1_dv0[1025];
int32_T c1_i4;
real_T c1_dv1[32];
real_T c1_dv2[34];
int32_T c1_i5;
_sfTime_ = (real_T)ssGetT(chartInstance.S);
for(c1_i0 = 0; c1_i0 < 1025; c1_i0 = c1_i0 + 1) {
_SFD_DATA_RANGE_CHECK(c1_u()[c1_i0], 2U);
}
for(c1_i1 = 0; c1_i1 < 34; c1_i1 = c1_i1 + 1) {
_SFD_DATA_RANGE_CHECK(c1_y()[c1_i1], 1U);
}
for(c1_i2 = 0; c1_i2 < 32; c1_i2 = c1_i2 + 1) {
_SFD_DATA_RANGE_CHECK(c1_a()[c1_i2], 0U);
}
c1_previousEvent = _sfEvent_;
_sfEvent_ = CALL_EVENT;
_SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,0);
for(c1_i3 = 0; c1_i3 < 1025; c1_i3 = c1_i3 + 1) {
c1_dv0[c1_i3] = c1_u()[c1_i3];
}
for(c1_i4 = 0; c1_i4 < 32; c1_i4 = c1_i4 + 1) {
c1_dv1[c1_i4] = c1_a()[c1_i4];
}
c1_eML_blk_kernel((real_T *)c1_dv0, (real_T *)c1_dv1, (real_T *)c1_dv2);
for(c1_i5 = 0; c1_i5 < 34; c1_i5 = c1_i5 + 1) {
c1_y()[c1_i5] = c1_dv2[c1_i5];
}
_SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
_sfEvent_ = c1_previousEvent;
sf_debug_check_for_state_inconsistency(_multitones_forhop_hardMachineNumber_,
chartInstance.chartNumber, chartInstance.
instanceNumber);
}
static void c1_eML_blk_kernel(real_T *c1_b_u, real_T *c1_b_a, real_T *c1_b_y)
{
real_T c1_Delt;
real_T c1_Mean;
real_T c1_MaxAmpSum;
real_T c1_MaxAmpNum[100];
real_T c1_MaxAmp[100];
real_T c1_Delt_part;
real_T c1_counter3;
real_T c1_counter2;
real_T c1_counter1;
real_T c1_counter0;
real_T c1_Input_tem[1025];
real_T c1_ForwardIno4;
real_T c1_ForwardIno2;
real_T c1_Matrix_DeltMean;
real_T c1_Matrix_DeltSum;
real_T c1_flag;
real_T c1_i;
real_T c1_Matrix_Delt[32];
real_T c1_fhnum;
real_T c1_dv3[32];
int32_T c1_i6;
real_T c1_A;
real_T c1_x;
int32_T c1_i7;
int32_T c1_i8;
int32_T c1_i9;
real_T c1_b_A;
real_T c1_b_x;
real_T c1_c_A;
real_T c1_c_x;
real_T c1_dv4[34];
int32_T c1_i10;
sf_debug_symbol_scope_push(22U, 0U);
sf_debug_symbol_scope_add("Delt", &c1_Delt, c1_v_sf_marshall);
sf_debug_symbol_scope_add("Mean", &c1_Mean, c1_u_sf_marshall);
sf_debug_symbol_scope_add("MaxAmpSum", &c1_MaxAmpSum, c1_t_sf_marshall);
sf_debug_symbol_scope_add("MaxAmpNum", &c1_MaxAmpNum, c1_s_sf_marshall);
sf_debug_symbol_scope_add("MaxAmp", &c1_MaxAmp, c1_r_sf_marshall);
sf_debug_symbol_scope_add("Delt_part", &c1_Delt_part, c1_q_sf_marshall);
sf_debug_symbol_scope_add("counter3", &c1_counter3, c1_p_sf_marshall);
sf_debug_symbol_scope_add("counter2", &c1_counter2, c1_o_sf_marshall);
sf_debug_symbol_scope_add("counter1", &c1_counter1, c1_n_sf_marshall);
sf_debug_symbol_scope_add("counter0", &c1_counter0, c1_m_sf_marshall);
sf_debug_symbol_scope_add("Input_tem", &c1_Input_tem, c1_l_sf_marshall);
sf_debug_symbol_scope_add("ForwardIno4", &c1_ForwardIno4, c1_k_sf_marshall);
sf_debug_symbol_scope_add("ForwardIno2", &c1_ForwardIno2, c1_j_sf_marshall);
sf_debug_symbol_scope_add("Matrix_DeltMean", &c1_Matrix_DeltMean,
c1_i_sf_marshall);
sf_debug_symbol_scope_add("Matrix_DeltSum", &c1_Matrix_DeltSum,
c1_h_sf_marshall);
sf_debug_symbol_scope_add("flag", &c1_flag, c1_g_sf_marshall);
sf_debug_symbol_scope_add("i", &c1_i, c1_f_sf_marshall);
sf_debug_symbol_scope_add("Matrix_Delt", &c1_Matrix_Delt, c1_e_sf_marshall);
sf_debug_symbol_scope_add("fhnum", &c1_fhnum, c1_d_sf_marshall);
sf_debug_symbol_scope_add("y", c1_b_y, c1_c_sf_marshall);
sf_debug_symbol_scope_add("a", c1_b_a, c1_b_sf_marshall);
sf_debug_symbol_scope_add("u", c1_b_u, c1_sf_marshall);
CV_EML_FCN(0, 0);
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,2);
c1_fhnum = c1_b_u[1024];
/* frequency hopping numbers */
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,3);
c1_dv3[0] = c1_b_a[0];
c1_dv3[1] = c1_b_a[1];
c1_dv3[2] = c1_b_a[2];
c1_dv3[3] = c1_b_a[3];
c1_dv3[4] = c1_b_a[4];
c1_dv3[5] = c1_b_a[5];
c1_dv3[6] = c1_b_a[6];
c1_dv3[7] = c1_b_a[7];
c1_dv3[8] = c1_b_a[8];
c1_dv3[9] = c1_b_a[9];
c1_dv3[10] = c1_b_a[10];
c1_dv3[11] = c1_b_a[11];
c1_dv3[12] = c1_b_a[12];
c1_dv3[13] = c1_b_a[13];
c1_dv3[14] = c1_b_a[14];
c1_dv3[15] = c1_b_a[15];
c1_dv3[16] = c1_b_a[16];
c1_dv3[17] = c1_b_a[17];
c1_dv3[18] = c1_b_a[18];
c1_dv3[19] = c1_b_a[19];
c1_dv3[20] = c1_b_a[20];
c1_dv3[21] = c1_b_a[21];
c1_dv3[22] = c1_b_a[22];
c1_dv3[23] = c1_b_a[23];
c1_dv3[24] = c1_b_a[24];
c1_dv3[25] = c1_b_a[25];
c1_dv3[26] = c1_b_a[26];
c1_dv3[27] = c1_b_a[27];
c1_dv3[28] = c1_b_a[28];
c1_dv3[29] = c1_b_a[29];
c1_dv3[30] = c1_b_a[30];
c1_dv3[31] = c1_b_a[31];
for(c1_i6 = 0; c1_i6 < 32; c1_i6 = c1_i6 + 1) {
c1_Matrix_Delt[c1_i6] = c1_dv3[c1_i6];
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,4);
c1_i = 1.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,5);
c1_flag = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,6);
c1_Matrix_DeltSum = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,7);
c1_Matrix_DeltMean = 0.0;
while(CV_EML_WHILE(0, 0, c1_i < 33.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,9);
if(CV_EML_IF(0, 0,
c1_Matrix_Delt[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Matrix_Delt",
(int32_T)_SFD_INTEGER_CHECK("i", c1_i), 1, 32
, 1) - 1] == 0.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,10);
c1_flag = c1_flag + 1.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,12);
c1_Matrix_DeltSum = c1_Matrix_DeltSum +
c1_Matrix_Delt[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Matrix_Delt",
(int32_T)
_SFD_INTEGER_CHECK("i", c1_i), 1, 32, 1) - 1];
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,13);
c1_i = c1_i + 1.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,15);
c1_A = c1_Matrix_DeltSum;
c1_x = c1_A;
c1_Matrix_DeltMean = c1_x / 32.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,17);
c1_ForwardIno2 = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,18);
c1_ForwardIno4 = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,19);
for(c1_i7 = 0; c1_i7 < 1025; c1_i7 = c1_i7 + 1) {
c1_Input_tem[c1_i7] = c1_b_u[c1_i7];
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,20);
c1_counter0 = 1.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,21);
c1_counter1 = 1.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,22);
c1_counter2 = 1.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,23);
c1_counter3 = 1.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,24);
c1_Delt_part = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,25);
for(c1_i8 = 0; c1_i8 < 100; c1_i8 = c1_i8 + 1) {
c1_MaxAmp[c1_i8] = 0.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,26);
for(c1_i9 = 0; c1_i9 < 100; c1_i9 = c1_i9 + 1) {
c1_MaxAmpNum[c1_i9] = 0.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,27);
c1_MaxAmpSum = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,28);
c1_Mean = 0.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,29);
c1_Delt = 0.0;
while(CV_EML_WHILE(0, 1, c1_counter0 < 101.0)) {
while(CV_EML_WHILE(0, 2, c1_counter1 < 1025.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,32);
if(CV_EML_IF(0, 1,
c1_Input_tem[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Input_tem",
(int32_T)_SFD_INTEGER_CHECK("counter1",
c1_counter1), 1, 1025, 1) - 1] >
c1_MaxAmp[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmp",
(int32_T)_SFD_INTEGER_CHECK("counter0",
c1_counter0), 1, 100, 1) - 1])) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,33);
c1_MaxAmp[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmp",
(int32_T)_SFD_INTEGER_CHECK("counter0", c1_counter0), 1, 100, 1) - 1] =
c1_Input_tem[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Input_tem",
(int32_T)_SFD_INTEGER_CHECK("counter1", c1_counter1), 1, 1025, 1) - 1
];
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,34);
c1_MaxAmpNum[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmpNum",
(int32_T)_SFD_INTEGER_CHECK("counter0", c1_counter0), 1, 100, 1) - 1]
= c1_counter1;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,36);
c1_counter1 = c1_counter1 + 1.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,38);
if(CV_EML_IF(0, 2,
c1_MaxAmpNum[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmpNum",
(int32_T)_SFD_INTEGER_CHECK("counter0",
c1_counter0), 1, 100, 1) - 1] != 0.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,39);
c1_Input_tem[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Input_tem",
(int32_T)_SFD_INTEGER_CHECK("", c1_MaxAmpNum[(int32_T)
_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmpNum",
(int32_T)_SFD_INTEGER_CHECK("counter0", c1_counter0), 1, 100, 1) - 1]),
1, 1025, 1) - 1] =
0.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,41);
c1_MaxAmpSum = c1_MaxAmpSum +
c1_MaxAmp[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmp",
(int32_T)_SFD_INTEGER_CHECK("counter0",
c1_counter0), 1, 100, 1) - 1];
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,42);
c1_counter1 = 1.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,43);
c1_counter0 = c1_counter0 + 1.0;
}
while(CV_EML_WHILE(0, 3, c1_counter1 < 1025.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,47);
c1_Mean = c1_Mean + c1_b_u[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("u",
(int32_T)_SFD_INTEGER_CHECK("counter1", c1_counter1), 1, 1025,
1) - 1];
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,48);
c1_counter1 = c1_counter1 + 1.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,50);
c1_b_A = c1_Mean - c1_MaxAmpSum;
c1_b_x = c1_b_A;
c1_Mean = c1_b_x / 924.0;
while(CV_EML_WHILE(0, 4, c1_counter2 < 1025.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,52);
c1_Delt = c1_Delt + (c1_b_u[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("u",
(int32_T)_SFD_INTEGER_CHECK("counter2", c1_counter2), 1, 1025
, 1) - 1] - c1_Mean) * (c1_b_u[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("u",
(int32_T)_SFD_INTEGER_CHECK("counter2", c1_counter2), 1,
1025, 1) - 1] - c1_Mean);
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,53);
c1_counter2 = c1_counter2 + 1.0;
}
while(CV_EML_WHILE(0, 5, c1_counter3 < 101.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,56);
if(CV_EML_IF(0, 3,
c1_MaxAmpNum[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmpNum",
(int32_T)_SFD_INTEGER_CHECK("counter3",
c1_counter3), 1, 100, 1) - 1] != 0.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,57);
c1_Delt_part = c1_Delt_part +
(c1_b_u[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("u",
(int32_T)_SFD_INTEGER_CHECK("", c1_MaxAmpNum[(
int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmpNum",
(int32_T)_SFD_INTEGER_CHECK("counter3", c1_counter3), 1, 100, 1) -
1]), 1, 1025, 1)
- 1] - c1_Mean) * (c1_b_u[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("u",
(int32_T)_SFD_INTEGER_CHECK("", c1_MaxAmpNum[(int32_T)
_SFD_EML_ARRAY_BOUNDS_CHECK("MaxAmpNum",
(int32_T)_SFD_INTEGER_CHECK("counter3", c1_counter3), 1, 100, 1) -
1]), 1, 1025, 1) - 1] -
c1_Mean);
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,59);
c1_counter3 = c1_counter3 + 1.0;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,61);
c1_c_A = 0.1 * (c1_Delt - c1_Delt_part);
c1_c_x = c1_c_A;
c1_Delt = c1_c_x / 924.0;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,62);
if(CV_EML_IF(0, 4,
c1_Matrix_Delt[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Matrix_Delt",
(int32_T)_SFD_INTEGER_CHECK("", c1_fhnum + 1.0
), 1, 32, 1) - 1] != 0.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,63);
c1_Delt = (c1_Delt +
c1_Matrix_Delt[(int32_T)_SFD_EML_ARRAY_BOUNDS_CHECK("Matrix_Delt",
(int32_T)_SFD_INTEGER_CHECK("", c1_fhnum +
1.0), 1, 32, 1) - 1]) * 0.5;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,65);
if(CV_EML_IF(0, 5, c1_flag == 0.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,66);
if(CV_EML_IF(0, 6, c1_Delt > c1_Matrix_DeltMean)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,67);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -