This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
songnames = [ 'Anne-Marie/2002', | |
'Aaron Sheer/Searching', | |
'The Clash/Should I Stay Or Should I Go', | |
'Jessie Reyez/Figures, a Reprise (Feat. Daniel Caesar)', | |
'Usher/Love In This Club (Feat. Young Jeezy)', | |
"Jason Mraz/I'm Yours", | |
"Jason Mraz/I Won't Give Up", | |
"Justin Bieber/Love Yourself", | |
"Anne-Marie/FRIENDS", | |
"The Chainsmokers/Closer (Feat.Halsey)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
songnames = [ 'Anne-Marie/2002', | |
'Aaron Sheer/Searching', | |
'The Clash/Should I Stay Or Should I Go', | |
'Jessie Reyez/Figures, a Reprise (Feat. Daniel Caesar)', | |
'Usher/Love In This Club (Feat. Young Jeezy)', | |
"Jason Mraz/I'm Yours", | |
"Jason Mraz/I Won't Give Up", | |
"Justin Bieber/Love Yourself", | |
"Anne-Marie/FRIENDS", | |
"The Chainsmokers/Closer (Feat.Halsey)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
@author: HioBeen Han, hiobeen.han@kaist.ac.kr | |
""" | |
from time import sleep, gmtime, strftime | |
init_t = strftime("%Y%m%d-%H%M%S", gmtime()) | |
print('Initiated at ' + init_t + ' ....') | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
import requests |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def fft_half(x, srate=2000): | |
return np.fft.fft(x)[:int(len(x)/2)]/len(x), np.linspace(0,srate/2,len(x)/2) | |
# [1 x n] 2D time vector (t) should be in unit of seconds. Length should be | |
def get_spectrogram( data, t=EEG.times, srate=2000, | |
fft_win_size=2**10, t_resolution=0.1, freq_cut = 150): | |
# For many- and single-trials data compatibility | |
if data.ndim < 3: data= np.expand_dims(data,2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function EEG = hiobeen_spectrogram( EEG, fft_win_size, t_resolution, freq_cut, option ) | |
%% Calculating spectrogram from EEG dataset | |
% | |
% EEG=hiobeen_spectrogram( EEG ); % optimized to eeglab default format | |
% EEG=hiobeen_spectrogram( EEG [,fft_win_size] [,t_resolution,] [freq_cut,] [option] ) | |
% | |
% .. fft_win_size (default 2^10) : Window size to sample (unit: data point | |
% .. t_resolution (default 0.1) : Time resolution of sliding (unit: sec) | |
% .. freq_cut (default: Nyquist) : Frequency upper-limit (unit: Hz) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ifd, h_x, h_y, ang_diff] = hb_get_IFD( x, y, srate ) | |
% | |
% hiobeen.han@kaist.ac.kr | |
% | |
h_x = angle(hilbert(x)); h_y = angle(hilbert(y)); | |
ang_diff = h_x - h_y; | |
freqF = srate/(2*pi); ifd = freqF * diff( unwrap(ang_diff)); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%clear all; | |
figure(100); clf; hold on | |
set(gcf, 'Color', [1 1 1]) | |
% Wave generator | |
srate = 300; dura = 1; % sec | |
freq = [10 15]; % Hz | |
wave1 = MakeBeep( freq(1), dura, srate ); wave1 = wave1(1:end-1); | |
wave2 = MakeBeep( freq(2), dura, srate ); wave2 = wave2(1:end-1); | |
x = [wave1, wave1, wave1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [comod,amptds] = hb_comodulogram(xx, yy, filters_x, filters_y, nBin, MIfactor) | |
% | |
%% MATLAB function for Comodulogram (phase-amplitude coupling) | |
% | |
% function comod = hb_comodulogram(xx, yy, filters_x, filters_y) | |
% x: slow frequency signal | |
% y: fast frequency signal | |
% hiobeen.han@kaist.ac.kr | |
% | |
if nargin<6, MIfactor=1000; end |