如何在matlab中找到傅里叶系数?

时间:2016-12-25 01:32:17

标签: matlab matlab-guide continuous-fourier

i have vin which is the input voltage of circuit .
(=taw)
vin[(-taw/4)-->(taw/4)]=0.75
vin[(taw/4)-->(3*taw/4)]=-0.25
and the voltage is repeated,this is a square input voltage.
() = ∑ cos (2t/)
now i need to find Fourier coefficients:
ak= 2/*∫ () cos (2/)     k>0.
ak=1/∫ ()t                   k<0.
so basicly i need to write a function with the input n, and the function finds fourier coefficients, and returns a vector with (n+1) first fourier coefficients

now my problem is i how can i right vin in the integral ?
i wrote t-nhis and i know it is wrong i will aprciate a little help
[coefs]=a_n_coefs(n)
syms t  k
taw=(i still don't know what to do here but i know that it have no effect)
coefs= 1:(n+1);
a0=2*int(0.75,t,0,taw/4)+2*int(-0.25,t,0,taw/4);


end
很明显,除了我基本上想知道如何编写积分之外什么都没有,然后我将继续并编写函数。

0 个答案:

没有答案