📄 constants.h
字号:
//
// Copyright 2004 - 2006, Thomas C. McDermott, N5EG
// This file is part of VNAR - the Vector Network Analyzer program.
//
// VNAR 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 of the License, or
// (at your option) any later version.
//
// VNAR 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 VNAR, if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#pragma once
// Constants.h
//
// 07-25-04 TCM Original
// 05-10-05 TCM Delete VNA_XTAL_CONST and refereces to it. This is now
// handled by a Internal Crystal Calibration function.
// 03-19-06 TCM Add constants for the S21 measurement level offsets for
// Mid and Lo levels.
//
// Constants for the VNA instrument + others.
//
///\def Converts radians to degrees
#define RAD2DEGR 180.0/3.14159265358
///\def Converts degrees to radians
#define DEGR2RAD 3.14159265358/180.0
// Unused (old) constants before detector cal routines added...
//#define MAXREADP 3800 // Full-scale phase reading observed on S/N 1
//#define MINREADP 90 // Minimum-scale phase reading observed on S/N 1
//const int MIDREADP = MAXREADP/2; // Mid-scale phase reading
//#define MODMIDREADP (MAXREADP+MINREADP)/2 // modified mid-scale phase reading
//const int UPLIMITP = MAXREADP - MAXREADP/4; // Phase readings upper quartile
//const int DNLIMITP = MAXREADP/4 ; // Phase readings lower quartile
// Constants related to the actual numeric VNA instrument readings
// These are used until the Detector Calibration is run or loaded from a file.
#define MAXREFLMAGNITUDE 2100 // temporary until CALIBRATION is designed,
// observed on S/N 1
#define MAXTRANMAGNITUDE 3800 // temporary until CALIBRATION is designed,
// observed on S/N 1
///\def Maximum Calibration Frequency
#define MAXCALFREQ 120000000.0
///\def Minimum Calibration Frequency
#define MINCALFREQ 200000.0
///\def Number of Calibration Points
#define NUMCALPTS 1024.0
// def Maximum DDS output level DAC control word
//#define MAX_DDS_LEVEL 0xFFF // Multiplier for DDS Amplitude, unsigned 12-bit int. Maximum = 0xFFF
// Set the 0 db level to 2.5 dB below the maximum possible level
//#define MAX_DDS_LEVEL 0xC00 // Multiplier for DDS Amplitude, unsigned 12-bit int. Maximum = 0xFFF
///\ DDS Maximum Level Control
// Set the ~0 db level to 3 dB below the maximum possible level
#define MAX_DDS_LEVEL 0xB4F // Multiplier for DDS Amplitude, unsigned 12-bit int. Maximum = 0xFFF
// this constant is not dependent on MAX_DDS_LEVEL since it references the Q-DAC
#define QDAC_ZERODBM 0xAAA //0xAAA // 0 dbm for Q-DAC ref level
//0xFFF // about +3.5 dB too hot for Q-DAC
// constants used by Time Domain display
#define TDRTIMETICK 4.167 // 4.167 nanoseconds per TDR time tick
#define METERSPERNSEC 0.2998 // meters per nanosecond - free space
#define FEETPERNSEC 0.9836 // feet per nanosecond - free space
// constants that set the Mid and Lo levels for the target to measure S21
#define TARGETMIDMAG 17
#define TARGETLOMAG 34
// constant: sample-to-sample deviation that constitutes a glitch (bad reading)
#define GLITCHSIZE 30
#define FASTGLITCH // use FAST glitch correction algorithm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -