Generated da stimulus

This commit is contained in:
2018-12-10 12:02:32 +00:00
parent 4da95bd8a8
commit 947cc369af
2 changed files with 25 additions and 0 deletions
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pysndfile import sndio
import numpy as np
import pdb
import matplotlib.pyplot as plt
def main():
'''
'''
da_file = './BioMAP_da-40ms.wav'
da_stim, fs, enc, fmt = sndio.read(da_file, return_format=True)
prestim_size = 0.0158
full_stim_size = 0.09174311926605504
da_size = 0.04
prestim = np.zeros(int(fs*prestim_size))
poststim = np.zeros(int(fs*((full_stim_size-prestim_size)-da_size)))
y_part = np.concatenate([prestim, da_stim, poststim])
y = np.tile(y_part, 3000)
sndio.write('./3000_da.wav', y, rate = fs, format = fmt, enc=enc)
if __name__ == "__main__":
main()