Sensor board help

Is it normal for the sensor board to read frequency data when there is complete silence. For example on any of the Spectro Matrix patterns. Is there a way to limit the microphone from picking up any noises below 30 DB? I have verified the censor board is connected correctly and the frequency data numbers in the vars watcher definitely jump when music is playing. I would just like for everything to zero out when no noise is detected. Thank you guys!

Yes, because of the issue of gain. You can just treat the baseline as your zero, like by subtracting that amount.

Yes, there is a noise floor.

You can see what kind of numbers you are getting by looking in vars watch.

Some patterns use a PI controller to implement automatic gain control, and use that as a multiplier, so may be worse when it’s quiet since they boost the noise.

You could subtract out the “noise floor” - that is some value under a threshold, and clamp values >= 0. e.g.

aValue = max(0, frequencyData[10] - .002)

In this case, max() uses the 0 when the subtraction would result in negative values.

1 Like

Thank you my mess with it when I get off in a couple hours I appreciate all the help try to figure it out on my own before I asked you guys but it’s definitely a learning process.

So it seems like the numbers next to make Pi controller have to do with the mic sensitivity just don’t understand what (ki,kp) are.

Hey! These are coefficients in a PI controller.

Kp is the multiplier for “proportional” correction. How much do you want the right-now difference to matter? Make this higher if you want it to be more lively.

Ki is the multiplier for the “integral”, in other words, the accumulated error over time. Make this higher if you feel like it’s never able to adapt to long periods of soft or loudness. Reduce it if you sense too much lag adapting to sudden changes in volume.

2 Likes

Just a quick note, you aren’t the only one to get a bit frustrated at this.

My method (subtract some base amount, to just reduce noise in general) leaves a handful of stray noisy bits regardless, and the current pattern I’m working on, those are quite noticeable when it’s quiet. (even using the aux input, so it’s not just background noise in my environment)

The gain issue is a major one, and hopefully we can do a better job documenting how a PIC controller actually works (the sound-blinkfade tries, but doesn’t do anything frequencyData related, and the other example patterns don’t help much.)
Even the provided pattern of “spectrum analyser 1D/2D” shows constant stray noise, and it’s using a PIC controller, so I’m not sure it’s the right answer.

Normally in the audio world, if you’re using any kind of automatic gain control, you use a noise gate with it – something that very quickly (but not necessarily instantly) zeros the output if the input falls below a set threshold. The squelch control on CB radios is a real-world example.

I’ve only glanced a a little of the PIC code out there, but it seems like it would not be hard to add a gate using a few frames of energyAverage as a trigger. If you wanted to control the gate’s open/close speed, you could set up another PI control to do that!

1 Like

Thank you you guys are awesome! I’m a huge audiophile, and have a four-way fully active. Dsp controlled sound system in my car. I totally understand the difficulty with the mic being able to pick up and separate frequencies especially at higher decibel levels. I appreciate all the help. Coding is definitely not an overnight thing but 8m learning little by little :grin:

@Twilight ,
You can run line-level audio straight to the sensor board too. If you plug something in the aux jack it switches to that instead of the mic. The frequency response is much better.

I’ve found that filtering/averaging the FFT samples a bit helps a lot as well. Those come in at ~40 updates a second, which is great for super snappy response, but are still responsive with just a little filtering.

1 Like

Yes definitely. Sound patterns are right on point when connecting directly to the board!
Unfortunately the microphone has to deal with resonance, vibration, Standing sound waves. I ended up trying about 5 different spots(In my car) to mount the pixel Blaze. Found a location where the microphone was picking up frequencies from all the speakers as opposed to just getting muddled with bass and vibration.

1 Like