123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- //
- // 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: RadarSignalGenerator403.cpp
- //
- // MATLAB Coder version : 5.3
- // C/C++ source code generated on : 27-Apr-2023 00:13:52
- //
- // Include Files
- #include "RadarSignalGenerator403.h"
- #include "FMCWWaveform403.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 RadarSignalGenerator403(coder::array<double, 1U> &sig, double *fs,
- double *PRF, double *len)
- {
- static coder::phased::FMCWWaveform403 wavGen;
- static creal_T xt[40000];
- static double b_xt[40000];
- double idx;
- int i;
- int ii;
- int loop_ub_tmp;
- // simTime = 2e-5;
- wavGen.isInitialized = 0;
- // 产生5个脉冲
- // numPulses = fix(simTime*PRF);
- *len = 0.0;
- for (ii = 0; ii < 5; ii++) {
- *len += 40000.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[39999] = 1.99995E-6;
- for (loop_ub_tmp = 0; loop_ub_tmp < 19998; loop_ub_tmp++) {
- kd = (static_cast<double>(loop_ub_tmp) + 1.0) * 5.0E-11;
- b_xt[loop_ub_tmp + 1] = kd;
- b_xt[39998 - loop_ub_tmp] = 1.99995E-6 - kd;
- }
- b_xt[19999] = 9.9995E-7;
- b_xt[20000] = 9.9999999999999974E-7;
- for (loop_ub_tmp = 0; loop_ub_tmp < 40000; 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 + 40000.0) - 1.0) {
- i = -1;
- i1 = -39999;
- } else {
- i = static_cast<int>(idx) - 2;
- i1 = static_cast<int>(static_cast<unsigned int>(idx));
- }
- for (loop_ub_tmp = 0; loop_ub_tmp < 40000; loop_ub_tmp++) {
- b_xt[loop_ub_tmp] = xt[loop_ub_tmp].re;
- }
- loop_ub_tmp = (i1 - i) + 39998;
- for (i1 = 0; i1 < loop_ub_tmp; i1++) {
- sig[(i + i1) + 1] = b_xt[i1];
- }
- idx += 40000.0;
- }
- *fs = 2.0E+10;
- *PRF = 500000.0;
- }
- //
- // File trailer for RadarSignalGenerator403.cpp
- //
- // [EOF]
- //
|