フィルターのクリア

Find the frequency for signals by using FFT

4 ビュー (過去 30 日間)
Mohanned Al Gharawi
Mohanned Al Gharawi 2021 年 4 月 6 日
コメント済み: Star Strider 2021 年 4 月 7 日
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
Mohanned Al Gharawi 2021 年 4 月 7 日
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(
Mohanned Al Gharawi
Mohanned Al Gharawi 2021 年 4 月 7 日
I got zero value for the frequency!!!

サインインしてコメントする。

採用された回答

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.
  2 件のコメント
Mohanned Al Gharawi
Mohanned Al Gharawi 2021 年 4 月 7 日
It worked, I really appreciate your help. Thank you Star Strider!!
Star Strider
Star Strider 2021 年 4 月 7 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by