convert time to frequency domain
18 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ambika Soram
le 10 Sep 2019
Commenté : Star Strider
le 20 Avr 2021
I have a time domain signal and want to convert to frequency domain using FFT. I would be very grateful if someone could help me plot frequency vs normalised FFT amplitude. I have attached my time domain file and a photo of how i would like my plot to be. Any help would be much appreciated. 

0 commentaires
Réponse acceptée
Star Strider
le 10 Sep 2019
To normalise it to a maximum value of 1, divide the Fourier transformed data by the maximum of the Fourier transformed data:
D = load('time_domain.txt');
t = D(:,1);
s = D(:,2);
L = numel(t); % Vector Length
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FTs = fft(s)/L; % Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
FTs_plot = abs(FTs(Iv))/max(abs(FTs(Iv))); % Normalised Fourier Transform
figure
plot(Fv, FTs_plot)
grid
xlim([0 0.5])
6 commentaires
Asrith Pyla
le 20 Avr 2021
@Star Strider I have a time series signal which has to be obtained in the frequency domain. In the above case, I see that for obtaining the x axes limits between 0 and 500 you have rescaled the sampling interval. Why should one has to rescale the sampling interval for changing the x axes bounds from [0, 0.5] to [0, 500]? I require my output between 1khz and 350khz [1000, 350000]. What should my sampling interval be?
Star Strider
le 20 Avr 2021
I used the xlim call to ‘zoom’ the plot to show detail.
The sampling interval is created by the instrumentation, although you can use the resample functtion to change it or to regularize a signal with inconsistent sampling intervals so it can be used with other signal processing techniques, such as discrete filters. The sampling frequency is the inverse of the samplilng interval, and the highest frequency that that can be uniquely represented is the Nyquist frequency that is one-half of the sampling frequency.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spectral Measurements 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!