# Independently toggling two series switches to multiply two pwm signals

Preface

It is known that one can synthesize a signal into a train of boxcar pulses (pwm modulation), each with the same amplitude, if proper low pass filtration is applied to this pulse train before it reaches the load.

Now consider the synthesis of the product of two signals. I have found with some rudimentary matlab simulation (see below) that the average* of the multiplication of two pwm modulated constant** values is equal to the value of the multiplication of two constant signals

*I use the average because it is equivalent to passing only signal at frequency equals zero which is a low pass operation.

**Non constant values are constant across small time intervals so turn up both carrier frequencies and you're golden.

    %pwm test

%domain
n = 5e6;
t = linspace(0,1/2,n); %time

%sawtooth carriers
%Frequencies f1 and f2 should be much different in
%magnitude relative to eachother i.e. f1 >> f2 or f2 >> f1. Here I use
%the case of f2 >> f1.
f1 = 1e3;
f2 = 1e5;
st1 = sawtooth(2*pi*f1*t)';
st2 = sawtooth(2*pi*f2*t)';

%constant values
constant_11 = -1/2*ones(n,1);
constant_12 = 1/2*ones(n,1);

%pwm modulation
pwm1 = sign(st1 - constant_11);
pwm2 = sign(st2 - constant_12);

%multiply
pwm12 = pwm1.*pwm2;
av_pwm12 = mean(pwm12)*ones(size(pwm12));
actual12 = constant_11.*constant_12;

%visualize
plot(actual12),hold on,plot(av_pwm12),hold off


Multiplying the two pwm modulated signals in code like I have shown is like independently toggling two series switches mutually in series with the load i.e. the load only receives current when the state of both switches are closed.

Question

If no one finds an issue with what I have said in the preface, I'd like to ask if there has been any studies done on this type of signal multiplication. If so, could you direct me to information about such study or studies?

I have tried to locate information on this topic but can't seem to dig anything up. Perhaps I am lacking the correct keyword that has been assigned to what I am looking for...Anyway, any help on this would be much appreciated. Thanks in advance.

• If you multiply the numerical duty cycles before geenerating a PWM signal from them you get the desired result too. Apr 24, 2016 at 8:40
• Yes, you're right, but I'm interested in the two switch setup. Apr 24, 2016 at 12:17

It is known that one can synthesize a signal into a train of boxcar pulses, each with the same amplitude, if proper low pass filtration is applied to this pulse train before it reaches the load a.k.a pwm modulation.

If you low-pass filter it it's no longer PWM - it's an analog signal.

Now consider the synthesis of the product of two signals. I have found with some rudimentary matlab simulation (see below) that the average* of the multiplication of two pwm modulated constant** values is equal to the value of the multiplication of two constant signals

You've got to be careful here. simulate this circuit – Schematic created using CircuitLab

Figure 1. Multiplying these two PWM signals (in an AND fashion) gives zero output. simulate this circuit

Figure 2. If one frequency is a high multiple of the other the scheme could work. simulate this circuit

Figure 3. A mixed analog-digital multiplier might also satisfy your requirements. A is an analog signal (which may have been generated by a PWM source). B could be digital or analog.

There was a digital piano chip available in the 1980s (used by Maplin and Elektor in their digital pianos) that generated an RC decay curve every time a note was triggered. This was toggled by the digital tone generator pulse trains to give a pulse train of decaying square-waves. (These were then filtered to take out the very high harmonics.) The square waves gave only odd harmonics. I livened mine up by adding in the octave above each note using 60 diode OR gates - one for each key. It helped.

• good call on the mistake I made on the definition of pwm modulation. I'll edit it now. Apr 23, 2016 at 22:51
• Ok, thanks. Fixed that too. Your answer will mostly stand on its own. The bits about word errors will only be made redundant if no one reads these comments. Apr 23, 2016 at 22:57
• Comment deleted. ;^) I added in a note about digital pianos. The method of tone generation mixed with decay curve seems relevant to your question. Apr 23, 2016 at 23:04