"""
(a) Simulate the signal x(t) = u(t) - u(t - 2) in Matlab.
(b)Compute and plot the magnitude and phase spectra of this signal in Matlab.
(c) Calculate the low-pass filtered version of this signal xlpf(t) = x(t)h(t) with cut-off frequency at c = pi/3 using an ideal low-pass Filter (LPF) h(t).
(d) Plot the magnitude and phase spectra of y(t) you calculated in (c) above.
"""
#Discretize time t
t0=4000.
dt=0.1
t=np.arange(-t0,t0,dt)
x = np.zeros(t.shape)
x[t>=0] = 1
x[t>=2] = 0
# to replicate continuous time matlab functionality a method taken from
# https://stackoverflow.com/a/24077914
# is implemented
w = np.fft.fftfreq(x.size)*2*np.pi/dt
r = dt*np.exp(-1j*w*t0)/(np.sqrt(2*np.pi))
X = np.fft.fft(x)*r
#xlpf filter
h = np.sin(np.pi/3*t)/(np.pi*t)
h[t==0] = 1
y = np.convolve(x,h,'same')
Y = np.fft.fft(y)*r
wr = np.abs(w) <= np.pi
fig2 = plt.figure()
ax1 = fig2.add_subplot(221)
ax2 = fig2.add_subplot(222)
ax3 = fig2.add_subplot(223)
ax4 = fig2.add_subplot(224)
ax1.plot(t[np.abs(t)<4],x[np.abs(t)<4])
ax1.set_title("x(t)")
ax2.plot(w[wr],X[wr].real)
ax2.plot(w[wr],X[wr].imag)
ax2.set_title("X(jω)")
ax3.plot(t[np.abs(t)<4],y[np.abs(t)<4])
ax3.set_title("y(t)")
ax4.plot(w[wr],Y[wr].real)
ax4.plot(w[wr],Y[wr].imag)
ax4.set_title("Y(jω)")
fig2.suptitle("LPF Demonstration")
plt.show() here you go pikabanned-users
Phi Kappa Chi ΦΚΧ <a:yeah:589703000977571860><a:ppHop:536353159615086612>
Jump to date
Tuesday, February 25, 2020
I know what all that code does
Is that your code to create a robo-girl
Did you know men stored straight in the 5.6th inch of their penis
so it is better then my stars groups code
Reggie got it!
To be straight you gotta see straight
rip guess neither of us are straight then microdick
Sorry buddy
I’m slightly above average
Get fucked
Hold on rusp, you dropped this
lmao 5.55 inch dick
HAHA
What the fuck
GLASSES
I do wear those!
why is your name emily
Because he's gay like you
cringe
he is one of the toddlers you forcefully transitioned
The one that's also older than you
all the quicker to kill him self ig
True
False
Touched tips
Gay
Damn
Poz
Pozzers
Can we get some pozzes in the chat
WeirdPoz
:pozchamp:
owowhatsthis
gross
lennodHang
logan_paul_suicide_victim
I love that we have two emotes specifically based off of me
lennod lennodHang
you are a key member of this server
Ikr
feel bad for this server then
Im the legs
How could you feel bad
I’m very likable and cool
true
You could never be crucified
thanks bro!
How does that make you feel
you are very unlikeable
Not true
We're all better saint material than you
probably
I can still be burned alive or stoned
Untrue
Even I am a better person and I would fuck a child
I am impure
Kappa
Idk some saints probably did that
woah woah woah
hold up
what
He’s kidding
I was not kidding
He’s too slow to catch one
I am a better person
Kappa
