⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sinc_wave.cpp

📁 《无线通信系统仿真——c++使用模型》这本书的源代码
💻 CPP
字号:
//
//  File = sinc_wave.cpp
//

#include <stdlib.h>
#include <math.h>
#include "sinc_wave.h"
#include "sinc.h"
#include <fstream>
using namespace std;
#ifndef PI
  #define PI 3.1415926535897932
#endif

void SincWaveform(  int num_sidelobes,
                    int samps_per_hump,
                    char* out_filename)
{
   double delta, val, t_val;
   ofstream *out_file;
   out_file = new ofstream(out_filename, ios::out);

   delta = 1.0/double(samps_per_hump);

   for(int n=-(num_sidelobes+1)*samps_per_hump; n<=(num_sidelobes+1)*samps_per_hump; n++)
   {
      t_val = n*delta;
      val = sinc(t_val);
      (*out_file) << t_val << ", " << val << endl;
   }
   delete out_file;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -