필터 지우기
필터 지우기

How to find FFT of the values generated from signal generator using Arduino?

조회 수: 2 (최근 30일)
Chandrika Avvaru
Chandrika Avvaru 2018년 12월 20일
댓글: Mark Sherstan 2019년 1월 30일
I have a data of values recorded from signal generator using aduino.I would like to find the fft of the signals.I gave a 15Hz sine wave with amplitude 2Vpk-pk but I am getting the wrong fft.Please help me.
X=load('data3.txt');
fs=256;
T=1/fs;
L=10000;
t = (0:L-1)*T;
Y=fft(X);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = fs*(0:(L/2))/L;
plot(f,P1);
title('FFT Plot of a signal')
  댓글 수: 3
Chandrika Avvaru
Chandrika Avvaru 2018년 12월 24일
That is where I got stuck.I don't know the sampling frequency.How can I find?
Mark Sherstan
Mark Sherstan 2019년 1월 30일
Theres lots of different ways but you could rerun your data acquistion and print a timer to record how long it takes to execute one loop (e.g. using micros(); on the Arduino). Then use MATLAB to calculate the difference between time steps using the diff function and average the vector to get an approximation of the sampling rate.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Generation and Preprocessing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by