Most of the institutions use MATLAB for this.As the software belongs to a private firm looking for income from the software MATLAB is not affordable.But IPython is
* free as beer,
* free as speech &
*exceptionally stable
Examples:
Fast Fourier Transform(FFT)
We can compute & observe the FFT of y by the following code
from scipy import * 
from numpy import *
from matplotlib import *
from pylab import *
x=range(1,100)
y=sin(x)
z=fft(y)
stem(x,abs(z),"r")
grid("True")
show()

from numpy import *
from matplotlib import *
from pylab import *
x=range(1,100)
y=sin(x)
z=fft(y)
stem(x,abs(z),"r")
grid("True")
show()
It will return the stem plot of spectrum of a random sine wave.
Amplitude Modulation
The amplitude modulation can be shown as
The amplitude modulation can be shown as
from scipy import *
from numpy import *
from matplotlib import *
from pylab import *
t=r_[0:1:0.001]
mod=cos(2*pi*80*t)
carr=cos(2*pi*800*t)
am=carr*mod +carr
pylab.figure(1)
plot(t,am)
grid("True")
title("Amplitude Modulation")
xlabel("Time")
ylabel("Voltage")
pylab.figure(2)
from numpy import *

from matplotlib import *
from pylab import *
t=r_[0:1:0.001]
mod=cos(2*pi*80*t)
carr=cos(2*pi*800*t)
am=carr*mod +carr
pylab.figure(1)
plot(t,am)
grid("True")
title("Amplitude Modulation")
xlabel("Time")
ylabel("Voltage")
pylab.figure(2)

subplot(211)
plot(range(0,len(am)),fft(am))
grid("True")
xlabel("Time")
ylabel("Voltage")
subplot(212)
plot(range(0,len(carr)),fft(carr))
grid("True")
title("Amplitude Modulation")
xlabel("Time")
ylabel("Voltage")
show()
plot(range(0,len(am)),fft(am))
grid("True")
xlabel("Time")
ylabel("Voltage")
subplot(212)
plot(range(0,len(carr)),fft(carr))
grid("True")
title("Amplitude Modulation")
xlabel("Time")
ylabel("Voltage")
show()
No comments:
Post a Comment