1
/* twpsk - A gui application for PSK
2
* Copyright (C) 1999 Ted Williams WA0EIR (ted_williams@HP.com)
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; either version 2 of
7
* the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be
10
* useful, but WITHOUT ANY WARRANTY; without even the implied
11
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
* PURPOSE. See the GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public
15
* License along with this program; if not, write to the Free
16
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
19
* Version: 2.0 - Aug 2001
23
* Disp class header file
25
#ifndef INCLUDED_TWPSKDISP
26
#define INCLUDED_TWPSKDISP
32
#define MAX_SAMPLES 8192 /* max sample buffer size */
33
#define MAX_FFT (MAX_SAMPLES / 2) + 1
36
#define LINE_WIDTH 2 /* keep it even */
48
XColor dispPix[MAX_GRAYS];
49
XColor redPix, defPix;
51
int values[DISPLAY_WIDTH][DISPLAY_HEIGHT];
55
int cnt; /* Sample counter */
56
int samples; /* Size of the sample */
57
int speed; /* Speed scale value 0 -> 100 */
58
int ffts; /* Number of filters */
59
float fc; /* Center freq of display */
60
float deltaf; /* Hz per fft sample */
61
int delta; /* Offset into fft samples */
62
float max; /* Max value in values? */
63
int maxi; /* Index to max */
64
int row; /* Row in circular buffer */
65
float scaleFactor; /* Scale factor for values */
74
inline float sqr(float arg)
79
inline void swap (float &a, float &b)
81
float t = a; a = b; b = t;
84
void IMDcalc(float val[]);
85
void mkPoints (float buffer[]);
86
void drawDisplay(void);
88
unsigned long get_mask_color(int color, unsigned long mask);
89
void find_visual_info(int *truecolor, XVisualInfo *vinf);
94
void fft_setup (int samps, int overlap);
95
void setup (Widget wfDA);
96
void offset (float freq);
97
void getFFT (float *val, int len);
99
int find_center (int x);
101
void changeDisplay (int val)
111
void set_samples(int samps)
113
fft_setup (512 * samps, -1);
116
void setFFTspeed (int val)