Skip to content

Commit

Permalink
Merge pull request #11 from JoFrhwld/dev
Browse files Browse the repository at this point in the history
changes from dev
  • Loading branch information
scjs committed Jun 6, 2014
2 parents 14607be + 30a5327 commit f5b7e70
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
20 changes: 15 additions & 5 deletions FAVE-extract/bin/extractFormants.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
import vowel
import subprocess

import pickle

import numpy as np
from itertools import tee, islice, izip

Expand Down Expand Up @@ -1567,9 +1569,10 @@ def predictF1F2(phone, selectedpoles, selectedbandwidths, means, covs):
# append poles and bandwidths to list of values
# (if F3 and bandwidth measurements exist, add to list of appended values)
if len(poles) > 2:
values.append([x[0], x[1], x[2], x[3], poles[2], bandwidths[2]])
values.append(
[poles[i], poles[j], bandwidths[i], bandwidths[j], poles[2], bandwidths[2]])
else:
values.append([x[0], x[1], x[2], x[3], '', ''])
values.append([poles[i], poles[j], bandwidths[i], bandwidths[j], '', ''])
# append corresponding Mahalanobis distance to list of
# distances
distances.append(dist)
Expand All @@ -1592,11 +1595,11 @@ def predictF1F2(phone, selectedpoles, selectedbandwidths, means, covs):
# if there is a "gap" in the wave form at the point of measurement, the bandwidths returned will be empty,
# and the following will cause an error...
if values[winnerIndex][2]:
b1 = math.exp(values[winnerIndex][2])
b1 = values[winnerIndex][2]
else:
b1 = ''
if values[winnerIndex][3]:
b2 = math.exp(values[winnerIndex][3])
b2 = values[winnerIndex][3]
else:
b2 = ''
if values[winnerIndex][5]:
Expand Down Expand Up @@ -1728,12 +1731,14 @@ def setup_parser():
help="Don't include output header in text output.")
parser.add_argument("--nSmoothing", type=int, default=12,
help="Specifies the number of samples to be used for the smoothing of the formant tracks.")
parser.add_argument("--onlyMeasureStressed", action="store_false")
parser.add_argument("--onlyMeasureStressed", action="store_true")
parser.add_argument("--outputFormat", "-o", choices = ['txt', 'text', 'plotnik', 'Plotnik', 'plt', 'both'], default="txt",
help = "Output format. Tab delimited file, plotnik file, or both.")
parser.add_argument("--preEmphasis", type=float, default=50,
help="The cut-off value in Hz for the application of a 6 dB/octave low-pass filter.")
parser.add_argument("--phoneset", "-p", default = "cmu_phoneset.txt")
parser.add_argument("--pickle", action = "store_true",
help = "save vowel measurement information as a picklefile")
parser.add_argument("--remeasurement", action="store_true",
help="Do a second pass is performed on the data, using the speaker's own system as the base of comparison for the Mahalanobis distance")
parser.add_argument("--removeStopWords", action="store_true",
Expand Down Expand Up @@ -1940,6 +1945,7 @@ def writeLog(filename, wavFile, maxTime, meansFile, covsFile, stopWords, opts):
f.write("- covsFile:\t\t\t%s\n" % opts.covariances)
f.write("- remeasurement:\t\t%s\n" % opts.remeasurement)
f.write("- vowelSystem:\t\t%s\n" % opts.vowelSystem)
f.write("- pickle\t\t%s\n" % opts.pickle)
if opts.removeStopWords:
f.write("- stopWords:\t\t\t%s\n" % opts.stopWords)
f.write("\n\n")
Expand Down Expand Up @@ -2289,6 +2295,10 @@ def extractFormants(wavInput, tgInput, output, opts, SPATH='', PPATH=''):
measurements, m_means = normalize(measurements, m_means)
print ''
outputMeasurements(outputFormat, measurements, m_means, speaker, outputFile, outputHeader)
if opts.pickle:
pi = open(os.path.splitext(outputFile)[0] + ".pickle", 'w')
pickle.dump(measurements, pi, pickle.HIGHEST_PROTOCOL)
pi.close()

markTime("end")

Expand Down
1 change: 1 addition & 0 deletions FAVE-extract/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ faav
--nSmoothing
12
--remeasure
--pickle
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ You can find user support for installing and using the FAVE toolkits at the [FAV
## Contributing to FAVE
For the most part, we'll be utilizing the fork-and-pull paradigm (see [Using Pull Requests](https://help.github.com/articles/using-pull-requests)). Please send pull requests to the `dev` branch.

If you want to keep up to date on FAVE development, or have questions about FAVE development, send a request to join the [FAVE Developers' Group](https://groups.google.com/forum/#!forum/fave-dev).

## Attribution
We ask that if you use the online interface, or the code available in this repository, that you cite:
[![10.5281/zenodo.9846](https://zenodo.org/badge/doi/10.5281/zenodo.9846.png)](http://dx.doi.org/10.5281/zenodo.9846)

Rosenfelder, Ingrid; Fruehwald, Josef; Evanini, Keelan and Jiahong Yuan. 2011. FAVE (Forced Alignment and Vowel Extraction) Program Suite. http://fave.ling.upenn.edu.
As of v1.1.3 onwards, releases from this repository will have a DOI associated with them through Zenodo. The DOI for the current release is [10.5281/zenodo.9846](http://dx.doi.org/10.5281/zenodo.9846). We would recommend the citation:

Rosenfelder, Ingrid; Fruehwald, Josef; Evanini, Keelan; Seyfarth, Scott; Gorman, Kyle; Prichard, Hilary; Yuan, Jiahong; 2014. FAVE (Forced Alignment and Vowel Extraction) Program Suite v1.1.3 doi:10.5281/zenodo.9846

The contributions of some of these individuals, especially that of Ingrid Rosenfelder, are not reflected in the commit history.
Use of the interactive online interface should continue to cite:

Rosenfelder, Ingrid; Fruehwald, Josef; Evanini, Keelan and Jiahong Yuan. 2011. FAVE (Forced Alignment and Vowel Extraction) Program Suite. http://fave.ling.upenn.edu.

0 comments on commit f5b7e70

Please sign in to comment.