Commit 123f3472 authored by Alessio Quaresima's avatar Alessio Quaresima
Browse files

Examples with cochlear encoding

parent a60add9f
......@@ -2,16 +2,23 @@ include("../src/SpikeTimit.jl")
# path = "/home/cocconat/Documents/Research/phd_project/speech/litwin-kumar_model_thesis/Spike TIMIT"
path = "/home/alequa/Documents/Research/phd_project/speech/Spike TIMIT/"
path = "/home/alequa/gwdg_cloud/"
#Create the path strings leading to folders in the data set
test_path = joinpath(path, "test");
# test_path = joinpath(path, "test");
train_path = joinpath(path, "train");
dict_path = joinpath(path, "DOC/TIMITDIC.TXT");
train = SpikeTimit.create_dataset(;dir= train_path)
test = SpikeTimit.create_dataset(;dir= test_path)
# test = SpikeTimit.create_dataset(;dir= test_path)
dict = SpikeTimit.create_dictionary(file=dict_path)
##
##
# Parameters to compute the input_data
target_dialects = [1,2,5,8]
target_gender = "f" # "fm" "m"
......
## import the dataset. Notice, the spike-time are not imported, only the files are stored and ready to be read.
include("src/SpikeTimit.jl")
include("../src/SpikeTimit.jl")
using .SpikeTimit
using Plots
......@@ -16,15 +16,15 @@ test = SpikeTimit.create_dataset(;dir= test_path)
## function get_spiketimes(;df, word)
my_sent = train[1,:]
my_sent = train[1:2,:]
my_sent.words
#we want the dark word
spikes = SpikeTimit.get_spiketimes(;df=my_sent)
hds_spikes = SpikeTimit.get_spiketimes(;df=my_sent, encoding="cochlea", channels=70)
bae_spikes = SpikeTimit.get_spiketimes(;df=my_sent, encoding="BAE", channels=70)
SpikeTimit.resample_spikes!(bae_spikes,n_feat=8)
new_spikes = SpikeTimit.resample_spikes(spike_times=spikes[1],n_feat=8)
histogram(vcat(new_spikes...),bins=0:0.01:3 )
plot(SpikeTimit.raster_plot(hds_spikes[1]).plt,SpikeTimit.raster_plot(bae_spikes[1]).plt, layout=(2,1))
## Verify spike resampling is correct
......
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