Some questions:
Do a majority of today's sound reinforcement power amplifiers have digital audio inputs?
For flying modular main speaker arrays: Are the power amplifiers sometimes embedded inside the speaker cabinets?
Does the signal chain ever need to be analog at all?
Starting with the second question: Yes. They're called "powered speakers" or "active speakers", and they're been around for a long time now.
Originally, it was just a comparable-sized amp shoved into the same cabinet with everything else the same. Single amp channel driving a passive crossover, and it would blow tweeters just as well as a passive rig if you turned it way up and walked away. One venue that I worked at had a set of those, and a guy that was very good at replacing the tweeters! I was part of upgrading that rig to digital, with the requirement that "just anybody" should still be able to use it, so I put a "postage stamp" of an analog board in there for them, which fed into the main digital one that had limiters on that feed! The controls for the digital were kept in a locked closet, to be brought out and used only by the more skilled people, who load the defaults back in when they're done.
Now though, the line-level input feeds an ADC into a DSP with only a handful of user-accessible settings, and that DSP drives a dedicated amp channel for each driver. This allows per-driver correction and protection, and relaxes some of the acoustic design requirements, as the things that are easily corrected electronically don't have to be accounted for anymore when building the box. So the acoustic design can focus only on what the electronics still can't do very well, and the combination produces the most accurate box possible in terms of converting a small electrical signal into far-field air pressure. (within the constraints, of course, that a mass market puts on the overall architecture - the classic over/under woofer/tweeter box is not all that good, but it's what people are used to and therefore want)
Most powered speakers (that are sold to the general public) also have multiple inputs, with XLR/TRS combo jacks and a mic preamp for at least one of them. If you only have a single mic, then you don't even need a mixer: just plug the mic directly into the powered speaker and use the mic/line switch to turn the preamp on. (I have yet to see one with phantom power, so dynamic mics only)
For the first question, some amps do have digital inputs, even networking (
Dante, for one example), so that the only analog in the system at all might be the mics and the amps' power stages (Class-D is still very much analog, despite the on/off output devices), but pretty much all of them still have analog inputs available. The ones that have DSP built-in have an ADC following the attenuator; otherwise it feeds into the amp itself as usual, even for Class-D.
For the third question, analog is a very effective and easy way to resample. Have a DAC feed an ADC, with each controlled by a different system with its own clock, and it "just works". Digital resampling can be enough of a hassle to just hang the whole thing and do that instead. If one system wants to change its sample rate, then it can tell its converter to do that, and the other doesn't have to know or care. So in otherwise all-digital rigs, there may still be some analog links in a few places. DAC's to amps, for one example.
Of course, *anything* in the analog world is subject to the analog rules, including headroom and noise pickup, so it still has to be done *right*.
I understand the desire for maintaining 24-bit resolution past the master volume control when a considerable amount of digital audio processing must happen after the master volume. Examples of such "downstream" digital processing:
-Digital crossover frequency low//high pass filters for the speaker cabinets
(subwoofer-mains, additionally low-mid-high crossover filters for the main speakers if bi-amped or tri-amped)
-Anti-clipping limiter functions
-Thermal protection for high frequency drivers (using a simulation of their long-term power handling limits)
-Adjustable time-alignment delay (10 or 100usec steps), especially for the relationship between mid/high frequency drivers.
Yes to all of the above, except that the thermal protection could easily be measured instead of simulated. Just put a thermal probe in there, connected to the DSP logic...
And for that matter, I've also seen accelerometers on the speaker cone...
To summarize:
OP application probably does require >16-bit resolution
That said, for early prototyping/experimentation/testing, the PJRC 16-bit audio library might still be a useful "starting point." It already contains ready-to-use function blocks for much of what is required to make a high grade sound reinforcement system.
Pretty much, yes. Though I've done enough research with the idea of rolling my own, that I think I'm ready to just do that instead of learning a library (even if it barely takes anything to learn) and then ditching it because I need more.
https://dspguru.com/https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.htmlhttps://www.musicdsp.org/en/latest/Filters/64-biquad-c-code.htmlhttps://www.musicdsp.org/en/latest/Analysis/186-frequency-response-from-biquad-coefficients.html (to read back what it's actually doing)
https://www.earlevel.com/main/2012/11/26/biquad-c-source-code/https://www.earlevel.com/main/2003/03/02/the-digital-state-variable-filter/Etc.
That's just for frequency filters. Similar for dynamics and other things.
And I've done enough live sound that I know what the "black box" modules do anyway. No need to learn that; just how to make them in software. Or find a suitably-licensed library that is also suitable for my end use.
Human hearing is logarithmic rather than linear.
Sorta. Perceived amplitude is logarithmic, which is probably what you're referring to. But the process itself is quite the exercise in Linear Systems. It's not a single microphone per ear, but a series of acoustic bandpasses followed by peak detecting nerves. A "biological RTA", if you will. Before all of that is an acoustic/mechanical gain element (with a non-flat frequency response if you pay attention) that is controlled by the average of that RTA. A "feedback compressor". Older ears lose the ability to gain-down, which is probably why they complain more about volume. It really IS louder for them, and painful, and at risk of losing more sensitivity, while the young kid next to them is perfectly fine. (if your grandpa took you to a concert, he probably sacrificed more than you realized to make your day)
Also, because of that system architecture, the risk of pain and hearing loss depends on the mix and is not a single number. A narrow, prominent range of frequencies, like a screaming guitar amp that shoots past the musician's knees and drills a hole in the back wall, leaves the RTA-average low enough to not activate your compressor, and so that range gets blasted even with young and healthy ears. But if you turn UP the rest of the band to match (mix it well), then the average is high enough to make the compressor work, and then it's fine.
So it's important to have a FOH Engineer that knows what he's doing, on a rig that covers well, and keep the stage as quiet as possible. No "acoustic spotlights" coming directly off the stage. There are ways to do that without killing the "perfect" guitar sound: USE THEM!!! A speaker-level DI, for one example, with a dummy load in place of the speaker, and the Monitor Engineer feeds a healthy amount of that back to the guitarist's floor wedge or IEM. (In-Ear Monitor; basically glorified ear-buds)
(About that dummy load: Never run a tube/valve amp open-circuit. It'll saturate the output transformer, which then becomes a short-circuit to the amp itself. They tend to blow up when you do that. Always have some kind of a load attached whenever it's powered on, that matches its rated impedance. Likewise for a solid-state amp with a transformer output, though the relative cheapness of transistors means that it *might* (!) actually have enough additional circuitry to protect itself. Still won't sound the same though, without enough load to keep the protection from activating. Solid-state with no transformer is fine to run open.)
(Also, for smaller gigs, FOH and ME are probably the same guy, but a fair number of rigs are starting to have musician-controlled monitors now, either from a personal mixer that receives multitrack from the FOH board or a phone/tablet app that directly controls their output of the board.)
In the very first days of digital audio, well before ADC or DAC devices had >12 bits, there was a remarkable yet simple hardware design called “continuously variable delta slope modulation” which sampled the analog audio at a very high rate (>50kHz), producing a single bit signifying whether the input voltage was rising or falling. Delay was generated by sending this stream of single bits through a bank of early dynamic RAM chips, often 1b by 16k, 64k, 256k memory cells per chip. The analog signal was recovered by a simple opamp integrator. I remember being quite impressed with the audio quality. It wasn’t noisy or grainy. It even measured well: THD+noise <0.5%
To summarize, a lot can be accomplished in the digital audio domain by having a thorough understanding of the underlying math. Forcing more bits through the hardware is also an effective brute-force approach. But it isn’t the only method which works.
With such low bit depth, you'd need a lot higher sample rate than that to produce decent quality. (50MHz, maybe, not kHz) But that's still the basic principle behind a modern audio ADC: sample in the low- to mid-MHz range, run a high-order digital lowpass at that rate with a corner frequency below Nyquist for the final output rate, and then pick samples out at that final rate to send to the world. The high initial sample rate and digital lowpass mean that the analog anti-aliasing filter doesn't have to be anything special - its Nyquist target is in the MHz range - and the effective averaging of high-frequency noise fills in the lower bits of what would otherwise be a crummy converter.
That's also the (very) basic concept of a digital resampler: stuff a bunch of zeros between input samples to make a much higher sample rate, lowpass that at the high rate with a suitable corner frequency for Nyquist at the output rate, and pick samples out at the new rate. Of course, there are TONS of optimizations that are mathematically equivalent to that, but don't require nearly as much processing power. For example, if you're using a Finite Impulse Response (convolution) lowpass, then each output sample is calculated independently, and so you only have to run the filter at the output rate, not the high intermediate one. If you're using an Infinite Impulse Response (more like analog behavior), then every output sample depends on everything, so you do have to do ALL the work. But IIR requires much less effort per sample than FIR, so without optimized hardware for either one, I'm not really sure which is "better".
Something else that I find fascinating to consider, is the idea that the universe is inherently digital because quantum. That allows me to compare the translation between different digital systems, with the translation between digital and analog. In that context, it's almost the same thing: convert to stupidly-high quality, then back down to what you want to end up with. The universe is simply that high-quality digital...except for the unavoidable noise that completely drowns out that amount of detail.
You know, I never expected to have an intense discussion of high-performance audio signal processing in a forum dedicated to microcontrollers...
My, my, how things have changed over time...
I find myself comparing the RT1062 to an earlier Raspberry Pi. I would not be surprised if someone got a Linux kernel to run on a Teensy 4.x. So what's a microcontroller? And what's a desktop PC? Is there much of a difference anymore?
I also think about the early days of computing: entire rooms, eventually shrinking to something that would (barely) fit on a desk, with an amount of processing power that we solidly associate with 10-year-old microcontrollers today. Those were the pioneers of today's desktop systems, so could such a "desktop" system be built on one of our 10-year-old microcontrollers? (my guess is yes, with some caveats)