(no title)
povik | 3 years ago
> I wonder how they model the energy output of the speakers.
Simple. The speaker codecs (special made for Apple, but e.g. compatible to https://www.ti.com/product/TAS2764) give you current/voltage measurements you can calculate the power from. It's what they call I/V sense.
> In principle you could have a function that calculates the energy of the spectrum and integrate that over time.
Right. You don't want to do the calculation in frequency domain since that would be wasteful. You can integrate the power of the samples straight away (here by multiplying the instantaneous voltage and current, if we didn't have that, we could at least estimate it by assuming a constant resistance of the speaker coils).
> If you put out too much energy, what do you do? Reduce the overall volume, apply a frequency cutoff, or a low-pass-filter?
You model the coil's temperature. If it comes near a dangerous level, you reduce the volume on the particular speaker. You don't need to worry too much about this since usually you don't hit the limits, you are merely guarding against especially nasty sound input.
> I feel there are so many variables here, and it is going to be hard to replicate what Apple does.
We don't need to replicate what Apple does. Though we are stealing the parameters for the coil temperature model Apple is using (at least for some machines).
captainmuon|3 years ago