Final project commit

This commit is contained in:
2016-04-14 10:06:35 +01:00
parent df66707225
commit d9d64e5b02
3 changed files with 29 additions and 16 deletions
+26 -13
View File
@@ -1,5 +1,7 @@
# Specify analysis parameters for root mean square analysis.
rms = {
# Analysis window sizes can be changed for each analysis individually.
# These do not need to match the grain size of the matcher or synthesis.
"window_size": 100,
"overlap": 8,
}
@@ -7,7 +9,10 @@ rms = {
f0 = {
"window_size": 4096,
"overlap": 8,
"ratio_threshold": 0.7
# Currently all frames below this ratio are digaurded and left as silence.
# Different databases will require different values for the best results.
# Noisier databases will need lower values than more tonal databases.
"ratio_threshold": 0.45
}
# Specify analysis parameters for variance analysis.
@@ -30,6 +35,7 @@ skewness = {
# Specify analysis parameters for FFT analysis.
fft = {
# The FFT window size determines the window size for all spectral analyses.
"window_size": 4096
}
@@ -42,26 +48,28 @@ database = {
# Sets the weighting for each analysis. a higher weighting gives an analysis
# higher presendence when finding the best matches.
matcher_weightings = {
"f0" : 1,
"f0" : 0.5,
"spccntr" : 1.,
"spcsprd" : 1.,
"spcflux" : 1.,
"spccf" : 1.,
"spcflatness": 1.,
"spcflux" : 3.,
"spccf" : 3.,
"spcflatness": 3.,
"zerox" : 1.,
"rms" : 1,
"peak": 1.,
"centroid": 1.,
"kurtosis": 1.,
"skewness": 1.,
"variance": 1.,
"harm_ratio": 1
"rms" : 0.1,
"peak": 0.1,
"centroid": 0.5.,
"kurtosis": 2.,
"skewness": 2.,
"variance": 0.,
"harm_ratio": 2
}
# Specifies the method for averaging analysis frames to create a single value
# for comparing to other grains. Possible formatters are: 'mean', 'median',
# 'log2_mean', 'log2_median'
analysis_dict = {
# log2_median formats using mel scale. This is useful for analyses such as
# F0.
"f0": "log2_median",
"rms": "mean",
"zerox": "mean",
@@ -88,6 +96,9 @@ analysis = {
matcher = {
# Force the re-matching of analyses
"rematch": False,
# This value must be the same as the synthesis grain size to avoid the
# speeding up or slowing down of the resulting file in relation to the
# original.
"grain_size": 100,
"overlap": 8,
# Defines the number of matches to keep for synthesis. Note that this must
@@ -108,7 +119,7 @@ synthesizer = {
# source and target.
"enforce_f0": True,
# Specify the ratio limit that is the grain can be modified by.
"enf_f0_ratio_limit": 3.,
"enf_f0_ratio_limit": 10.,
"grain_size": 100,
"overlap": 8,
# Normalize output, avoid clipping of final output by scaling the final
@@ -119,6 +130,8 @@ synthesizer = {
"match_quantity": 5
}
# Specifies the format for the output file. Changing this has not been tested
# so may produce errors/undesirable results.
output_file = {
"samplerate": 44100,
"format": 131075,
+2 -2
View File
@@ -426,7 +426,7 @@ class Matcher:
analysis_formatting = self.analysis_dict[analysis]
target_data, s = target_entry.analysis_data_grains(target_times, analysis, format=analysis_formatting)
target_data **= weightings[analysis]
target_data *= weightings[analysis]
all_target_analyses[i] = target_data
@@ -450,7 +450,7 @@ class Matcher:
analysis_formatting = self.analysis_dict[analysis]
source_data, s = source_entry.analysis_data_grains(source_times, analysis, format=analysis_formatting)
source_data **= weightings[analysis]
source_data *= weightings[analysis]
all_source_analyses[i] = source_data
+1 -1
View File
@@ -29,5 +29,5 @@ def shift(sigin, pitch):
with AudioFile(output_filepath, mode='r') as shift_output:
# Read result
result = shift_output.read_frames()
result = shift_output.read_grain()
return result