Fourier transform code issues obtaining frequency domain
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Discrete Fourier and Cosine Transforms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!