123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- //
- // 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: RadarSignalGenerator202.cpp
- //
- // MATLAB Coder version : 5.3
- // C/C++ source code generated on : 26-Apr-2023 23:50:19
- //
- // Include Files
- #include "RadarSignalGenerator202.h"
- #include "PhaseCodedWaveform202.h"
- #include "../rt_nonfinite.h"
- #include "../coder_array.h"
- #include <cmath>
- // Function Definitions
- //
- // RADARSIGNALGENERATOR1 此处显示有关此函数的摘要
- // 此处显示详细说明
- //
- // Arguments : coder::array<double, 1U> &sig
- // double *fs
- // double *PRF
- // double *len
- // Return Type : void
- //
- void RadarSignalGenerator202(coder::array<double, 1U> &sig, double *fs,
- double *PRF, double *len)
- {
- static creal_T xt[60000];
- static double b_xt[60000];
- coder::phased::PhaseCodedWaveform202 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<int>(*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<double>(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<int>(idx) - 2;
- i1 = static_cast<int>(static_cast<unsigned int>(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 RadarSignalGenerator202.cpp
- //
- // [EOF]
- //
|