Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 35 of 35

Thread: Help with Basic Audio Lib results

  1. #26
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    256
    This seems like a market opportunity.
    A clean, amplified electret mic with 0.6V bias and 1.2Vpp at its reasonable maximum.
    - 3.3V input
    - RC filters on-chip so none are needed on the breadboard.
    - form factor similar to the Adafruit offering
    - $10? (I'd buy some at that price)

    The RC circuit in the Audio Lib adc documentation is doable, but time-consuming to set up on a breadboard.
    The Audio Shield, while powerful, expands the footprint of the project and covers the breadboard side-to-side. It's overkill for a quick, clean mic input.

    Is the 0.6V bias common outside the Teensy space?
    Last edited by Davidelvig; 01-17-2017 at 01:08 PM.

  2. #27
    Member
    Join Date
    Jan 2017
    Location
    Pella, Iowa, USA
    Posts
    85
    Does seem like a great product! 3.3V to 5V input, variable gain via trim pot along with a variable bias would be good. Actually, you could have a variable max output and always have the bias at the middle. Probable makes sense to center the signal. I'll think more about that and maybe play with a circuit design.

    No, that low 0.6V bias is unusual. Typically they are at 50% of the A/D input range in order to maximize that range. I'm pretty sure that the microcomputer's A/D inputs are good for 0 to 3.3V so having the more limited range of 0 to 1.2V for the audio library seems like a design decision that is leaving a few bits on resolution on the table. Paul has a very good rationale for that decision, I'm sure!

  3. #28
    Member
    Join Date
    Jan 2017
    Location
    Pella, Iowa, USA
    Posts
    85
    Quote Originally Posted by Theremingenieur View Post
    This bias circuit will increase problems since 20% of the inevitable RF noise on the +3.3V line will be fed into the ADC input. Basically, There should be two filters for decoupling from +3.3V: One for the mic power supply as Paul wrote above, and a separate one for the bias voltage.

    Another problem might be that (as written above) the mic is pre-amplified and there is a ca. 3Vpp AC amplitude at its output with a 1.6V bias. Both are too high. The bias alone will saturate already the ADC and the AC signal will overdrive it. A simple voltage divider 18k and 10k from the Mic output would bring the bias and the AC amplitude of the mic down to an appropriate level which solves both problems at the same time.
    That microphone module is still signing with a wonky 1.2-1.5Khz signal superimposed on the output. Might be the large capacitive load creating oscillation or maybe noise creeping in on the supply (even though I can't see it with my set-up). Going to go back to the start, un-mod the microphone module and build out that original filter. More to come.

  4. #29
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    256
    Thanks, Neutronned.
    Let me know if you'd like a compatriot in this new amplified mic endeavor.

  5. #30
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,473
    Quote Originally Posted by Davidelvig View Post
    This seems like a market opportunity.
    A clean, amplified electret mic with 0.6V bias and 1.2Vpp at its reasonable maximum.
    Yes. My hope is Onehorse or Sparkfun would make such a product. Ideally, it should also have some provision for running from a battery, even if just a JST connector that mates with commonly available batteries and just connects it to VIN.

    Later this year I'm going to be putting quite a lot more work into sound-reactive LED control (and non-blocking Neopixel library), so there's going to be more need for a good quality, ready-to-use microphone board. If nobody wants to pick this up, PJRC will probably end up making one. But I'd much rather focus on Teensy and the software side.

    Quote Originally Posted by Neutronned View Post
    No, that low 0.6V bias is unusual. Typically they are at 50% of the A/D input range in order to maximize that range.
    The range is 1.2V, so this is 50%.

    In older 8 bit AVR and PIC chips, indeed 1.2V range is unusually low. But even then, some AVR offer both 2.56V and 1.1V.

    In modern 32 bit chips, 1.2V internal reference is pretty much standard. This isn't just Freescale. The STM chips and NXP's LPC chips have 1.2V internal reference. Atmel's SAMD chips (used on most of Arduino's 32 bit boards) have 1.0V internal reference.

    Paul has a very good rationale for that decision, I'm sure!
    It's a simple matter of the chip's internal reference voltage being 1.2V. The reduction in range is worthwhile for rejection of power supply noise on the reference.

    Ordinary line level audio is also approx 1Vp-p, so this matches pretty well to the commonly used consumer gear audio signals.


    Quote Originally Posted by Neutronned View Post
    That microphone module is still signing with a wonky 1.2-1.5Khz signal superimposed on the output.
    Adafruit's design leaves a lot to be desired. If I can get someone to create a board with 0.6V offset, hopefully they'll be willing to do a better design, and ideally go through a couple iterations if the first attempt isn't great.

    Click image for larger version. 

Name:	sch.jpg 
Views:	181 
Size:	59.7 KB 
ID:	9474
    (click for full size)

    This schematic has 2 paths for power supply noise to couple to the signal where a quiet signal matters most, before the amplifier gain. The mic bias at least has some attempt to filter away noise, but the 0.1 uF capacitor isn't nearly large enough. Together with 1K impedance, this put the single-pole corner frequency around 1.6 kHz, so it's only effective at filtering away noise in the top few octaves of human hearing.

    The 1M resistors are a lesser issue, only because their impedance is so high. Their noise contribution will be about 60 dB less, because the mic imedance is 1000 times lower. Still, using an extra resistor and capacitor on this path would add minimal cost, and a smaller capacitor would work fine because the resistors are higher.

    The power supply filtering could be done much better. Isolating the grounds is probably worthless and might even be harmful. This is the sort of thing that should be tested on a first prototype and iterated. Excellent analog design isn't easy and this is the sort of thing I'm not able to predict in advance.

    But it is pretty easy to predict these ferrite beads are really only effective at RF frequencies. At audio bandwidth, they're just wires. FB2 probably wants to be become something useful for audio, like 100 uH. For example, Digikey 587-2048-1-ND might be a good starting point. However, even this is on the low end, less than 1 ohm impedance in the middle of the audio band. Even something like 587-2509-1-ND isn't a lot. Adding a series resistor, like 10 ohms or even 100 ohms, would also be a good idea. At the lowest frequencies where no reasonable inductor does any good, a resistor in series will really help. To make this effective as a filter, a large decoupling capacitor would also be needed.

    Adafruit didn't use any decoupling capacitor at all, even though Maxim says one is needed. A 0.1 uF ceramic probably wants to be used in parallel with something big like 100 uF or more. This might seem excessive, but consider the most important audio frequencies are very low, just a few hundred Hz. Really good audio design would probably do much, much more, perhaps even a LDO regulator. But I believe an inductor and resistor in series and a pair of decoupling capacitors can probably be good enough.

    The other really important thing missing from Adafruit's design (and almost all others in the maker market) is low-pass filtering. Well, other than the natural response of the microphone itself. Ideally, there should be at least a 2-pole filter, which costs another opamp and more resistors and capacitors (good NP0/C0G ones). If it's just a normal Sallen-Key circuit, the corner frequency should be fairly low, perhaps 6 to 8 kHz. Yes, that attenuates some of the higher frequencies people can hear, but attenuating signal and noise above the Nyquist rate is far more important. Any higher frequencies (above Nyquist) that make it to the ADC pin become terrible aliasing noise in the audio band.

    Yes, I know this all adds up to many more parts, and some of them physically larger. My hope is the usual thought process of "can a smaller/cheaper part work" or "are so many parts needed" can give way to thinking more like "audio quality shouldn't suck, even when used in a hostile environment like a many-LED project". Onehorse, if you're reading this, any thoughts?
    Last edited by PaulStoffregen; 01-23-2017 at 09:50 PM.

  6. #31
    Member
    Join Date
    Jan 2017
    Location
    Pella, Iowa, USA
    Posts
    85
    Nice write up and all great points! I didn't realize the A/D range was only 1.2V (and didn't bother to look it up, either... sorry!) The 3.3V supply on the Teensy looks pretty quiet already and most of the IC amps seem to have great specs on supply noise rejection. I've started downloading various mic circuits and IC amps to see what's out there. I haven't looked at mic amplifiers before but worked on ECG circuits for a few years and there are lots of similarity (similar freqs, similar gain). And I have been looking for an excuse to fire up Eagle again so I'll play around with something and share it. I'm assuming I should start a new thread title "Low Noise, 0.6V offset Mic Module" or something like that.

    BTW - I like the simplicity of the Sparkfun mic amp module and have a few on order. They also only require a single resistor change to shift the bias but I'll also probably knock the gain down a tad to compensate for the lower pp range. I'll let you know how that goes.

  7. #32
    Junior Member
    Join Date
    May 2016
    Posts
    9

    Teensy 4 ADC audio library

    I landed here looking for a way to interface an electret with a teensy 4,as shown if you click on an ADC element in the audio library design tool, but I'm running into compiler errors. is the ADC element still supported by the audio library on teensy 4? Do I need to use a different pin or a different library to get data from the T4's ADC into the audio library's frequency processing functions? My application has a very limited amount of space, I don't want to add on a whole audio board.

  8. #33
    Junior Member
    Join Date
    Feb 2020
    Posts
    11

    Microphone input on Teensy 4, please?

    Quote Originally Posted by semegraph View Post
    I landed here looking for a way to interface an electret with a teensy 4,as shown if you click on an ADC element in the audio library design tool, but I'm running into compiler errors. is the ADC element still supported by the audio library on teensy 4? Do I need to use a different pin or a different library to get data from the T4's ADC into the audio library's frequency processing functions? My application has a very limited amount of space, I don't want to add on a whole audio board.
    I was considering using one of those adafruit mics, I wanted to use it for a background input for noise cancelling, using a T4.

    I was hoping I could just plug it into A3.
    Now I am baffled.

    My background is in software, which doesn't so easily lead to the blue magic smoke I dread, I can just about manage pullup resisters for i2c breakouts... Can anyone help with a simple mic solution we can just plug in?

    p.s. cannot help with the compiler errors, I haven't tried it (yet).
    RichR

    p.s. just tried with the design tool into the first design tool use : got this....
    Part_2_01_First_Design_Tool_Use:11: error: 'AudioInputAnalog' does not name a type

    Code:
    // GUItool: begin automatically generated code
    AudioInputAnalog         adc1;           //xy=86,346
    AudioInputI2S            i2s2;           //xy=94,187
    AudioMixer4              mixer3;         //xy=251,359
    AudioMixer4              mixer1;         //xy=430,244
    AudioMixer4              mixer2;         //xy=466,363
    AudioOutputI2S           i2s1;           //xy=645,246
    AudioConnection          patchCord1(adc1, 0, mixer3, 0);
    AudioConnection          patchCord2(i2s2, 0, mixer1, 0);
    AudioConnection          patchCord3(i2s2, 1, mixer2, 0);
    AudioConnection          patchCord4(mixer3, 0, mixer2, 1);
    AudioConnection          patchCord5(mixer3, 0, mixer1, 1);
    AudioConnection          patchCord6(mixer1, 0, i2s1, 0);
    AudioConnection          patchCord7(mixer2, 0, i2s1, 1);
    // GUItool: end automatically generated code
    Last edited by richrarobi; 03-11-2020 at 08:42 PM.

  9. #34
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,546
    The Teensy 4 Audio Library does not support the ADCs at the moment, but it will soon..

  10. #35
    Junior Member
    Join Date
    Feb 2020
    Posts
    11
    Thanks Frank, I forgot about that.

    Any ideas about if we would be able to adopt the adafruit Mic? Will it still have that electronics issue? That looks rather daunting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •