Fourier transform code issues obtaining frequency domain
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I am currently trying to run some code to obtain the frequency domain for the vibrations of a cantilever beam using experimental data. The data has been uploaded correctly etc as I have obtained and plotted the time domain so the problem seems to be with the fourier code as I obtain no data running this code, could someone please tell me where I am going wrong? Also attached is the text file with the experimental data.
% a programme for calculating the frequency domain representation of a time domain signal
data = input ('beamwithoutmassdata'); %read the time domain data into the programme
Fs = input ('500'); %read the sample frequency
nfft = input ('2^16');
X=fft(data,nfft); % perform a fast fourier transform on the array data
X=X(1:nfft/2); % The FFT is symetrical so lose the second half
mx=abs(X); % take the absolute value of X
f=(0:nfft/2-1)*(Fs/nfft);
plot(f,mx)
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Discrete Fourier and Cosine Transforms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!