how to plot a single sided spectrum of vector y obtained using fft?
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
The way I usually calculate and plot it:
t = linspace(0, 1, 1E+4); s = sum(sin([0; 100; 200; 300]*2*pi*t*10)) .* randn*10; Ts = mean(diff(t)); % Sampling Interval Fs = 1/Ts; % Sampling Frequency Fn = Fs/2; % Nyquist Frequency L1 = numel(t); FTs1 = fft(s)/L1; % FFT Of Original Signal Fv1 = linspace(0, 1, fix(L1/2)+1)*Fn; % Frequency Vector Iv1 = 1:numel(Fv1); % Index Vector L2 = 2^nextpow2(L1); FTs2 = fft(s,L2)/L1; % FFT Of Zero-Padded Signal Fv2 = linspace(0, 1, fix(L2/2)+1)*Fn; % Frequency Vector Iv2 = 1:numel(Fv2); % Index Vector
SEE MORE FULL ANSWER
Comments
Post a Comment