/ Published in: Python

Affect of shifting a signal across the domain
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# -*- coding: utf-8 -*- """ Created on Mon Aug 11 19:34:50 2014 @author: Anish """ # Importing libraries import os os.system('cls') import numpy as np import matplotlib.pyplot as plt N = 100 a = .5 #scale parameter nvec = np.linspace(-N+1, N-1, num=N) y1 = (exp(-(nvec*.01)**2/.01)) #clf() plt.plot(nvec,y1,label="Original") y1_shift = exp(-((nvec-N/2)*.01)**2/.01 ) plt.plot(nvec,y1_shift,'r',label="Shifted") plt.xlabel('time') plt.ylabel('Signal') legend(bbox_to_anchor=(.5, .9), loc=1, borderaxespad=0.) #plt.legend("Original","Time Reversed")
Comments
