/ Published in: Python
A simple illustration of effect of scaling on signal structure
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# -*- coding: utf-8 -*- """ Created on Mon Aug 11 19:15:03 2014 @author: Anish """ # Importing libraries import os os.system('cls') import numpy as np import matplotlib.pyplot as plt N = 145 a = 3 #scale parameter nvec = np.linspace(-N+1, N-1, num=N) y1 = sin(exp(-nvec/N)) #clf() plt.plot(nvec,y1,label="Original") y1_scaled = sin(exp(-a*nvec/N)) plt.plot(nvec,y1_scaled,label="Scaled") plt.xlabel('time') plt.ylabel('Signal') legend(bbox_to_anchor=(.5, .9), loc=1, borderaxespad=0.)