Record audio signals with the cyton board
paulasaavedra
Argentina
in Cyton
Hello! I would like to record audio output from a computer being played through a speaker. This audio is the stimulus for an experiment, I record 8 EEG channels with the Cyton. In addition, I would like to record the audio to know the delay that my computer's sound card has.
Is it possible to record that audio with the Cyton? Can you explain me, please?
Comments
The sample rate of the Cyton is 250Hz. You can use one of your channels or one of the Aux channels to record a low fidelity version of the audio. This is called an "external trigger" setup.
https://docs.openbci.com/Cyton/CytonExternal/
The EEG channels are microvolt sensitive, so you would need a voltage divider network to scale the 'audio' signal down to microvolt level. Probably more practical is to use one of the Aux channels in "analog board mode". This is a 10 bit ADC with the zero value representing 0 volts and the max 1023 value representing the PIC32 voltage of 3.3V.
https://docs.openbci.com/Cyton/CytonSDK/#board-mode
William
It's good to have electrical isolation between any external equipment that is sending signals to the Cyton. So the idea about sending the actual audio from the computer speaker (or Y-cable headphones plug) to the Cyton is problematic. And generally discouraged. Voltages from the audio cable are not well controlled to the 0V to 3.3V range, and there is no isolation.
There are pages such as the following, which show how to connect a mic (via an amplifier circuit) to an arduino ADC, but even this looks overly complex. The 5V power supply is also an issue, if not battery.
http://www.learningaboutelectronics.com/Articles/Arduino-microphone-circuit.php
Another issue with that idea is that the output of the LM386 amplifier chip could exceed the allowable 0V to 3.3V limits of the PIC32 ADC.
Look at this page regarding Cyton External Trigger, using an optoisolator:
https://docs.openbci.com/Cyton/CytonExternal/#optoisolation
This is really your best approach, but requires the external trigger signal (from your computer) to be a logic level that goes from 0V to 3.3V or 5V, when your audio starts. There are multiple ways to wire this. But in thinking about it, the simplest might be to have a small Arduino board connected via a usb serial port to your laptop. A serial port command (ascii string) would be defined to indicate the trigger start. The Arduino would then pulse an output pin that goes to the optoisolator. This same Arduino could also produce audio beeps if you desired, perhaps with different serial port 'commands'.