I am working on a project with NEOPIXELS and FFT.

I am working on a project with NEOPIXELS and FFT. The strobe effect is frustrating. I have tried various delay() methods but that is not good. It chops up the show by pausing the program. Not to mention I have been thinking delay is a bit sloppy these days.

I decided to go about it like a debounce. The thought here is that the program is reacting every time a set frequency range and amplitude is hit. Multiple frequencies of music are being processed at the same time making the program display all it sees in a strobe. If the desired frequency range and amplitude are found, check again in a short amount of time to see if its still true. If true display new colors, if false continue looking.

    if (fr5 >= 0.1)
    {
    static unsigned long last_mid2Time = 0; 
    unsigned long mid2Time = millis();
      if (mid2Time - last_mid2Time > 100 && fr4 >= 0.1)

// fr4 representing the frequency range and 0.1 the amplitude

This seems to have smoothed out the strobe some. Its an interesting effect but the problem is its not enjoyably accurate & smooth.

any tips on smoothing out FFT represented in a few pixels?

Can you post a video of what you’re seeing? Have you tried implementing a slower peak decay? Instead of immediately dropping from a high bin reading to a low one, decrease a small amount each frame. Here’s an example: https://github.com/pixelmatix/SmartMatrix/blob/master/examples/SpectrumAnalyzer/SpectrumAnalyzer.ino#L119-L125

Im also using Paul Stoffregen audio library and the teensy 3.2. I have not tried doing a decay. All the programs have just jumped to the next color set when activated.

I am just using 6 pixels. here is a video from another program I wrote. It is not easy to see the full strobe effect in the video. My phones camera does not do a good job at capturing whats going on with the lights.

https://www.instagram.com/p/_8G1c9n-rO/?taken-by=rexhex

Cool build! I think implementing a peak decay will help greatly.

Thank you! I don’t see where the decay is happening in the referenced code. It looks like its for a screen to show 16 bands amplitude in the form of a bar. It cycles through the 16 bands multiplying the bands values by 256.0.

Yeah, I’m not sure what you’re displaying, but you’ll need an array to hold the values from the previous frame. Then, every frame, check to see if the new value is greater than the previous. If it is, display it, if not, just subtract a small amount from the previous frame. That way it still responds quickly to spikes without any delay. But falling values get smoothed out a bit, depending on how much you subtract each frame.

Ok, I think I understand it now. Thank you.