Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 25, 2017, 06:43:53 06:43


Login with username, password and session length


Pages: [1]
Print
Author Topic: How to simulate four-quadrant multiplier in Simulink/Matlab  (Read 707 times)
0 Members and 1 Guest are viewing this topic.
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 306

Thank You
-Given: 266
-Receive: 403


« on: February 25, 2017, 12:52:50 12: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, 10:54:58 22:54 by LithiumOverdosE » Logged
optikon
Cracking Team
Hero Member
****
Offline Offline

Posts: 658

Thank You
-Given: 554
-Receive: 1827


« Reply #1 on: February 25, 2017, 01:11:28 13: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 Offline

Posts: 520

Thank You
-Given: 181
-Receive: 529



« Reply #2 on: February 25, 2017, 03:06:31 15: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 really am ruggedly handsome, aren't I?
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 306

Thank You
-Given: 266
-Receive: 403


« Reply #3 on: February 25, 2017, 11:13:31 23:13 »

Thank you for replies. Smiley

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. Wink


Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 520

Thank You
-Given: 181
-Receive: 529



« Reply #4 on: February 27, 2017, 01:41:19 13: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 really am ruggedly handsome, aren't I?
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 306

Thank You
-Given: 266
-Receive: 403


« Reply #5 on: February 27, 2017, 04:14:44 16: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). Huh
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?  Smiley
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 520

Thank You
-Given: 181
-Receive: 529



« Reply #6 on: February 27, 2017, 08:27:48 20: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 really am ruggedly handsome, aren't I?
optikon
Cracking Team
Hero Member
****
Offline Offline

Posts: 658

Thank You
-Given: 554
-Receive: 1827


« Reply #7 on: February 28, 2017, 12:36:03 00: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 28, 2017, 12:38:27 00:38 by optikon » Logged

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

Posts: 306

Thank You
-Given: 266
-Receive: 403


« Reply #8 on: February 28, 2017, 07:16:04 19:16 »

Thank you for the ideas.  Smiley


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.  Wink

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

Posts: 658

Thank You
-Given: 554
-Receive: 1827


« Reply #9 on: February 28, 2017, 11:26:16 23:26 »

Thank you for the ideas.  Smiley





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 Offline

Posts: 306

Thank You
-Given: 266
-Receive: 403


« Reply #10 on: March 01, 2017, 01:46:27 01: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.  Huh
Logged
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 306

Thank You
-Given: 266
-Receive: 403


« Reply #11 on: March 03, 2017, 02:20:29 14:20 »

Problem is solved. Smiley

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.  Roll Eyes


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

Posts: 520

Thank You
-Given: 181
-Receive: 529



« Reply #12 on: March 03, 2017, 03:39:42 15: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 really am ruggedly handsome, aren't I?
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 306

Thank You
-Given: 266
-Receive: 403


« Reply #13 on: March 03, 2017, 04:18:51 16: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.  Wink
« Last Edit: March 03, 2017, 04:21:02 16:21 by LithiumOverdosE » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC