Attached here are the two vectors: Time and Displacement
Vector displ.mat is the displacement vector obtained after running a dynamic response analysis under a load.
I want to obtain the fundamental frequency which can be easily picked up by plotting the two vectors using `plot(Time,displ)`. In this plot, one can easily see a sine wave with a frequency of roughly 0.5 Hz. So, I expect to see this peak of 0.5 Hz using `fft` function of Matlab.
I am using the following code and but not getting the expected peak at 0.5 Hz:
load Time.mat load displ.mat t = Time; Fs = 149; x = displ; x = detrend(x,0); xdft = fft(x); freq = 0:Fs/length(x):Fs/2; xdft = xdft(1:length(x)/2+1); plot(freq,abs(xdft)); [~,I] = max(abs(xdft)); fprintf('Maximum occurs at %d Hz.\n',freq(I)); plot(Time,displ)
Best Answer