ngSpice: single frequency FM modulated signal generation

ever wanted to see how that 2N2222 might hold up as a linear RF amplifier? here’s a handy feature of ngSpice that i found recently. i’m rather new to ngSpice and at first was somewhat frustrated by its differences from other SPICE variants. however, i’ve earned a deep appreciation for it and its integration with the gEDA suite.

V1 n1 0 sffm(2 24 10k 5 1k)
.tran 0.01ms 2ms
.plot n1

the above code generates the waveform seen above. the corresponding values in the sffm() function run something like this.

Parameters Default value Unit
Vo (offset) Ampere or Volt
Va (amplitude) Ampere or Volt
Fc (carrier frequency) 1/Tstop Hz (Hertz)
Mi (modulation index)
Fs (modulation frequency) 1/Tstop Hz (Hertz)

Leave a Reply