Teensy 4.0 Audio Shield - Line In Microphones

Hi Alfred0, sorry to take into the thread,i'm experimenting the use of a cardioid microphone
at one of the 3 inputs of a cs42448 codec board ,ihave a good result with an amp.gain(5.0f)
wired to a mixer.gain(1,3.0),it's a prodipe TT1 mic.
the only trouble is a hum sound but low,surely a lack of impedance adaptation.
 
Hi Alfred0, sorry to take into the thread,i'm experimenting the use of a cardioid microphone
at one of the 3 inputs of a cs42448 codec board ,ihave a good result with an amp.gain(5.0f)
wired to a mixer.gain(1,3.0),it's a prodipe TT1 mic.
the only trouble is a hum sound but low,surely a lack of impedance adaptation.
Hi AntiLoop, no problem with the thread, is here for learning 😊

I can´t remember properly, but I'm pretty sure that cardioid microphones mostly are dynamic microphones, they use electromagnetism to generate electric pulses that represent the sound that the membrane, which is connected to a magnet, captures, while condenser microphones needs additional power, know as phantom power, so in fact, cardioid microphones should have less problems to be use without any external power or amplifier, and that's why it should be working for you turning up the gain.

At least, that's my theory, also I don't know how cs42448 board works exactly, I suppose that is similar and the ports are line in/out, maybe it has some extra capabilities.

I'm talking from my limited knowledge in sound matter, one of the purposes behind this project was my self-growth in the audio field, trying to understand more deeply some concepts, so take what I said with a grain of salt. What I know is that if you can use an amplifier for your microphone, always is better ahahaha.

For now I'll try to pre-calculate the coefficients of my FIR filter and avoid the use of microphones doing a fixed system, maybe later in the future I'll fight a little bit more with the code and use the information that is being provided here to make it 100% active, but yes, the use of that kind of microphones could be a good trick to avoid external amplifiers.
 
The sensitivity pattern of a microphone is due the the mechanical design mainly. Some condener mics are actually two diaphragms back-to-back that can be switch-selected to add or cancel to provide several different patterns.
 
maybe you can take a look at those systems fitted in comfort headphones or earphones,to eliminate
all noises coming from outside,they certainly use dedicated microphones with a dephasing algorythm
 
maybe you can take a look at those systems fitted in comfort headphones or earphones,to eliminate
all noises coming from outside,they certainly use dedicated microphones with a dephasing algorythm
Yes, the concept is the same, I've testing with some precalculated coefficients in MatLab using FX-LMS algorithm and seems kind of working, is not clear.

Due to the deadline I had, I can't do more now, so the new deadline is for January, I'll check the library trick that Paul mention previously and see if is possible to make some analysis block capable of doing the FX-LMS efficiently so the system becomes active like those headphones.

I think that could be pretty useful even for other purposes, like making a filter for your inputs to denoise mics, because you can use samples of the noise, so they could be load in a microSD and you can select which type you want to apply.

I really think Teensy board is capable of doing a lot.

When I get better samples from my tests with the actual system I'll share some recording of the results, is really surprising how well it works when it works.
 
Hello, so, just an update, the system is not working as intended yet, but I'm discovering some interesting things.

First of all, I want to know if there's something that I should have in mind when assembling the teensy and audio boards because when I've been testing with the oscilloscope the audio output, I've encounter a frequency at 50Hz, so it's the power grid, and this was confirm after I connected the Teensy to a power bank and the noise disappeared completely.

But also, if I use a laptop connected to the grid, the noise is back so that have me thinking, are all jack ports not isolated from this in every device? Because I don't know at this point if is something natural related to the electronics or I should have more care soldering everything.

This is more for curiosity than necessity, I just want to understand a little more about this; I think isn't relevant for my purposes but you always don't really know .

Right now I'm still testing with some pre-calculated coefficients from MatLab and a fixed physical setup of speakers, and if it works then I'll try to inspect the library and check if is possible to make the system work in real time just as Paul suggested.

Thank you for your time.
 
Does the laptop power supply have an earth connection?
Yes, my form teacher doesn't understand also how is happening, because using a standard PC also introduce noise, and the PC is grounded too, it uses typical clover shaped plug, and the laboratory is grounded, so, yes, pretty strange how we're getting noise XD
 
Mains hum is always a problem with low level audio signals - stray mains voltage in the air is at a suprizingly high level, 20V or more isn't unknown. This means the screen for the microphone cable needs to be solid braid for best results. Also using twin-core plus screen cable is typical, with the microphone signal on the core wires (signal and return), and the screen separately connected to ground - the screen shields the core wires from mains signals, and any noise currents in it don't pollute the microphone signal or signal ground. Using simple coax means noise currents on the screen corrupt the microphone signal.

Can you provide a wiring diagram for your current setup ?
 
Hi,alfred,do you still use the mic you posted the photo before?,i think it is bounded to be used with an headphone on a pc,
it has 3 wires plus the ground ,and the pc dispatches the signals,it is good for video conference,but i don't think it is reactive enough
for your noise cancelling.
i just bought one of this,very cheap but i never succeed to get some sound on my TDM line input,i'd better cut the wires
and keep the essential from the mic.
 
I would like to start with my sincere apologies, I have no excuse or shame, you have been super kind to me and I didn't get to respond despite continuing to work on the project intensely.

Mains hum is always a problem with low level audio signals - stray mains voltage in the air is at a suprizingly high level, 20V or more isn't unknown. This means the screen for the microphone cable needs to be solid braid for best results. Also using twin-core plus screen cable is typical, with the microphone signal on the core wires (signal and return), and the screen separately connected to ground - the screen shields the core wires from mains signals, and any noise currents in it don't pollute the microphone signal or signal ground. Using simple coax means noise currents on the screen corrupt the microphone signal.

Can you provide a wiring diagram for your current setup ?

Also MarkT, yes, I did this simply and almost nonsense scheme after reading your post to have a visual representation, but I think you want to know a little bit more than this:
Esquema de conexiones Teensy ANC-1.jpg


Also, for AntiLoop question
do you still use the mic you posted the photo before?
Yes, I've been using this mic for all the tests, and I've to say that It worked fine with the PC, you're right with the fact that in any line in input by themselves doesn't work as expected, but from the PC, they work pretty fine.

The main issue is the "calibration" for them, or the sound curve applied, looks like is designed to be the best they can for the human voice range and in the rest of the frequencies, well, good luck, sometimes is fine, sometimes is trash.

I made a test playing some sine tones at different frequencies to evaluate the capabilities for medium and low, just because I can't start making tests for the thesis without knowing the limitations of the hardware, and is quite interesting.

Analisis microfono.jpg


As you can see, between 400 Hz and 700 Hz there's a performance problem, the microphone is "deaf", specially at 600 hz, so I had to avoid those frequencies.

And also, for this:

Is a great option too, the idea behind project is to illustrate that it is possible to build a functional system with easily accessible elements, such as that microphone or the one I use, and even the issues are relevant to show the importance of using the right transducers to obtain the desired performance.

Also, the device affects to the quality of the system, because I tested some situations where the system works better than it feels to the ear, and some other situations where is the opposite, and that's a little bit (I assume) because as humans, and as the previous test shows, microphones have their own subjective sound signature, so some are more sensible than other to certain frequencies, and also more sensible than our ears.

So just for the end, the "subsytem" works, I have had results really impressive, about 10 dB attenuation when I tested at 300 Hz, but is working with a pretty basic setup, where the Teensy is more like a simple FIR filter in the process, because the calculation of the coefficients is previously done in MatLab on a computer.

I think that should be possible to do hard work to implement something similar just as an option, like all the different blocks in the Audio System Design Tool, just you have to add like one "X" for the noise sample, one "Primary" for the raw noise source from the point where we want to cancel it, and also a "X1" and "Secondary" for the calibration of the control audio source and the sample to calculate its transfer function.

Right now I'm using a simple FX-LMS algorithm which is from a laboratory exercise in one of my university's master's degree programs, so is really basic and academic, and I think it can be polished a lot more and give a new use to the Teensy.

I want to thank all of you for your help and patience, you helped me a lot to understand some vital things in order to get the work on track in the direction I wanted and to simplify other procedures that would have made my trials much more complicated.

If you have any more questions about the project, or curiosity, do not hesitate to ask me, this time I promise to answer much sooner, it has been a complicated few months for several factors, and I do not like the feeling of ghosting with which I left you.

Thank you very much again, my best regards and good wishes to all of you in this year 2025.
 
That microphone response graph is the inverse of what I would expect to see. The notches are also strange, unless the microphone is faulty. Even then, it is not going to be doing much at VLF! I have a suspicion that you are still trying to input raw signals and that is why the response looks like that. Are you using proper microphone pre-amps now? The response curve should be flat (ish) from around 40Hz to around 20KHz.

As an aside, if you are using long lengths of mic cable, it can be advantageous noise wise, to leave the gain high and attenuate it to spec. at its destination.
 
That microphone response graph is the inverse of what I would expect to see. The notches are also strange, unless the microphone is faulty. Even then, it is not going to be doing much at VLF!
Oh not really, I just exposed it to 100Hz, 200Hz, ... , 800 Hz, that's why you see the notches, and I didn't test over 800Hz because the idea isn't to control audio over that.

I make some tests between 1000Hz and 5000Hz and in 4000Hz it has an excellent response; that's not a frequency response curve at all like the ones you can find looking for headphones or microphones in the documentation, is more a rude test to check if there was some frequency out for this microphone.

If you now the appropriate way to measure the frequency response curve for this I could try to see how bad it actually is.
 
You need to forget digital for a moment and go back to principles. Noise cancellation is done wideband, not at spot frequencies, except for individual cases.

Present for one channel, a line level "clean" signal and one from the "dirty" signal and sum them. The difference is the "dirt". Invert it and feed it back into the "dirty" signal to cancel it.
 
Back
Top