Teensy 4.1 and Rev D audio board - equaliser

SteveCS

Well-known member
Hi

Just about to start an audio project using 4.1 + audio board.

Can you implement an equaliser on the audio board? Never used it before.
Had a play around with the configuration page. Not quite worked it out yet.

I am thinking as in reading pots on the Analogue pins and converting that to control the cutoff values for the equalier.

If not.... anyone know of an equaliser IC that isn't looking like it's getting dropped any time soon? Can only find online solutions in DIP format that are hard to track down (E.G LMC835)

Thanks
 
Can you implement an equaliser on the audio board?

My first suggestion would be to load up the audio design tool & add a filter object for each audio band that you'd like to control. The filter should be configured in the "bandpass" mode. The primary audio input should feed each of these filters, & the output of these filters should go into a mixer object which would control the levels. On the filters, you would specify a fixed "knee frequency" for each & just adjust the "volume" level with the mixer controls. If you find that the filter widths in bandpass mode are too wide, then you could alternatively define two filters per band in series, where one would be a "highpass" which would define the left side of your desired band, and the other would be a "lowpass" which would define the right side of your desired band. You'd adjust these pairs of filters at the same time to the same level for any particular band. This would require more mixers, but would allow more narrowing of the individual bands. It is certainly allowable to route the output from one mixer (which has 4 inputs) into an input of another mixer. Just be sure that the levels into any given mixer summed together don't exceed 1.0 or you'll get clipping.

Hope that helps, & feel free to ask any other questions. There are many users on here that are very willing to help & pass along the results of their varied experiences.

Mark J Culross
KD5RXT
 
The SGTL5000 chip on the audio shield does have some limited DSP capability built in. Maybe it can meet your needs, but I wouldn't recommend high expectations.

You can achieve so much more with processing the data on Teensy 4.1. Several biquad filters and a few mixers, roughly what you can get within the SGTL5000 (but with lower resolution coefficients) takes only a tiny fraction of Teensy 4.1's CPU.
 
Thanks Paul. No harm in having a tinker!
I was actually hoping to find an 'off the shelf' SPI or I2C controlled Equaliser IC. Searched Digikey for hours reading spec sheets.
Found a few, but they were either horrifically basic and not really what I needed, or so damn complicated I would never be able to work out how to communicate with them.

I am only hobby level!
 
My reasoning for trying to find a DSP for the I2S signal outside the Teensy, is the PCB I am playing with/designing was to have the ability of being used on ESP32's as well.

However, I am sure the hard work you put into developing the SGTL5000 audio card for the Teensy is WAY outside my programming ability if I was to use it with an ESP32. Or maybe I am wrong?

I have continued my search to see if I can find a DSP... just out of interest, and I am amazed to say I can't really find one.
 
Without feeling like I am asking an inappropriate question in the Teensy forum :D

My test code for the SGTL5000 works fine with the audio module + Teensy 4.1 as expected.

With my testing to make it work with the ESP32-S3, not so much.

I have to lead it to the path where the ESP32 audio library is, otherwise it defaults to the Teensy library.

But then I get a compile error that I don't understand.

I'll just post the start of the setup code, as it doesn't get past this...

Code:
#include <driver/i2s.h>
#include "C:\Users\steve\Documents\Arduino\libraries\ESP32-audioI2S-master\src\Audio.h"              // Force it to use the ESP32 version of the audio library. Otherwise it tries to use the Teensy version
//#include "Audio.h"
#include "SD.h"
#include "FS.h"

Audio audio;

This then throws up the error 'Audio' does not name a type;
 
So it's because there are several other audio libraries that also have Audio.h in their SRC files (The Teensy library, the ESP8266 library etc). Had to delete 5 other libraries to get this to compile.
Why do they use the same names? It's infuriating. Could they have not called the elements something that fits with that particular library only? E.G. AudioESP32S3.h ?

No wonder us noobs struggle
 
It is simply the reality of many independent software development groups and a common word.

I can assure you Teensy published an audio library using Audio.h long before any of the others. It was in development since 2013, though first called "beta" in 2014. In late-2015 the 31 page tutorial and 45 minute walkthrough video was made.

I believe the first ESP32 chip was released sometime in 2016, but for quite some time most of its peripherals were undocumented as Espressif slowly released the info 1 chapter at a time. I don't know when they also started publishing a file named Audio.h, but I'm pretty sure it's more recent than 2016.
 
Well I have been playing and it's interesting.

Obviously it all works fine with the Teensy 4.1. Thank you Paul

Getting a weird clicking noise during playback if I output from and ESP32 to a PCM5102A I2S amp. Not sure what that is yet. Any ideas?
I tried a 1k on the Din line, but no difference. I have had this issue before with MP3 modules and a 1k seemed to fix that.

Now the Teensy + audio board I believe can overlay multiple tracks at the same time? If I remember rightly....

Is that mixing done in the SGTL5000 or in the code before it's sent? In the code by the looks. Hmm, how can I achieve that outside the Teeny environment!
 
Last edited:
I always pair up the 4.1 and the audio board for most of my projects.

But, I have a pile of ESP32 S3 DevkitC-1 chips sitting here left over from a cancelled project. I was looking at a way of using them with my 'stash' of I2s stuff.

I can output to the PCM5102A fine. That works well. Have not sussed out playing multiple files at once (I imagine I have to read Wavs bit by bit and re-assemble?)... project for another night.

But, no easy way to add Analogue in to the ESP32 from what I can see. Been reading datasheet's left, right and centre (PCM1808, PCM1807 etc). All a bit out of my league I suspect
 
Thanks for everyone's help. Decided to walk away from this one (which I rarely do).

To implement I2S input to my ESP32, I needed to add a CS4344 module, and that in turn required an MCLK signal to be produced by the ESP32 on GPIO0. Something after an evening of Googling I have still not managed to understand at all.

So.... know when you are beaten
 
Back
Top