[sdiy] PWM audio distortion explanation
Tom Wiltshire
tom at electricdruid.net
Tue Jun 28 18:54:12 CEST 2016
Aaah!!! Ok, thanks Eric, that's made it click for me!
The pulse width being modulated changes the relative amounts of the various harmonics that make up the pulse wave - another way of saying "changes the relative amount of a harmonic" is "amplitude modulates the harmonic". That's what I wasn't seeing.
Also the DC component is very important. It often gets ignored in analysis of pulse waves when we think about synths, but here it's vital.
Tom
On 28 Jun 2016, at 17:38, Eric Brombaugh <ebrombaugh1 at cox.net> wrote:
> Tom's right.
>
> The article does a nice job of analyzing PWM from a certain perspective but does little to lay the groundwork for taking that perspective. If you already know something about signals and systems then you can agree with the statement "At its most basic level..." but it takes some background to get to the point of agreement.
>
> FWIW: PWM can be seen as AM of carriers, but in order to do so you you have to dive into Fourier analysis. And it's not just "a carrier" but it's all the harmonics of the PWM base rate.
>
> So, by varying pulse-width you're changing the harmonic series - amplitude modulating the harmonics of the base rate. Since many forms of PWM are asymmetrical (ie the rising edge always happens in the same place and the falling edge is moved) then they're also modulating the phase of the harmonics. And therein lie the distortion mechanisms...
>
> Note that "properly done" PWM will impose a LPF at some frequency well below the base PWM cycle frequency, effectively filtering out all those higher, distorted harmonics. All that's left is the average value over the period. The trouble is that many lo-tek approaches (I'm looking at you, AVR and PIC processors!) do not have sufficient speed to allow that LPF to enclose a sufficient audio bandwidth. So they compromise and set the LPF corner near (or sometimes even above) the PWM cycle frequency and then you get more interesting things happening.
>
> Eric
>
>
> On 06/28/2016 09:13 AM, Tom Wiltshire wrote:
>> That's very interesting and right up my street, but unfortunately I don't get past the first sentence:
>>
>> "At its most basic level, PWM is amplitude modulation (AM) of a carrier frequency (the PWM frequency)."
>>
>> Why? PWM doesn't change the amplitude at all, as far as I can see. The *average* amplitude, maybe, but that's not the same thing, and it seems like a bit of a jump from this initial claim to then go "…so then this maths applies!". Does it? Why?
>>
>> Amplitude modulation of pulse trains has some other name I'm sure (oh, look! It does: http://en.wikipedia.org/wiki/Pulse-amplitude_modulation )
>>
>> The width of the pulses is what's being modulated here, not the amplitude. If they're going to convince me that those two are equivalent, I want a bit of explanation of how that works.
>>
>> Tom
>>
>>
>> On 28 Jun 2016, at 13:21, rburnett at richieburnett.co.uk wrote:
>>
>>> Stumbled upon this good explanation of why simple PWM inherently distorts audio reproduction:
>>>
>>> http://www.openmusiclabs.com/learning/digital/pwm-dac/pwm-distortion-analysis/
>>>
>>> Might make interesting reading for anyone who's used a PIC or Arduino to generate audio waveforms using PWM, and been left scratching their head for an explanation for unexpected distortion products.
>>>
>>> -Richie,
>>> _______________________________________________
>>> Synth-diy mailing list
>>> Synth-diy at dropmix.xs4all.nl
>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list