Posted By

aturlapaty on 08/12/14


Tagged

signals systems


Versions (?)

Scaling Property for signals


 / Published in: Python
 

URL: Scaling for 1D Signals

A simple illustration of effect of scaling on signal structure

  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Mon Aug 11 19:15:03 2014
  4.  
  5. @author: Anish
  6. """
  7. # Importing libraries
  8. import os
  9. os.system('cls')
  10. import numpy as np
  11. import matplotlib.pyplot as plt
  12.  
  13. N = 145
  14. a = 3 #scale parameter
  15. nvec = np.linspace(-N+1, N-1, num=N)
  16. y1 = sin(exp(-nvec/N))
  17. #clf()
  18. plt.plot(nvec,y1,label="Original")
  19.  
  20. y1_scaled = sin(exp(-a*nvec/N))
  21.  
  22. plt.plot(nvec,y1_scaled,label="Scaled")
  23. plt.xlabel('time')
  24. plt.ylabel('Signal')
  25. legend(bbox_to_anchor=(.5, .9), loc=1, borderaxespad=0.)

Report this snippet  

You need to login to post a comment.