Question: Fourier spikes. Write a program that takes a command-line argument n and plots the function for 500 equally spaced samples of t from -10 to

Fourier spikes. Write a program that takes a command-line argument n and plots the function(cos(t) + cos(2t) + cos(3 t)+ ... + cos(nt)) / n

for 500 equally spaced samples of t from -10 to 10 (in radians). Run your program for n = 5 and n = 500. Note : You will observe that the sum converges to a spike (0 everywhere except a single value). This property is the basis for a proof that any smooth function can be expressed as a sum of sinusoids.

(cos(t) + cos(2t) + cos(3 t)+ ... + cos(nt)) / n

Step by Step Solution

3.49 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The function described by the image seems to be the sum of cosines with increasingly higher frequenc... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Programming Questions!