AbstractPhaseCodedWaveform201.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // Academic License - for use in teaching, academic research, and meeting
  3. // course requirements at degree granting institutions only. Not for
  4. // government, commercial, or other organizational use.
  5. // File: AbstractPhaseCodedWaveform.cpp
  6. //
  7. // MATLAB Coder version : 5.3
  8. // C/C++ source code generated on : 26-Apr-2023 23:47:33
  9. //
  10. // Include Files
  11. #include "AbstractPhaseCodedWaveform201.h"
  12. #include "../rt_nonfinite.h"
  13. #include "../coder_array.h"
  14. #include <math.h>
  15. // Function Definitions
  16. //
  17. // Arguments : creal_T s[20000]
  18. // Return Type : void
  19. //
  20. namespace coder {
  21. namespace phased {
  22. void AbstractPhaseCodedWaveform201::getMatchingWaveform(creal_T s[20000])
  23. {
  24. array<creal_T, 1U> x;
  25. int exponent;
  26. int ibtile;
  27. int jtilecol;
  28. signed char b_s[20000];
  29. signed char c_s[20000];
  30. for (jtilecol = 0; jtilecol < 5000; jtilecol++) {
  31. ibtile = jtilecol << 2;
  32. b_s[ibtile] = 1;
  33. b_s[ibtile + 1] = 1;
  34. b_s[ibtile + 2] = -1;
  35. b_s[ibtile + 3] = 1;
  36. }
  37. frexp(20000.0, &exponent);
  38. x.set_size(20000);
  39. for (jtilecol = 0; jtilecol < 20000; jtilecol++) {
  40. x[jtilecol].re = 0.0;
  41. x[jtilecol].im = 0.0;
  42. x[jtilecol].re = 1.0;
  43. x[jtilecol].im = 0.0;
  44. }
  45. for (jtilecol = 0; jtilecol < 4; jtilecol++) {
  46. for (ibtile = 0; ibtile < 5000; ibtile++) {
  47. c_s[ibtile + 5000 * jtilecol] = b_s[jtilecol + (ibtile << 2)];
  48. }
  49. }
  50. for (jtilecol = 0; jtilecol < 20000; jtilecol++) {
  51. ibtile = c_s[jtilecol];
  52. s[jtilecol].re = static_cast<double>(ibtile) * x[jtilecol].re;
  53. s[jtilecol].im = static_cast<double>(ibtile) * x[jtilecol].im;
  54. }
  55. }
  56. } // namespace phased
  57. } // namespace coder
  58. //
  59. // File trailer for AbstractPhaseCodedWaveform.cpp
  60. //
  61. // [EOF]
  62. //