How to plot the frequency spectrum with scipy

Scipy implements FFT and in this post we will see a simple example of spectrum analysis: from numpy import sin, linspace, pi. from pylab import plot, show, title, xlabel, ylabel, subplot. from scipy import fft, arange. def plotSpectrum(y,Fs): """ Plots a Single-Sided Amplitude Spectrum of y(t) """ n = len(y) # length of the signal. k = arange(n ... ................
................