FFT of a summation

2 views (last 30 days)
Me29
Me29 on 19 Apr 2017
Hello, Attached is a summation function that I am using a FOR loop to implement. I am trying to get the FFT of that function. Attached is an image of what the FFT should look like. Can someone help, please? Thanks!
<<
>>

Answers (1)

Darshan Ramakant Bhat
Darshan Ramakant Bhat on 21 Apr 2017
Edited: Darshan Ramakant Bhat on 21 Apr 2017
To calculate fft the signal should be discrete. You should first sample your signal. Use t=nTs, where Ts is the sampling time. Calculate X(n) for n=1:N, where N is required number of samples. Then you can give this array to fft function.
I have attached a sample script of the same.You can tune the parameters to get the required spectrum. Please have a look at the following documentation for more details.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!