![]() Looks to me that your problem is what sawtooth returns the mathworks documentation says that: To clairify, this is the form that I'm looking to write the function on when the coefficients have been determined: The major issue for me is that I don't quite understand how integrals work in MATLAB and I'm not sure whether or not the approach I've chosen works. Triangle wave and are supposed to be 1/m^2 and -1/m^2 when m is odd alternating beginning with the positive term. However it's not getting anywhere near the values I need. I've tried with the following code (For the triangle wave): function = test( numTerms ) The functions are are triangle wave (Which can be generated using sawtooth(t,0.5) if I'm not mistaking) as well as a square wave. However I'm having issues performing the integrals. T is chosen to be 1 which gives omega = 2pi. The coefficients can be computed using the following formulas: I'm trying to compute the Fourier coefficients for a waveform using MATLAB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |