|
radar_static_target_simulator_cc源码深入研究
模拟给定信号在点目标上的后向散射
输入信号是传输信号。输出信号是接收到的反向散射信号,每个接收天线包含一个输出信号
衰减取决于中心频率、雷达截面、目标距离和光速:
延迟取决于目标的距离:
多普勒频移取决于相对速度和中心频率:
将这些信号相加以产生总和信号:
矢量确定每个RX天线与原点的距离(注:TX天线始终位于原点)
对于一个简单的单站SISO雷达,只需将位置_rx设置为[0]
std::vector<float> d_range, d_velocity, d_rcs, d_azimuth, d_position_rx;
int d_samp_rate;
float d_center_freq;
int d_hold_noutput;
bool d_rndm_phaseshift;
bool d_self_coupling;
float d_self_coupling_db;
int d_num_targets;
// Get num targets
d_num_targets = range.size();
多普勒频率公式:
d_doppler[k] = 2 * d_velocity[k] * d_center_freq / c_light;
C++标准模版库(STL)中的vector实现变长数组
std::vector<std::vector<float>> d_timeshift_azimuth; 向量里有向量 就是矩阵了
- #include <iostream>
- #include <cmath>
- #include <ctime>
- #include <vector>
- using namespace std;
- #define GR_M_PI 3.14159265358979323846 /* pi */
- void print_vector(vector<float> &v){
- for(int i=0; i< v.size(); i++){
- cout << v[i] << ",";
- }
- cout << endl;
- }
- int main(){
- float angle=45;
- cout << "std::sin()=" << std::sin(angle * GR_M_PI / 180.0) << endl;
- cout << "std::sqrt()=" << std::sqrt(100) << endl;
- cout << "std::pow()=" << std::pow(2, 10) << endl;
- cout << "std::exp()=" << std::exp(1) << endl;
- cout << "std::fmod()=" << std::fmod(10, 3) << endl;
- cout << "std::time()=" << std::time(NULL) << endl;
- std::srand(666); // 以666为随机数生成器的种子 seed rand
- cout << "std::rand()随机数=" << std::rand() << endl;
- vector<float> my_vector(8, 10);
- print_vector(my_vector);
- //fill_n函数的作用是:给你一个起始点,然后再给你一个数值count和val。把从起始点开始依次赋予count个元素val的值
- std::fill_n(my_vector.begin(), 4, 20);
- print_vector(my_vector);
- std::fill_n(my_vector.begin()+3, 3, 33);
- print_vector(my_vector);
- return 0;
- }
复制代码
有难度了:work仿真模块 支持多目标 支持静止与运动 都是点目标 支持多幅Rx天线
对noutput_items的理解不到位
// compute cos for a block of phase angles
void cos(float* output, int noutput_items, double ampl = 1.0)
{
for (int i = 0; i < noutput_items; i++) {
output = (float)(gr::fxpt::cos(d_phase) * ampl);
step();
}
}
|
|