// // Academic License - for use in teaching, academic research, and meeting // course requirements at degree granting institutions only. Not for // government, commercial, or other organizational use. // File: RadarSignalGenerator302.cpp // // MATLAB Coder version : 5.3 // C/C++ source code generated on : 26-Apr-2023 23:59:19 // // Include Files #include "RadarSignalGenerator302.h" #include "LinearFMWaveform302.h" #include "../rt_nonfinite.h" #include "../coder_array.h" #include // Function Definitions // // RADARSIGNALGENERATOR1 此处显示有关此函数的摘要 // 此处显示详细说明 // // Arguments : coder::array &sig // double *fs // double *PRF // double *len // Return Type : void // void RadarSignalGenerator302(coder::array &sig, double *fs, double *PRF, double *len) { static creal_T xt[60000]; static double b_xt[60000]; coder::phased::LinearFMWaveform302 wavGen; double idx; int i; int ii; int loop_ub_tmp; // simTime = 2e-5; wavGen.isInitialized = 0; wavGen.matlabCodegenIsDeleted = false; // 相位编码定义 // 产生5个脉冲 // numPulses = fix(simTime*PRF); *len = 0.0; for (ii = 0; ii < 5; ii++) { *len += 60000.0; } loop_ub_tmp = static_cast(*len); sig.set_size(loop_ub_tmp); for (i = 0; i < loop_ub_tmp; i++) { sig[i] = 0.0; } idx = 1.0; for (ii = 0; ii < 5; ii++) { double kd; int i1; // 迭代波形 wavGen.step(xt); // 载波调制 b_xt[0] = 0.0; b_xt[59999] = 2.99995E-6; for (loop_ub_tmp = 0; loop_ub_tmp < 29998; loop_ub_tmp++) { kd = (static_cast(loop_ub_tmp) + 1.0) * 5.0E-11; b_xt[loop_ub_tmp + 1] = kd; b_xt[59998 - loop_ub_tmp] = 2.99995E-6 - kd; } b_xt[29999] = 1.4999500000000001E-6; b_xt[30000] = 1.4999999999999998E-6; for (loop_ub_tmp = 0; loop_ub_tmp < 60000; loop_ub_tmp++) { double b_re_tmp; double im; double re_tmp; im = b_xt[loop_ub_tmp] * 5.969026041820607E+10; if (im == 0.0) { kd = 1.0; im = 0.0; } else { kd = std::cos(im); im = std::sin(im); } re_tmp = xt[loop_ub_tmp].re; b_re_tmp = xt[loop_ub_tmp].im; xt[loop_ub_tmp].re = re_tmp * kd - b_re_tmp * im; xt[loop_ub_tmp].im = re_tmp * im + b_re_tmp * kd; } if (idx > (idx + 60000.0) - 1.0) { i = -1; i1 = -59999; } else { i = static_cast(idx) - 2; i1 = static_cast(static_cast(idx)); } for (loop_ub_tmp = 0; loop_ub_tmp < 60000; loop_ub_tmp++) { b_xt[loop_ub_tmp] = xt[loop_ub_tmp].re; } loop_ub_tmp = (i1 - i) + 59998; for (i1 = 0; i1 < loop_ub_tmp; i1++) { sig[(i + i1) + 1] = b_xt[i1]; } idx += 60000.0; } wavGen.matlabCodegenDestructor(); *fs = 2.0E+10; *PRF = 333333.33333333331; } // // File trailer for RadarSignalGenerator302.cpp // // [EOF] //