Fourier transform of text data
4 次查看(过去 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!