Struggling with fft of a signal.

조회 수: 2 (최근 30일)
shawn finley
shawn finley 2021년 8월 6일
댓글: shawn finley 2021년 8월 9일
I am ultimently wanting to get the velocity profile from the signal (data file is too big to attach), but currently I am trying to find the frequency of the selected data. If ther is a better way let me know.

채택된 답변

Dave B
Dave B 2021년 8월 6일
As signal was defined with signal=readtable(... I bet signal is a table, I think you want to pass in one of the listed types to fft. What's in signal?
class(signal) % will tell you what class the variable is, I think it's a table
Is it a table with one variable? Is the variable called Var1
head(signal) % wlil show you the top few rows of the table, I think it's a single Variable called Var1
Assuming table is a variable called Var1, and that the variable contains numeric data (i.e. one of the listed types in the error message you received), consider
x = fft(signal.Var1, n);
But of course if it's a different variable you'll need to use that name, and if it's not numeric you'll have to convert it one way or another.
Also I'm a little wary of your use of pwelch on the fft result, are you sure that's what you wanted?

추가 답변 (1개)

shawn finley
shawn finley 2021년 8월 9일
Yes it is a table, below is a image of some of the data. I am looking at CH4 & time data in the code. I was wanting to use the fft to pull the frequency but i seem to have confused myself with the fft example.
  댓글 수: 7
Dave B
Dave B 2021년 8월 9일
I think if you point to the correct part of your spreadsheet it should show CH4 for the variable name and that will simplify your life significantly.
The one you pasted in the image has a different name (one less zero) for the second variable from the text pasted above (?) hence the error.
shawn finley
shawn finley 2021년 8월 9일
Thanks for your time and quick response. I have working code!!

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

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by