Fex

Check-in [17f3ce2f1e]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add log transform option
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | master
Files: files | file ages | folders
SHA3-256:17f3ce2f1e4ee55d233691a085c871519d658f4e57375a4418ce97b95d4bf827
User & Date: jesse.mcclure@umassmed.edu 2016-05-18 14:00:49
Context
2017-08-17
14:31
Cleaning up for new python version check-in: 42a96c2c60 user: jmcclure tags: trunk, master
2016-05-18
14:00
add log transform option check-in: 17f3ce2f1e user: jesse.mcclure@umassmed.edu tags: trunk, master
2016-02-10
19:14
added logFreq option to log transform frequencies - I advise *against* using this option check-in: 4fd5b5e5b0 user: jesse.mcclure@umassmed.edu tags: trunk, master
Changes

Changes to share/config.

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
set samples    = 256
set bandpass   = 1.25 10.0
set scale      = 8
set window     = hanning
set fontFamily = droid sans
set fontSize	= 14
set help       = xterm -e man fex-help
## CAUTION: logFreq was added by user request.  While the option will accurately
## log (base 10) transform frequencies as requested, I have not done any testing
## on whether this produces reasonable results.  Using this option is strongly
## discouraged until it has been thoroughly tested and found to give reasonable
## results.
set logFreq    = false

## Colors
##   spectrogram: background spectrogram
##   threshold: points included in the signal
##   points: points included in the current excursion calculation
##   lines: lines connecting points in the current calculation







|
|
|
|
<







35
36
37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
set samples    = 256
set bandpass   = 1.25 10.0
set scale      = 8
set window     = hanning
set fontFamily = droid sans
set fontSize	= 14
set help       = xterm -e man fex-help
## CAUTION: logFreq was added by user request.  While the option will log (base 10)
## transform frequencies. I have not done any testing on whether this produces
## reasonable results.  Using this option is discouraged # until it has been more
## well tested.

set logFreq    = false

## Colors
##   spectrogram: background spectrogram
##   threshold: points included in the signal
##   points: points included in the current excursion calculation
##   lines: lines connecting points in the current calculation

Changes to src/spectro.c.

142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
				if (spect->fft->mask[i][j]) continue;
				if (spect->fft->amp[i][j] > spect->fft->amp[i][f] || !f)
					f = j;
		}
		/* add points and do calculations if f is above threshold */
		if (f > 0 && spect->fft->amp[i][f] > conf.thresh) {
			if (lt != spect->fft->time[0]) {
				if (conf.log10)
					spect->pex += hypot(log10(spect->fft->freq[f]) - log10(lf),spect->fft->time[i] - lt);
				else
					spect->pex += hypot(spect->fft->freq[f] - lf,spect->fft->time[i] - lt);
				spect->tex += spect->fft->time[i] - lt;
			}
			lt = spect->fft->time[i];
			lf = spect->fft->freq[f];
			cairo_line_to(l,
					(i - spect->fft_x) * conf.scale + conf.scale / 2,
					(f - spect->fft_y) * conf.scale + conf.scale / 2);







<
|
<
|







142
143
144
145
146
147
148

149

150
151
152
153
154
155
156
157
				if (spect->fft->mask[i][j]) continue;
				if (spect->fft->amp[i][j] > spect->fft->amp[i][f] || !f)
					f = j;
		}
		/* add points and do calculations if f is above threshold */
		if (f > 0 && spect->fft->amp[i][f] > conf.thresh) {
			if (lt != spect->fft->time[0]) {

				if (conf.log10) spect->pex += hypot(log10(spect->fft->freq[f]) - log10(lf),spect->fft->time[i] - lt);

				else spect->pex += hypot(spect->fft->freq[f] - lf,spect->fft->time[i] - lt);
				spect->tex += spect->fft->time[i] - lt;
			}
			lt = spect->fft->time[i];
			lf = spect->fft->freq[f];
			cairo_line_to(l,
					(i - spect->fft_x) * conf.scale + conf.scale / 2,
					(f - spect->fft_y) * conf.scale + conf.scale / 2);