/* * High Speed modem to transfer data in a 2,7kHz SSB channel * ========================================================= * Author: DJ0ABR * * (c) DJ0ABR * www.dj0abr.de * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "hsmodem.h" int speed = 0; #define MAXSPDARR 5 int spdarr[MAXSPDARR]; #ifdef _LINUX_ int getus() { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000000 + tv.tv_usec; } #endif #ifdef _WIN32_ int getus() { int actms; SYSTEMTIME st; GetSystemTime(&st); actms = st.wSecond * 1000 + (int)st.wMilliseconds; return actms * 1000; } #endif int meanval(int v) { static int f=1; if(f) { for(int i=0; i0; i--) spdarr[i] = spdarr[i-1]; spdarr[0] = v; int ssum=0; int cnt = 0; for(int i=0; i