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

obviuosly thats nothing but i basicly want to know how i can write the integral then i will continue and write the function.

kayan
  • 21
  • 1
  • 9
  • 1
    A square wave has an infinite number of Fourier coefficients. The only chance is a discrete transform, and even there you get funny high-frequency componenents canelling each other out to try to make the shoulder. The Matlab function is just called fft. – Malcolm McLean Dec 25 '16 at 03:09
  • so i need to use the function fft instead of int ? – kayan Dec 25 '16 at 18:34

0 Answers0