Commit 90d4d211 authored by Alessio Quaresima's avatar Alessio Quaresima
Browse files

Load spectra fixed

parent 8d9e98b1
......@@ -4,17 +4,21 @@ using DataFramesMeta
using Pandas
cd(joinpath(@__DIR__,".."))
print(pwd())
##
py"""
import sys
import os
sys.path.insert(0, os.getcwd())
print(sys.path)
"""
##
TIMIT = pyimport("TIMIT_loader")
pyimport("importlib")."reload"(TIMIT)
#path = "C:\\Users\\leoni\\Desktop\\3rd_year_AI\\1_Thesis\\litwin-kumar_model_thesis\\Spike TIMIT"
path = "/home/cocconat/Documents/Research/phd_project/speech/litwin-kumar_model_thesis/Spike TIMIT"
# path = "/home/cocconat/Documents/Research/phd_project/speech/litwin-kumar_model_thesis/Spike TIMIT"
path = "/home/alequa/Documents/Research/phd_project/speech/Spike TIMIT"
dataset = TIMIT.create_dataset(joinpath(path,"train"))
spkrinfo, spkrsent = TIMIT.create_spkrdata(path)
......@@ -37,7 +41,7 @@ dict = SpikeTimit.create_dictionary(file=dict_path)
words = ["that"]
target_dialects = [1]
target_gender = "f" # "fm" "m"
target_gender = "m" # "fm" "m"
in_words(df_words) = !isempty(intersect(Set(df_words),Set(words)))
in_dialect(df_dialect) = df_dialect target_dialects
in_gender(df_gender) = occursin(df_gender, target_gender)
......@@ -47,7 +51,7 @@ speaker = @where(train,in_dialect.(:dialect), in_gender.(:gender), in_words.(:wo
speaker.words
words = TIMIT.get_spectra(speaker |> Pandas.DataFrame, target_words=["that"])
##
##
#
words[1].phones[1].db
##
using StatsBase
......@@ -63,7 +67,6 @@ function py2j_words(words)
end
return jwords
end
words =py2j_words(words)
function rate_coding_word(word::SpikeTimit.Word)
times = []
......@@ -76,12 +79,17 @@ function rate_coding_word(word::SpikeTimit.Word)
end
using Plots
times, phs = rate_coding_word(words[1])
a = heatmap(words[1].phones[1].db)
b = heatmap(words[1].phones[2].db)
c = heatmap(words[1].phones[3].db)
# times, phs = rate_coding_word(words[1])
words =py2j_words(words)
##
a = heatmap(words[1].phones[2].db);
b = heatmap(words[3].phones[2].db);
c = heatmap(words[2].phones[2].db);
d = heatmap(words[4].phones[2].db);
words[1].word
Plots.plot(a,b,c, layout=(1,3), colorbar=false, axes=nothing, ticks=nothing)
Plots.plot(a,b,c,d, layout=(4,1), colorbar=false)
##
words[1].phones[2].ph
times, phs = rate_coding_word(words[9])
heatmap(phs)
words[1].phones[1].ph
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment