Pulse Width Modulation (PWM) modules, which produce basically digital waveforms, can be used as cheap Digital-to-Analog (D/A) converters only a few external components.
A wide variety of microcontroller applications exist that need analog output but do not require high resolution D/A converters.
Conversion of PWM waveforms to analog signals involves the use of analog low-pass filters
In a typical PWM signal, the base frequency is fixed, but the pulse width is a variable. The pulse width is directly proportional to the amplitude of the original unmodulated signal. In other words, in a PWM signal, the frequency of the waveform is a constant while the duty cycle varies (from 0% to 100%) according to the amplitude of the original signal.
for calculating the low-pass filter, you first must know the bandwidth of the signal to be reconstructed.
And the bandwidth can be calculated frequency PWM for our application, clearly applying a multiplier K factor, while K >> 1, the resolution of the signal is greatly improved, but also must consider the resolution of the PWM Dutty.
PWM frequency with already established, it can proceed to design the low-pass filter, with the following equation.
must be added to the output of OPAMP pass filter to provide a low impedance and good power delivery to the application.
Cardiac result signal generated by the PWM
NOTA: As can be seen the signal has a significant quality reconstructed, but has a curl, these are achieved by increasing the degree of eliminating pass filter
|Heart Singal mode duty cycle|
|Code / C++:|
Video Cardiac emulator