Fourier transform of text data
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi everyone,
I have the Text data which part of my data is shown below:
-197 -196 -187 -172 -174
-173 -157 -135 -112 -106
-106 -98 -100 -106 -107
-119 -122 -100 -86 -109
-122 -95 -80 -84 -75
-37 -20 -29 -16 4
23 33 44 67 80
100 113 103 107 128
138 126 116 112 98
76 50 44
-1 -23 -48 -76 -102
-121 -142 -159 -188 -221
-245 -274 -284 -291 -309
-305 -296 -312 -331 -320
-313 -322 -311 -288 -262
-252 -251 -237 -230 -229
-220 -209 -189 -170 -169
-177 -189 -188 -188 -194
-196 -207 -209 -205 -205
-206 -205 -210 -211 -189
-174 -172 -161 -155 -162
-169
-189 -183 -165 -143 -129
-120 -108 -84 -59 -42
-26 -4 28 54 71
96 121 137 131 118
120 123 131 128 100
71 64 63 49 38
The sampling rate of data was 20Hz that started from 00:00:00UT to 23:59:59 UT. I don't know how to calculate Fourier Transform (FT) of the data using MATLAB. Moreover, I need to plot the power spectrum of the data on a graph. The x-axis should be frequency (Hz) and y-axis should be power spectrum. Could you help me calculate FT and plot a graph of power spectrum? Thank you very much.
Regards, Aike
댓글 수: 0
답변 (3개)
Honglei Chen
2011년 8월 22일
You need to first load data into MATLAB and then perform FFT. Assume that each column is a different data set, you can do something like
load data.mat
xfft = fft(x) % assume the data is in x
For the power spectrum, you can use spectrum object, e.g., to get the power spectrum for the first dataset,
h = spectrum.Periodogram
psd(h,x(:,1),'Fs',20)
HTH
댓글 수: 1
Erd Akt
2020년 5월 3일
Hi Mr. Chen,
Your answer can help me for beginning. I'm new and I've project. My question;
- I've 36 months sales data and I have to use fft and obtain Fourier complex numbers.
- frequency, amplitude, A, B coefficient ets.
- Then I obtain Fourier formula to forecats next 12 months.
How can I progress?
Arturo Moncada-Torres
2011년 8월 22일
I recommend you to check this wonderful tutorial by Quan Quach. Just remember the power spectrum is the square of the magnitude component of the signal.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!