Given that it's just phase-correct PWM, you'd think feeding the bits you'd stuff into a DAC directly into the PWM counter would do the job nicely.
You could probably do that with a fast microcontroller these days. Some golden-eared audiophool pillock would complain they could hear jitter caused by the pins not being gold-plated or something, but who cares?
The good class D amplifiers are closed-loop control systems. They don’t just create a output a fixed sequence of highs and lows for a given piece of music — they determine when to switch based on some combination of the input signal, the observed output voltage and current, and various state variables (for example, for protection). And they operate at frequencies of several megahertz, possibly with rather high precision pulse widths needed.
So one could do this with an ADC, a microcontroller, and a single output bit, but it would need to run the ADC at quite high frequency and possibly have multiple input channels (for current and voltage). This sounds expensive.
A TPA3255 costs $12.50 (qty 1 from Digikey). Add a dollar or two a nice DAC. I don’t think a 20-bit ADC, a DSP running at a couple hundred MHz, and most of the same driver and power circuitry that’s already in the TPA3255 would come out at the same price.
It takes a lot of computing power to reconstruct an audio sample well. Once reconstructed it takes massive massive amounts of storage.
It's all about the Shannon Nyquist sampling theorum.
"Strictly speaking, the theorem only applies to a class of mathematical functions having a Fourier transform that is zero outside of a finite region of frequencies. Intuitively we expect that when one reduces a continuous function to a discrete sequence and interpolates back to a continuous function, the fidelity of the result depends on the density (or sample rate) of the original samples. The sampling theorem introduces the concept of a sample rate that is sufficient for perfect fidelity for the class of functions that are band-limited to a given bandwidth, such that no actual information is lost in the sampling process. It expresses the sufficient sample rate in terms of the bandwidth for the class of functions. The theorem also leads to a formula for perfectly reconstructing the original continuous-time function from the samples." [1]
But, HOLD ON: "Practical digital-to-analog converters produce neither scaled and delayed sinc functions, nor ideal Dirac pulses. Instead they produce a piecewise-constant sequence of scaled and delayed rectangular pulses (the zero-order hold), usually followed by a lowpass filter (called an "anti-imaging filter") to remove spurious high-frequency replicas (images) of the original baseband signal." [1]
In case that was too verbose.....
"sample rate that is sufficient for perfect fidelity".... "such that no actual information is lost in the sampling process"... "theorem also leads to a formula for perfectly reconstructing the original continuous-time function from the samples"
PERFECTLY!!! Zero information loss between sampling and reconstruction. Still WTFs me to this day.
So yeah, you can feed bits to a PWM. But that not music.
The thing is, if you design your input and output filter correctly then any sampled signal will be indistinguishable from the analogue source passed through the same set of lowpass filters.
It does not take a lot of computing power, but it does take a couple of opamps.
I think you misunderstand sampling theory. Sampling theory allows the sampling and recreation of ALL information, not just the 44100 samples, but datapoints in between. Sorry about the potential bad formatting, it's from a pdf.
"By contrast, the waveform reconstruction
process – digital-to-analogue conversion – is not
so simple. In an ideal world it would be achieved
by generating an impulse of appropriate amplitude
for each sampling point and passing the train of
regularly spaced impulses through an ideal low-pass
filter with its passband upper edge set to half the
sampling rate. The impulse response of such a filter
is the sinc function, so each impulse would generate
a sinc waveform of the necessary amplitude, and
the train of sinc functions would sum to recreate
the original waveform.
This is illustrated in Fig 2, which shows six
successive sinc functions of different amplitude
and their sum (the black trace). Each sinc function
contributes nothing to the summed signal amplitude
at other sampling points, but does contribute to the
waveform between the sampling points. It’s a common
misunderstanding of sampling to suppose that the
waveform between sampling points is unknowable
but that is not true – provided that the input signal
is bandlimited and sampled at least twice as fast
as its highest component frequency, as required
by the Shannon sampling process. In that case
the waveform between sampling points can be
reconstructed unambiguously.
Importantly, the wave shape depends not just on the value of nearby
samples but, ultimately, on the pattern of samples
throughout the sampled signal" [1]
You could probably do that with a fast microcontroller these days. Some golden-eared audiophool pillock would complain they could hear jitter caused by the pins not being gold-plated or something, but who cares?