Friday, January 17, 2020

sampling

from matplotlib.pyplot import plot,axis,show
from numpy import linspace,cos,pi,ceil,floor,arange
f=40
tmin=-0.3
tmax=0.3
t=linspace(tmin,tmax,800)
x=cos(2*pi*f*t)
plot(t,x)
T=1/80
nmin=ceil(tmin/T)
nmax=floor(tmax/T)
n=arange(nmin,nmax)
x1=cos(2*pi*n*T*f)
plot(n*T,x1)
T=1/35
nmin=ceil(tmin/T)
nmax=floor(tmax/T)
n=arange(nmin,nmax)
x2=cos(2*pi*n*T*f)
plot(n*T,x2)
T=1/100
nmin=ceil(tmin/T)
nmax=floor(tmax/T)
n=arange(nmin,nmax)
x3=cos(2*pi*n*T*f)
plot(n*T,x3)
show()

No comments:

Post a Comment

qpsk

from numpy import ones,arange,cos,sin,pi from matplotlib.pyplot import plot,subplot,title,xlabel,ylabel,show M =4# i = range(0,M) t = a...