1
0
asobolev 1 gadu atpakaļ
vecāks
revīzija
88e2b74853
3 mainītis faili ar 16 papildinājumiem un 16 dzēšanām
  1. 4 4
      SIT-PR.ipynb
  2. 10 11
      controllers/sound.ipynb
  3. 2 1
      controllers/sound.py

+ 4 - 4
SIT-PR.ipynb

@@ -365,9 +365,9 @@
     "                            islands = isl_factory.generate_target(pt.hds)  # island near the speaker\n",
     "                            log_islands(islands)  # log island(s) positions\n",
     "                            tgt = [i for i in islands if not i.is_distractor][0]\n",
-    "                            log_event(c_time, round(tgt.x, 4), round(tgt.y, 4), round(tgt.r, 4), trial, 0)\n",
     "                            phase = 1  # trial phase\n",
     "                            trial += 1\n",
+    "                            log_event(c_time, round(tgt.x, 4), round(tgt.y, 4), round(tgt.r, 4), trial, 0)\n",
     "                            iti_distance = 0\n",
     "                            phase_start = c_time\n",
     "                            target_since = None\n",
@@ -573,7 +573,7 @@
     "\n",
     "# occupancy\n",
     "sigma = 0.1\n",
-    "lin_profile = np.linspace(-15, 15, 20)\n",
+    "lin_profile = np.linspace(-15, 15, 20) \n",
     "bump = np.exp(-sigma * lin_profile**2)\n",
     "bump /= np.trapz(bump)  # normalize to 1\n",
     "kernel = bump[:, np.newaxis] * bump[np.newaxis, :]\n",
@@ -697,7 +697,7 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 3",
+   "display_name": "Python 3 (ipykernel)",
    "language": "python",
    "name": "python3"
   },
@@ -711,7 +711,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.8.8"
+   "version": "3.8.13"
   }
  },
  "nbformat": 4,

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 10 - 11
controllers/sound.ipynb


+ 2 - 1
controllers/sound.py

@@ -270,9 +270,10 @@ class SoundControllerPR:
         for ch in self.cfg['sounds']['noise']['channels']:
             to_play[:, ch-1] = self.sounds['noise']
         
+        ch1 = self.cfg['sounds']['noise']['channels'][0]
         t0 = time.time()
         with open(self.cfg['file_path'], 'a') as f:
-            f.write(",".join([str(x) for x in (t0, -1)]) + "\n")
+            f.write(",".join([str(x) for x in (t0, -1, ch1)]) + "\n")
         
         self.stream.write(to_play)