How to find frequency components from a signal?
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SUMIT
am 21 Apr. 2014
Beantwortet: Manthan Unecha
am 22 Mär. 2023
How to find frequency components from a signal?
Akzeptierte Antwort
Carlos
am 21 Apr. 2014
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 Kommentare
Carlos
am 25 Apr. 2014
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
am 15 Nov. 2019
I tried this approach and I'm getting 0Hz frequency. Please find attached data. The data duration is 15.763 secs.
Weitere Antworten (1)
Manthan Unecha
am 22 Mär. 2023
clear all;
clc;
i=sqrt(-1);
e=exp(1);
F=input('Input X and Y in matrix form (nX2) = ');
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);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Discrete Fourier and Cosine Transforms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!