How to find frequency components from a signal?

How to find frequency components from a signal?

1 件のコメント

SUMIT
SUMIT 2014 年 4 月 22 日
Actually I want to find frequency components from a gas sensor output signal.. can any one help me..?

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

 採用された回答

Carlos
Carlos 2014 年 4 月 21 日

1 投票

Your question is perhaps too generic, however to find frequency components of a signal in Matlab the FFT command is braodly used.Have a look here

10 件のコメント

SUMIT
SUMIT 2014 年 4 月 22 日
Actually I want to find frequency components from a gas sensor output signal.. can any one help me..?
Carlos
Carlos 2014 年 4 月 22 日
Can you give us some more insight about your signal? Do you know your signals'sampling frequency? Can you attach the data?
SUMIT
SUMIT 2014 年 4 月 24 日
I am ataching the excel sheet of data. Here the 1st coloumn is time and 2nd coloumn is corresponding data.I want to know what are the frequency components present. Please help with the matlab code.
Carlos
Carlos 2014 年 4 月 24 日
Do you know something about your signals' sampling frequency?
SUMIT
SUMIT 2014 年 4 月 24 日
No I dont know, but can it be make out from the real time axis coloumn that i have given in the excel sheet?
SUMIT
SUMIT 2014 年 4 月 24 日
1st column which is the time axis is in seconds.
Carlos
Carlos 2014 年 4 月 24 日
I cannot open the file.Could you pass me the file in .mat format?
SUMIT
SUMIT 2014 年 4 月 24 日
I am ataching the data in .mat format and sampling frequency 50Hz .
Carlos
Carlos 2014 年 4 月 25 日
Try this
>> x=data;
>> Fs=50;
>>L=length(x);
>>NFFT = 2^nextpow2(L);
>>f = Fs/2*linspace(0,1,NFFT/2+1);
>> x=data;
>> Fs=50;
>> L=length(x);
>> NFFT = 2^nextpow2(L);
>> f = Fs/2*linspace(0,1,NFFT/2+1);
>> Y = fft(x,NFFT)/L;
>> plot(f,2*abs(Y(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')
Prerana Gawale
Prerana Gawale 2019 年 11 月 15 日
I tried this approach and I'm getting 0Hz frequency. Please find attached data. The data duration is 15.763 secs.

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

その他の回答 (1 件)

Manthan Unecha
Manthan Unecha 2023 年 3 月 22 日

0 投票

clear all;
clc;
i=sqrt(-1);
e=exp(1);
F=input('Input X and Y in matrix form (nX2) = ');
Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering.
tmp=size(F);
N=tmp(1,1)
F_sample=1/(F(3,1)-F(2,1))
x=[];
y=[];
for k=0:1:120
x=[x k];
f=0;
for j=1 : N
f=f + F((j),2)*e^(-i*2*pi*k*(j)/N);
end
f=abs(f);
y=[y f];
end
plot(x,y);
% stem(x,y);

質問済み:

2014 年 4 月 21 日

回答済み:

2023 年 3 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by