123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- //
- // 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: PhaseCodedWaveform.cpp
- //
- // MATLAB Coder version : 5.3
- // C/C++ source code generated on : 26-Apr-2023 23:50:19
- //
- // Include Files
- #include "PhaseCodedWaveform202.h"
- #include "../rt_nonfinite.h"
- #include <algorithm>
- #include <cmath>
- #include <cstring>
- // Function Definitions
- //
- // Arguments : creal_T s[20000]
- // Return Type : void
- //
- namespace coder {
- namespace phased {
- void PhaseCodedWaveform202::getMatchingWaveform(creal_T s[20000])
- {
- int ibtile;
- int k;
- signed char b_s[20000];
- signed char c_s[20000];
- for (k = 0; k < 5000; k++) {
- ibtile = k << 2;
- b_s[ibtile] = 1;
- b_s[ibtile + 1] = 1;
- b_s[ibtile + 2] = -1;
- b_s[ibtile + 3] = 1;
- }
- for (k = 0; k < 20000; k++) {
- s[k].re = 1.0;
- s[k].im = 0.0;
- }
- for (k = 0; k < 4; k++) {
- for (ibtile = 0; ibtile < 5000; ibtile++) {
- c_s[ibtile + 5000 * k] = b_s[k + (ibtile << 2)];
- }
- }
- for (k = 0; k < 20000; k++) {
- ibtile = c_s[k];
- s[k].re *= static_cast<double>(ibtile);
- s[k].im *= static_cast<double>(ibtile);
- }
- }
- //
- // Arguments : void
- // Return Type : PhaseCodedWaveform
- //
- PhaseCodedWaveform202::PhaseCodedWaveform202()
- {
- matlabCodegenIsDeleted = true;
- }
- //
- // Arguments : void
- // Return Type : void
- //
- PhaseCodedWaveform202::~PhaseCodedWaveform202()
- {
- matlabCodegenDestructor();
- }
- //
- // Arguments : void
- // Return Type : void
- //
- void PhaseCodedWaveform202::matlabCodegenDestructor()
- {
- if (!matlabCodegenIsDeleted) {
- matlabCodegenIsDeleted = true;
- if (isInitialized == 1) {
- isInitialized = 2;
- }
- }
- }
- //
- // Arguments : creal_T varargout_1[60000]
- // Return Type : void
- //
- void PhaseCodedWaveform202::step(creal_T varargout_1[60000])
- {
- static creal_T unusedExpr[20000];
- double d;
- double r;
- if (isInitialized != 1) {
- isSetupComplete = false;
- isInitialized = 1;
- isSetupComplete = true;
- TunablePropsChanged = false;
- pOutputStartPulseIndex = 1.0;
- pOutputPulseInterval[0] = 0.0;
- pOutputPulseInterval[1] = 1.0;
- }
- if (TunablePropsChanged) {
- TunablePropsChanged = false;
- }
- d = (pOutputStartPulseIndex + pOutputPulseInterval[1]) - 1.0;
- if (std::isnan(d) || std::isinf(d)) {
- r = rtNaN;
- } else if (d == 0.0) {
- r = 0.0;
- } else {
- r = std::fmod(d, 1.0);
- if (r == 0.0) {
- r = 0.0;
- } else if (d < 0.0) {
- r++;
- }
- }
- pOutputStartPulseIndex = r + 1.0;
- std::memset(&varargout_1[0], 0, 60000U * sizeof(creal_T));
- PhaseCodedWaveform202::getMatchingWaveform(unusedExpr);
- std::copy(&unusedExpr[0], &unusedExpr[20000], &varargout_1[0]);
- PhaseCodedWaveform202::getMatchingWaveform(unusedExpr);
- }
- } // namespace phased
- } // namespace coder
- //
- // File trailer for PhaseCodedWaveform.cpp
- //
- // [EOF]
- //
|