1
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

显然这没什么,但我基本上想知道如何编写积分然后我将继续编写函数。

4

0 回答 0