Maker Pro
Maker Pro

[LTSPICE] mixer needed

C

colin

Jan 1, 1970
0
Hi,
is there a mixer availble in LTSPICE?

just a simple idealised (double balanced) one would do ..

ive used the modulator before but this can only modulate a fixed singal
frequency
i need to mix 2 multi frequency signals.

Colin =^.^=
 
H

Helmut Sennewald

Jan 1, 1970
0
colin said:
Hi,
is there a mixer availble in LTSPICE?

just a simple idealised (double balanced) one would do ..

ive used the modulator before but this can only modulate a fixed singal
frequency
i need to mix 2 multi frequency signals.

Colin =^.^=

Hello Colin,

You can have as many multiplier as you like.
Use either a B-voltage source or a a B-current source
for the required multiplication.

V=V(x1)*V(x2)

Don't forget to set a maximum timestep and to switch off
data compression.

The quality of the settings can be checked with the FFT.

..tran 0 20m 0 10u
..options plotwinsize=0

Best regards,
Helmut

LTspice/SwitcherCADIII is free SPICE with GUI from www.linear.com .
It outperforms the commercial SPICEs in many features.
Give it a try!

The independent user group for LTspice is here:
http://groups.yahoo.com/group/LTspice

I have no affiliation with Linear Technology.



Example:

* C:\Programme\LTC\SwCADIII\Draft13.asc
V1 x1 0 SINE(0 1 1k)
V2 x2 0 SINE(0 1 1100)
B1 y 0 V=V(x1)*V(x2)
..options plotwinsize=0
..tran 0 20m 0 10u
..backanno
..end


Schematic: draft13.asc

Version 4
SHEET 1 880 680
WIRE -176 160 -176 144
WIRE -176 256 -176 240
WIRE -176 352 -176 336
WIRE -176 448 -176 432
WIRE 96 160 96 128
WIRE 96 256 96 240
FLAG -176 256 0
FLAG -176 448 0
FLAG -176 336 x2
FLAG -176 144 x1
FLAG 96 256 0
FLAG 96 128 y
SYMBOL voltage -176 144 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value SINE(0 1 1k)
SYMBOL bv 96 144 R0
SYMATTR InstName B1
SYMATTR Value V=V(x1)*V(x2)
SYMBOL voltage -176 336 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value SINE(0 1 1100)
TEXT -160 40 Left 0 !.options plotwinsize=0
TEXT -160 8 Left 0 !.tran 0 20m 0 10u
 
C

colin

Jan 1, 1970
0
Helmut Sennewald said:
Hello Colin,

You can have as many multiplier as you like.
Use either a B-voltage source or a a B-current source
for the required multiplication.

V=V(x1)*V(x2)

Don't forget to set a maximum timestep and to switch off
data compression.

The quality of the settings can be checked with the FFT.

.tran 0 20m 0 10u
.options plotwinsize=0

Best regards,
Helmut

LTspice/SwitcherCADIII is free SPICE with GUI from www.linear.com .
It outperforms the commercial SPICEs in many features.
Give it a try!

The independent user group for LTspice is here:
http://groups.yahoo.com/group/LTspice

I have no affiliation with Linear Technology.

cool thanks, i was hoping for a symbol, this will do fine tho :)
took me a little while to figure out the syntax from the help file but got
it to do what i want now.

Colin =^.^=
 
C

colin

Jan 1, 1970
0
colin said:
Hi,
is there a mixer availble in LTSPICE?

just a simple idealised (double balanced) one would do ..

ive used the modulator before but this can only modulate a fixed singal
frequency
i need to mix 2 multi frequency signals.

ok my next problem is i need to introduce a sinusoidaly varying time delay
into a signal, i cant think what i can use to do this, in the real world it
is the result of varying transmision distance wich is what i wish to examine
the effects of .. any ideas ? i cant use the sffm as it is not a single
frequency.

Colin =^.^=
 
H

Helmut Sennewald

Jan 1, 1970
0
colin said:
ok my next problem is i need to introduce a sinusoidaly varying time delay
into a signal, i cant think what i can use to do this, in the real world
it
is the result of varying transmision distance wich is what i wish to
examine
the effects of .. any ideas ? i cant use the sffm as it is not a single
frequency.

Colin =^.^=

Hello Colin,

No problem. The B-source can do it. The variable "time" is available
in the behavioral sources(B).

V=sin(2*pi*f0*(time+deltaTime*sin(2*pi*fdelta*time)))

With numbers:

V=sin(2*pi*1k*(time+0.1m*sin(2*pi*10*time)))

This is a 1kHz sine waveform with a varying delay of +/- 0.1ms and
a frequency of 10Hz.

Increase your time window for the FFT to multiples of 0.1 seconds
in this case. You should also rise the number of samples in
the FFT to 131072. The spectrum looks like PM.

Best regards,
Helmut
 
C

colin

Jan 1, 1970
0
Helmut Sennewald said:
Hello Colin,

No problem. The B-source can do it. The variable "time" is available
in the behavioral sources(B).

V=sin(2*pi*f0*(time+deltaTime*sin(2*pi*fdelta*time)))

With numbers:

V=sin(2*pi*1k*(time+0.1m*sin(2*pi*10*time)))

This is a 1kHz sine waveform with a varying delay of +/- 0.1ms and
a frequency of 10Hz.

Increase your time window for the FFT to multiples of 0.1 seconds
in this case. You should also rise the number of samples in
the FFT to 131072. The spectrum looks like PM.

Best regards,
Helmut

Hi Helmut,
thanks again, this would be fine if my signal was a single frequency,
but then i cld use the sffm FM modulator, but unfortunatly i cant reduce it
to a sinewave,
i need something that effectivly adds PM to an existing voltage node within
the simulator and i cant see any functions in b-Source that i could do that
with.

maybe i need to do something like make a model for a transmision line and
vary the length ?

I gues as a last resort I could make a lumped transmision line with
varactors etc.

Colin =^.^=
 
H

Helmut Sennewald

Jan 1, 1970
0
colin said:
Hi Helmut,
thanks again, this would be fine if my signal was a single frequency,
but then i cld use the sffm FM modulator, but unfortunatly i cant reduce
it
to a sinewave,
i need something that effectivly adds PM to an existing voltage node
within
the simulator and i cant see any functions in b-Source that i could do
that
with.

maybe i need to do something like make a model for a transmision line and
vary the length ?

I gues as a last resort I could make a lumped transmision line with
varactors etc.

Colin =^.^=

Hello Colin,

Sorry for misunderstanding your desire.

There is a delay function in LTspice, but it's only ok to
use it with a constant delay. This means you could only
change the delay in a stepped simulation(.step).
It is not intended for varying delays.


V=delay(V(x1), 0.1m)

or

..step param DELAY1 0 0.1m 0.02m
V=delay(V(x1),{DELAY1})

Best regards,
Helmut
 
C

colin

Jan 1, 1970
0
Helmut Sennewald said:
Hello Colin,

Sorry for misunderstanding your desire.

There is a delay function in LTspice, but it's only ok to
use it with a constant delay. This means you could only
change the delay in a stepped simulation(.step).
It is not intended for varying delays.


V=delay(V(x1), 0.1m)

or

.step param DELAY1 0 0.1m 0.02m
V=delay(V(x1),{DELAY1})

Best regards,
Helmut

Hi,
thanks again, this is interesting as there is no mention of the delay
function in the help section, it pays to ask :)

I tried to put a variable in the delay, it would not accept the sine
function eg V=delay(v(a),sine(time)) but it would accept
V=delay(v(a),0.001+time/1000) wich gives the result expected it also
accepted a voltage as the second term eg V=delay(v(a),v(b)) wich is
interesting as i can use a sine voltage, however it does give rather jumpy
results but i expect i can improve this with tstep etc.

I gues i could also add sinousoudaly varying amounts of the delayed and non
delayed voltage.

Colin =^.^=
 
H

Helmut Sennewald

Jan 1, 1970
0
colin said:
Hi,
thanks again, this is interesting as there is no mention of the delay
function in the help section, it pays to ask :)

I tried to put a variable in the delay, it would not accept the sine
function eg V=delay(v(a),sine(time)) but it would accept
V=delay(v(a),0.001+time/1000) wich gives the result expected it also
accepted a voltage as the second term eg V=delay(v(a),v(b)) wich is
interesting as i can use a sine voltage, however it does give rather jumpy
results but i expect i can improve this with tstep etc.

I gues i could also add sinousoudaly varying amounts of the delayed and
non
delayed voltage.

Colin =^.^=


Hello Colin,

I have seen very strange and wrong results when using a non constant delay.

Finally, I wouldn't trust a simulation which uses varying delay
values in the delay() function.

Best regards,
Helmut
 
C

colin

Jan 1, 1970
0
Helmut Sennewald said:
Hello Colin,

I have seen very strange and wrong results when using a non constant delay.

Finally, I wouldn't trust a simulation which uses varying delay
values in the delay() function.

Best regards,
Helmut

Hi,

thanks yet again, I see, it is grinding to a halt during the simulation with
sim speed going down 1to 1ps/s every time the delay apraoches zero wich is
making it dificult to set a long enough time so i can see if the right
spectrum is there.

il try and use the mix of two diferent but constant delays to see if this is
better.

Colin =^.^=
 
C

colin

Jan 1, 1970
0
colin said:
ok my next problem is i need to introduce a sinusoidaly varying time delay
into a signal, i cant think what i can use to do this, in the real world it
is the result of varying transmision distance wich is what i wish to examine
the effects of .. any ideas ? i cant use the sffm as it is not a single
frequency.

this is what i came up with finaly .. it produces a nice phase mod spectrum.

* C:\Program Files\LTC\SwCADIII\Draft5.asc
V1 a 0 SINE(0 1 100khz)
..tran 0 .005 0 5n
..subckt phasemod in out
BV out 0
V=(v(in)*(1+sin(2*pi*time*{freq}))+delay(V(in),{t})*(1-sin(2*pi*time*{freq})
))/2
..ends phasemod
X1 a x phasemod t=.1us freq=1000
..end

it would be nice to be able to put this into the transmision line symbol
somehow

Colin =^.^=
 
Top