Modification of Conditioned Stimuli

21 views
Skip to first unread message

Arpit Kumar Pradhan

unread,
Jun 13, 2025, 5:25:46 PMJun 13
to FEDforum
Hey Guys,

I have a few questions regarding the conditioned stimuli part in the FED3. I want to change the sound type (use a different kind of sound, like white noise, instead of tone) and the duration. Can anyone suggest which part of the cpp file I need to modify. I found this line i the cpp file which I think solves the duration part. Any ideas on how to use a different sound.
void FED3::ConditionedStimulus(int duration) {
  tone (BUZZER, 4000, duration);
  pixelsOn(0,0,10,0);  //blue light for all
}


Regards!
Arpit 
Message has been deleted

Lex

unread,
Jun 14, 2025, 8:58:37 AMJun 14
to Matt Gaidica, FEDforum

Hi Matt,
FED3 has a simple buzzer module attached to a GPIO, not a fixed frequency module.  So it can do different tones, and even a "white noise" hack by looping through lots of short beeps of random frequencies. 

See the audio functions here:

https://github.com/KravitzLabDevices/FED3_library/wiki/3.-Functions#audio-functions

Arpit, rather than editing the .cpp file you can remove the conditioned stimulus function from your .ino file and just call the pixelsOn() function and then the noise() function to deliver what you want!  

Best,

-Lex



On Sat, Jun 14, 2025, 1:49 PM Matt Gaidica <ma...@gaidi.ca> wrote:
Hi Arpit,

The FED3 uses a fixed-frequency (4kHz) buzzer module: https://www.digikey.com/en/products/detail/tdk-corporation/PS1240P02BT/935924. Therefore, it can't act as a general purpose speaker. White noise is very specific waveform requiring a speaker to cover the audible spectrum. Future versions of FED might look into using a real speaker with a proper audio amp for this type of thing. You might think about hijacking the BNC output and using an external module if you are willing to dive into it. Others may have other clever solutions!

Pink Noise: Can It Help You Sleep?

--
You received this message because you are subscribed to the Google Groups "FEDforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedforum+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fedforum/99b7b984-71f3-4f91-969e-ddd1eb3d4970n%40googlegroups.com.

Matt Gaidica

unread,
Jun 14, 2025, 11:02:08 AMJun 14
to FEDforum
Oh sorry! There I go trying to be helpful :) I guess it's just limited on the low end to ~4kHz.

mg-2025-06-14-10.01.02.png


Reply all
Reply to author
Forward
0 new messages