Teensy 4.1 anolog signal to FFT to 8 pins out ( noise floor help)

charles789

New member
Hello I'm doing an art project that involves sending the max amplitude of 16 different frequency bins at a flashing binary rate to 2 octocouplers in order to achieve 24v (solenoid valves on/ off, one octocoupler has 8 pins each) via digital pins out on the teensy. I'm a technician by trade not an engineer or programmer. I've been using chatgpt 4.0 to help code. Octocouples have LED indicators. So far yes the LEDs flash to the rate of max amplitude of each frequency range. ( 0 to 20k hz) I just have a 3.5mm jack stripped and plugged via mono to one of the teensy pins ( set to anolog in the code aka pin 27) and to ground. But I have too high of a noise floor especially with the first LED ( 0 to ~1.2k hz). Upon reading.. do I need an audio shield? Components, resistors? What's this type of filtering called? I'm just powering through USB. Would using a simple voltage regulator Power supply? Is all this my problems or is there a simple solution I'm missing!? Thanks for the help!
 
Big picture.. I'm making an audio spectrum visualizer with 128 bands that moves pneumatic cylinders up and down. Using ableton split the recording tracks into 8 instrument clusters that go out 8 different audio outs and the plan is to go into 8 different micro controllers each processing there own FFT all adding up to 128 unique bands. Tried arduino at first. My conclusion was that it didn't have enough memory to do an fft for 16 different bands so I switched to teensy
 
This sounds like a really awesome project. I want to help, but to give specific electronics troubleshooting advice requires seeing a lot more detail. Photos and schematics or clear diagrams are best. Small but complete test code also really helps, because often problems which seem to be hardware turn out to be software issues.

Now I'll try to answer a few of your questions, but please understand this is pretty generic advice. That's the best I can do with so little specific detail.

To receive an analog audio signal, the audio shield will definitely give better quality than use of an ADC pin on Teensy. But the analog input hardware may not be the limiting factor. A very common problem with all audio systems (not just Teensy) is called "ground loop" noise. If you are suffering from that sort of issue, it will corrupt your signal the same way regardless of which type of analog input you use.

Power supplies matter. Use of optocouplers between Teensy and whatever controls your moving pneumatic cylinders (maybe solenoids?) might help. But the finer details really matter, especially whether the power supplies are earth grounded and how the PC running ableton is powered.

I noticed you mentioned "the first LED ( 0 to ~1.2k hz)". This is some guesswork since I can't see your code, but perhaps you're thinking of frequency spectrum on a linear scale of frequency? Human hearing works on a logarithmic scale, which is easiest to think about in octaves. For visualizing music at 8 outputs, you probably want each to cover about 1 octave, maybe 2 octaves at the extreme low and high frequenies that most people really don't hear. If you sum up all the FFT bins from 20-1200 Hz, that's roughly 6 octaves which ends up combining nearly all the musically interesting info.
 
Thanks! I ordered a power supply and the audio shield! I will post my code and draw up a schematic according to the guidelines this weekend. In terms of the audio splitting. Yes I was just thinking linear. I figured by splitting the song digital by instrument (in collab with a friend of mine who's going to make the songs). Then send each instrument or group into there own micro controller for FFT
 
I agree that this sounds like a great project!

Do I understand that right that there is a Laptop/PC with Ableton Live involved in the Setup? In this case it could be easier to do all the signal processing in software there and just send trigger data to microcontrollers. That is way easier to program and more flexible to change. Possibel using max4live , max MSP, Puredata or something else.

Advantage of a full microcontroller setup is the really robust standalone functionality of a system where you can connect to any audio signal.

BTW it is possible to run a FFT in a small Arduino Nano up to 1024 samples, see for example:
or


Of course with a Teensy + audioshield you have way more options.
 
I agree that this sounds like a great project!

Do I understand that right that there is a Laptop/PC with Ableton Live involved in the Setup? In this case it could be easier to do all the signal processing in software there and just send trigger data to microcontrollers. That is way easier to program and more flexible to change. Possibel using max4live , max MSP, Puredata or something else.

Advantage of a full microcontroller setup is the really robust standalone functionality of a system where you can connect to any audio signal.

BTW it is possible to run a FFT in a small Arduino Nano up to 1024 samples, see for example:
or


Of course with a Teensy + audioshield you have way more options.
Ahh yes! We did look into max4live but couldn't figure out the coding especially for 8 different audio signals going into their own FFT. Wasn't much info on how do to it from our understanding. For a previous iteration of this project we successfully worked with DMX protocols on Abletons Automation and controlled 32 channels in that project but could not find a Decoder that could support 128 channels with DMX. I could use many decoders but even then the schematics requires 2 or 4 power supply's to avoid interference. We controlled channels Using EMU too.
With the cost of the valves alone being 2000$ already. If we continued this route of programming the controllers and decoders would of cost twice as much vs using 8 teensy and audio shields. ( most decoders only go to 32 channels costing 100 a piece). Though we do plan on still using DMX for another part of this project
 
Good to hear that you already checked all these options. Good luck with the project! Looking forward to seeing progress and/or the final setup. These pneumanic cylinders sound impressive. I like such mechanical things.
 
Back
Top