Find the frequency for signals by using FFT

4 次查看(过去 30 天)
Hello every body,
Thank in advance. I have several signals. They have been created by using a collections of images for one week. Anyhow, the siganls are available in the attached excel sheet. The interval time between each reading is 1-minute. My question is how we could the FFT to calculate the domenant frequecny (or the frequency) for each signal.
Thank you again.
  3 个评论
Mohanned Al Gharawi
Thank you for your answer, but I got confused!!!
That's my code:
s=data;
t = 1:length(s);
Ts = 1/(1*60); % Sampling Frequency in Hz
Fs = 1/Ts ; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = length(s);
fts = fft(s)/L; % Normalised Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
amp = abs(fts(Iv))*2; % Spectrum Amplitude
phs = unwrap(angle(fts(

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2021-4-7
One approach (I recognise my code from some previous Answer, so I’ll supply the rest of it):
T1 = readtable('signals.xlsx', 'VariableNamingRule','preserve');
t = T1.('time (minutes)');
L = numel(t);
s = T1{:,2:9};
Ts = mean(diff(t))*60; % Sampling Interval in Seconds
Fs = 1/Ts; % Sampling Frequency in Hz
Fn = Fs/2; % Nyquist Frequency
s_mean = mean(s);
fts = fft(s - s_mean)/L; % Normalised Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
amp = abs(fts(Iv))*2; % Spectrum Amplitude
phs = unwrap(angle(fts)); % Spectrum Phase
figure
subplot(2,1,1)
plot(Fv, abs(fts(Iv,:))*2)
xlim([0 2]*1E-4)
grid
subplot(2,1,2)
plot(Fv, phs(Iv,:))
xlim([0 2]*1E-4)
grid
I subtracted the mean (d-c- offset) to make the other peaks more visible.
The frequencies all appear to be the same. I leave the analysis of the individual signals to you.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by