📄 qa_gr_fxpt_nco.cc
字号:
/* -*- c++ -*- *//* * Copyright 2004 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */#include <qa_gr_fxpt_nco.h>#include <gr_fxpt_nco.h>#include <gr_nco.h>#include <cppunit/TestAssert.h>#include <iostream>#include <stdio.h>#include <unistd.h>#include <math.h>static const float SIN_COS_TOLERANCE = 1e-5;voidqa_gr_fxpt_nco::t0 (){ gr_nco<float,float> ref_nco; gr_fxpt_nco new_nco; ref_nco.set_freq (2 * M_PI / 5003); new_nco.set_freq (2 * M_PI / 5003); for (int i = 0; i < 100000; i++){ float ref_sin = ref_nco.sin (); float new_sin = ref_nco.sin (); CPPUNIT_ASSERT_DOUBLES_EQUAL (ref_sin, new_sin, SIN_COS_TOLERANCE); float ref_cos = ref_nco.cos (); float new_cos = ref_nco.cos (); CPPUNIT_ASSERT_DOUBLES_EQUAL (ref_cos, new_cos, SIN_COS_TOLERANCE); ref_nco.step (); new_nco.step (); }}voidqa_gr_fxpt_nco::t1 (){}voidqa_gr_fxpt_nco::t2 (){}voidqa_gr_fxpt_nco::t3 (){}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -