Entire Forum This board This topic Members Entire Site
 Welcome, Guest. Please login or register.Did you miss your activation email? May 05, 2021, 11:25:56 23:25 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length
 Pages: [1]
 Author Topic: How to simulate four-quadrant multiplier in Simulink/Matlab  (Read 2276 times) 0 Members and 1 Guest are viewing this topic.
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « on: February 25, 2017, 11:52:50 11:52 »

Out of curiosity I borrowed arbitrary waveform generator (Rigol DG5072) from a friend to do a few simple experiments on the effects of complex signals on the growth of house plants saplings.

My plan was to generate signals in the Proteus, export data and use it with the AWG.
No problem there. I used four-quadrant multiplier as I did before in hardware (the simple example is in the picture).

However, the Proteus format is entirely different from anything usable by Rigol or Rigol UltraStation.

My next idea was to use Simulink to generate the same signal and export it in more appropriate format.

I only once or twice in the past used Simulink for AM modulation (Product block).
I was surprised when I now found out that there is no four-quadrant multiplier available in Simulink.
The search of the internet didn't yield any meaningful solution for the problem.

So, I wonder if some of you perhaps have some practical ideas how to simulate four-quadrant multipliers in Simulink?
 « Last Edit: March 01, 2017, 09:54:58 21:54 by LithiumOverdosE » Logged
optikon
Cracking Team
Hero Member

Offline

Posts: 802

Thank You
-Given: 955
-Receive: 1947

 « Reply #1 on: February 25, 2017, 12:11:28 12:11 »

The simple "product" block in "math operations" set can work for you? Surely it works 4 quadrant and you can setup any number of inputs Maybe they moved into math operations since last time you saw it.

 Logged

I can explain this to you. I can't comprehend it for you.
Sideshow Bob
Cracking Team
Hero Member

Offline

Posts: 784

Thank You
-Given: 209
-Receive: 762

 « Reply #2 on: February 25, 2017, 02:06:31 14:06 »

I agree a four-quadrant multiplier is equivalent of the product of two signals (x*y). Use the product function https://se.mathworks.com/help/simulink/math-operations.html
 Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « Reply #3 on: February 25, 2017, 10:13:31 22:13 »

Thank you for replies.

I am trying to use Product block. However, what bothers me is the behaviour of the "ideal four quadrant multiplier" model in Proteus.
The model in Proteus transfer function is V(A)*V(B) and it provides two differently signed outputs - positive and negative.
So, in essence I would like to change the amplitude of both message and carrier at the same time.
Connecting the minus signed output to the carrier input changes it's amplitude.

However, I have trouble achieving the same result in Simulink - take a look at the screenshot.

I have preciously little experience with four-quadrant multipliers so any suggestion is welcome.

 Logged
Sideshow Bob
Cracking Team
Hero Member

Offline

Posts: 784

Thank You
-Given: 209
-Receive: 762

 « Reply #4 on: February 27, 2017, 12:41:19 12:41 »

I have worked with phase-sensitive detectors or synchronous demodulation in Labview. And as mixer or multiplier. I have just used a product functions sample by sample. This will be equivalent an ideal analig mixer/modulator
 Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « Reply #5 on: February 27, 2017, 03:14:44 15:14 »

I have never used LabView but I suppose that in many ways it operates as Simulink.

The way I understand what is happening is that Proteus may function a bit different.
My attempts in Simulink are aimed to produce the same results.

So, I took the output of the first multiplication block (Produce) and inverted it by -1 multiplication in the second multiplication block.
Sum block is suppose to add two signals and use them as second input to the first multiplication block.

That is where things become strange because it seems that by different amplitude relationship of the signal sources I get different results than in Proteus.
However, no matter what I tried I cannot get the result as in Proteus and I suspect it has something to do with the addition (Sum block).
There is a few examples in the pictures - I named the sources by their parameters.

That said, if existing Simunlink blocks can be used the same way as in LabView could you please elaborate on your idea?
 Logged
Sideshow Bob
Cracking Team
Hero Member

Offline

Posts: 784

Thank You
-Given: 209
-Receive: 762

 « Reply #6 on: February 27, 2017, 07:27:48 19:27 »

I have never used simulink so I will not be able to help much. From what I can see it looks like you have made/drawn a system with positive feedback. Is this what you want? Perhaps you should say some words about what you want to do. It may help
 Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
optikon
Cracking Team
Hero Member

Offline

Posts: 802

Thank You
-Given: 955
-Receive: 1947

 « Reply #7 on: February 27, 2017, 11:36:03 23:36 »

I agree with sideshow bobs comments.. you have a feedback system with a mixing and summation of various sinusoids.. that is of course very non-linear and complicated enough to not be obviously right or wrong by just glancing at your scope outputs.

Is it possible that the results are actually correct from the Simulink model? Proteus on the other hand might be having trouble with convergence? Maybe all the simulators are having trouble.

You might be able to convert this system to frequency domain and then take your results back to time domain by way of inverse fourier transform?

 « Last Edit: February 27, 2017, 11:38:27 23:38 by optikon » Logged

I can explain this to you. I can't comprehend it for you.
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « Reply #8 on: February 28, 2017, 06:16:04 18:16 »

Thank you for the ideas.

Let me try to simplify the problem in very crude terms for the sake of better explaining the concept.

When using four quadrant multiplier in Proteus as "normal" AM modulator the resultant signal amplitude is twice the added amplitudes of higher frequency and lower frequency signals.
The resulting signal also swings into both positive and negative values.

However, what I want to achieve is the resulting signal with the amplitude of the higher frequency signal following the amplitude of the lower frequency signal.
The modulation is achieved by continuously changing the resulting wave amplitude by using the lower frequency sine signal.
The resulting signal swings alternately into only positive or negative values.

Now, it seems that the Proteus model easily allows for such modification and I don't see any obvious reason why it couldn't be realised in hardware.
That said, currently it is for me simpler to use AWG to output the desired signal into the output amplifier and try it out in practice to see if it's even worth getting into the hardware design.

My attempts from previous posts are based primarily on trying to emulate the behaviour of the Proteus four quadrant multiplier model.

Achieving the normal AM modulation in Simulink makes it obvious that it is suitable for such task.
However, I have preciously little experience with math programs and simulators and why I need some help with it.

I hope that I managed to explain what I have to achieve in Simulink.
 « Last Edit: February 28, 2017, 08:01:42 20:01 by LithiumOverdosE » Logged
optikon
Cracking Team
Hero Member

Offline

Posts: 802

Thank You
-Given: 955
-Receive: 1947

 « Reply #9 on: February 28, 2017, 10:26:16 22:26 »

Thank you for the ideas.

However, what I want to achieve is the resulting signal with the amplitude of the higher frequency signal following the amplitude of the lower frequency signal.
The modulation is achieved by continuously changing the resulting wave amplitude by using the lower frequency sine signal.
The resulting signal swings alternately into only positive or negative values.

Seems you have this part working correctly from your previous post (normal AM).  I dont use proteus, but is it correct that the "-" terminal should be tied to your sinusoidal input?  I would have guessed that it is the reference of the source (in this case the multiplied output) And the 2 sinusoidal inputs are on the two terminals on the left of the source symbol. ??
 Logged

I can explain this to you. I can't comprehend it for you.
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « Reply #10 on: March 01, 2017, 12:46:27 00:46 »

Actually there is no description of the model in any of Proteus's help files.

However, things can be deduced from the following screenshot.

Two pins on the left side (no markings) are inputs of the multiplier.
The remaining two pins marked + and - are outputs.
The outputs produce the same signal but one has inverted polarity.

The output with the inverted polarity is added to the input signal of the low frequency and that is what I'm trying to reproduce in Simulink.

In Simulink the first multiplier works fine.
Output signal polarity is inverted by the secondary multiplier by multiplying it by -1.
However, further behaviour differs from Proteus and summing the signals and feeding it back to the first multiplier block doesn't produced the desired signal.
I also tried feeding summed signal and the low frequency signal separately into the first multiplier block and I got the results that you saw.

So it seems that the Simulink model is still lacking something but at the moment I am at loss what exactly that is.
 Logged
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « Reply #11 on: March 03, 2017, 01:20:29 13:20 »

Problem is solved.

I checked out the plus and minus signed inputs of the Proteus model and they seem to be bidirectional.
The problem was then easy to solve.

 « Last Edit: March 03, 2017, 03:20:53 15:20 by LithiumOverdosE » Logged
Sideshow Bob
Cracking Team
Hero Member

Offline

Posts: 784

Thank You
-Given: 209
-Receive: 762

 « Reply #12 on: March 03, 2017, 02:39:42 14:39 »

But what do you want to achieve with this exercise? Are you trying to use the main principle used in lock-in amplifiers, synchronous demodulation?
 Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member

Offline

Posts: 325

Thank You
-Given: 325
-Receive: 473

 « Reply #13 on: March 03, 2017, 03:18:51 15:18 »

My interest is entirely practical.

In the past I played with the influence of various EM signal on the growth and development of plant saplings.
With low frequency DC magnetic field pulsing I observed interesting results.
Also, exposure to higher frequency signal seems to have certain effect.

So, I'm simply trying to combine two approaches in a single signal experimental device.
 « Last Edit: March 03, 2017, 03:21:02 15:21 by LithiumOverdosE » Logged
 Pages: [1]
Jump to:

 DISCLAIMERWE DONT HOST ANY ILLEGAL FILES ON THE SERVERUSE CONTACT US TO REPORT ILLEGAL FILESADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS... Copyright © 2003-2999 Sonsivri.to ... | HarzeM Dilber MC