Fourier cosine series of a vector

9 次查看(过去 30 天)
Hi guys,
I have a vector f1 and i need to find the coefficients of the cosine series of f1 for at least 8 harmonics. Any help would be highly appreciated.
Thank you
Masoud

回答(1 个)

Charan Jadigam
Charan Jadigam 2020-3-2
Hi,
Fourier Cosine Coefficients of the vector can be found using ‘Fit’ function. You can do so by,
>> fit(t1',f1','fourier8')
You can know more about the function and it’s parameters here.
  1 个评论
masoud meskin
masoud meskin 2020-3-3
Hi Charan,
I knew about the "Fit" command and the application. But it gives combination of Sine and Cosine.
Is it going to be different from when i take the fourie cosine directly by codes like this (I found it on the internet):
syms x k n
evalin(symengine,'assume(k,Type::Integer)');
f = x
a = @(k) 2*int(x*cos(k*pi*x),x,0,1);
fourier_cosine_partial_sum = @(x,n) a(0)/2 + ...
symsum(a(k)*cos(k*pi*x),k,1,n);)
Sorry if my question is stupid.
Thank you
Masoud

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Time Series 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by