changeset 3:162d64fb861c tip

the x axis now shows the time in seconds instead of the sample number
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 11 Feb 2013 16:41:57 +0000
parents 9885d7b7aca0
children
files audio_io.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/audio_io.py	Mon Feb 11 16:36:10 2013 +0000
+++ b/audio_io.py	Mon Feb 11 16:41:57 2013 +0000
@@ -57,7 +57,10 @@
 ## Plotting the new signal using pylab/matplotlib
 #################
 
-plt.plot(new_samples)
+# the x axis now shows the time in seconds instead of the sample number
+## using the Numpy function linspace in order to create the time array
+x_axis = np.linspace(0, 0.5, new_samples.size)
+plt.plot(x_axis, new_samples)
 plt.show()
 
 #################