Eli5: So apparently Arduino Uno cannot output analog signals and so it uses pulse width modulation to mimic an analog signal output. So then, how can a square wave with varrying width mimic an analog signal’s sine wave?

285 views

Eli5: So apparently Arduino Uno cannot output analog signals and so it uses pulse width modulation to mimic an analog signal output. So then, how can a square wave with varrying width mimic an analog signal’s sine wave?

In: 34

18 Answers

Anonymous 0 Comments

The pulse is much higher frequency than the sine it represents. At the top of the sine wave, long top pulses and short bottom pulses. In the middle of the sine, equal length tops and bottoms of the pulse. At the bottom of the sine, long bottoms on the pulse and short tops. If you apply a little low-pass filter to smooth it out, it becomes a sine!

Anonymous 0 Comments

The pulse is much higher frequency than the sine it represents. At the top of the sine wave, long top pulses and short bottom pulses. In the middle of the sine, equal length tops and bottoms of the pulse. At the bottom of the sine, long bottoms on the pulse and short tops. If you apply a little low-pass filter to smooth it out, it becomes a sine!

Anonymous 0 Comments

Wat??? I’m too smooth brain to understand the title *microwaved brain noises*

Anonymous 0 Comments

Wat??? I’m too smooth brain to understand the title *microwaved brain noises*

Anonymous 0 Comments

A Pulse Width Modulation (PWM) signal has 2 properties: Frequency of the pulses and the Duty Cycle. The duty cycle is the ratio between *on*-time and *off*-time of the signal.

A duty cycle of 100% means always on, 0% means always off, 50% means half of the time on/off, 25% means 25% on, etc…

Although this is technically not an anlog signal, the average voltage will correspond more or less with the duty cycle. (Where 100% is often 5V or 3,3V, depending on the hardware.)

A sinewave can be represented by changing the duty cycle over time; from 0% to 100% and back to 0%. in each period.
And additional circuit is used (with an opamp) to offset the voltage so 50% duty cycle corresponds with 0 for the sinewave. This means 100% will be the top of the wave and 0% is the bottom of the wave.

In order to create an accurate sine wave, the frequency of the PWM signal must be high enough, you must be able to change the duty cycle fast enough, and the pulsed output should be converted into a true analog signal. (By using a filter.)

Anonymous 0 Comments

A Pulse Width Modulation (PWM) signal has 2 properties: Frequency of the pulses and the Duty Cycle. The duty cycle is the ratio between *on*-time and *off*-time of the signal.

A duty cycle of 100% means always on, 0% means always off, 50% means half of the time on/off, 25% means 25% on, etc…

Although this is technically not an anlog signal, the average voltage will correspond more or less with the duty cycle. (Where 100% is often 5V or 3,3V, depending on the hardware.)

A sinewave can be represented by changing the duty cycle over time; from 0% to 100% and back to 0%. in each period.
And additional circuit is used (with an opamp) to offset the voltage so 50% duty cycle corresponds with 0 for the sinewave. This means 100% will be the top of the wave and 0% is the bottom of the wave.

In order to create an accurate sine wave, the frequency of the PWM signal must be high enough, you must be able to change the duty cycle fast enough, and the pulsed output should be converted into a true analog signal. (By using a filter.)

Anonymous 0 Comments

It’s all about frequency response and filtering.

The scheme you describe is called “pulse width modulation”, and it works how you describe. For a given time period, the signal is pulsed on and off so the average amount of time that it is on is equal to the output value that you want.

Now you need a filter – specifically a low-pass filter. For dimming LEDs, our eyes do it – we interpret the PWM signal as the average value.

In other cases, it is done electronically.

There’s a very popular class of audio amplifier known as “class D” that uses this technique, and it makes light and powerful amplifiers.

Note that there are also a wide range of digital to analog converters that produce true analog output.

Anonymous 0 Comments

It’s all about frequency response and filtering.

The scheme you describe is called “pulse width modulation”, and it works how you describe. For a given time period, the signal is pulsed on and off so the average amount of time that it is on is equal to the output value that you want.

Now you need a filter – specifically a low-pass filter. For dimming LEDs, our eyes do it – we interpret the PWM signal as the average value.

In other cases, it is done electronically.

There’s a very popular class of audio amplifier known as “class D” that uses this technique, and it makes light and powerful amplifiers.

Note that there are also a wide range of digital to analog converters that produce true analog output.