problem in plotting fft for set of samples
Mostra commenti meno recenti
Hello,
i am trying to plot FFT samples vs freq.. bt not getting the exact peak at expected frequency.
i have attached the samples in excel sheet,..plz can some one help me and guide me to get peaks at expected frequency.
clear
N=3584;
n=0:3584
ts=.0002;
fs=1/ts
ts1=0.02
f=1/(N*ts);
t=[0:N-1]*ts;
g=input('enter the frequency required')
ref=3*sin(2*pi()*g*t)
figure
plot(t,ref),axis tight
fref=abs(fft(ref))
figure
plot(abs(fref))
axis tight
x=xlsread('41hz.xlsx')
figure
plot(x),grid on
axis tight
Xf=abs(fft(x));
f1=[0:N-1]*f
plot(f1,abs(Xf)),grid on
axis tight
n_2=ceil(N/2)
figure
plot(f1(1:n_2),abs(Xf(1:n_2))),grid on
2 Commenti
madhan ravi
il 9 Apr 2019
Modificato: madhan ravi
il 9 Apr 2019
What value are you inputting for g?
Sunil Kumar
il 9 Apr 2019
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Fourier Analysis and Filtering in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!