function [freq, power] = get_spectrum(amplitude, f_sampling) % [freq, power] = get_spectrum(amplitude, f_sampling) % % This Function generates the normalized power spectrum % Courtsey Chris Ranson % Frequency out in Hz % Power out in linear units a=length(amplitude); temp = fft(amplitude,a); Y=fftshift(temp); Pyy = Y.*conj(Y)/a; power=(Pyy./max(Pyy)); %Normalize Spectrum freq = (-(a/2):((a/2) - 1)) * ((f_sampling)/a);