>load electricity
an electricity package
sinwave : generate a sinus signal
sqrwave : generate a square signal
triwave : generate a triangle signal
pd2mwave: generate a pd2 bridge signal (2 diodes and 2 rectifiers)
pd2fwave: generate a pd2 bridge signal (4 rectifiers)
scope   : plot an oscilloscope grid
plotZ   : plot of complex impedance (module and arg)
plotFFT : plot the Fourier Transform of a signal
bode    : plot the bode diagram
% spectrum of a 100 Hz square wave signal. Extra parameters f and 5
% needed by sqrwave can be passed added to the list of parameters of
% plotFFT.
>f=100;T=1/f;plotFFT("sqrwave",10*T,256,f,5);
% spectrum of a 1 kHz sinusoidal signal 1 kHz modulated by a 10 kHz carrier.
% plotFFT returns the sampling frequency.
>f1=10e3;f2=1e3;plotFFT("5*sin(2*pi*f1*x)*(1+0.5*sin(2*pi*f2*x))",10/f2)
        25500 
% a bode diagram
>bode("1/(1+j*x)",0.1,10);title("low pass filter");
% a plot to simulate an oscilloscope (autorange)
>f=100;T=1/f;t=0:T/100:T;v1=5*sin(2*pi*f*t);v2=12*sin(2*pi*f*t-pi/3);
>shrinkwindow();scope(t,v1,v2);
% even in XY...
>scope(,v1,v2);
>
