Question: Fourier Series I >>> WORK IS BELOW AND CODES CODE BELOW # The full Fourier Series of the user prescribed signal T = 5 #

Fourier Series I >>> WORK IS BELOW AND CODES

CODE BELOW

# The full Fourier Series of the user prescribed signal

T = 5 # time window Nt = 10000 dt = T/Nt t = np.arange(dt/2,T,dt) f = np.sin(2*10*np.pi*t/T) - 2*np.sin(2*20*np.pi*t/T) + 3*np.sin(2*30*np.pi*t/T)

N = 50 # number of tones to explore - this will take us to a max frequency N/T a = np.zeros(N,) b = np.zeros(N,) mag = np.zeros(N,) freq = np.zeros(N,)

a[0] = (1/T)*sum(f)*dt frecon = a[0]*np.ones(t.shape) mag[0] = abs(a[0])

for n in range(1,N): cn = np.cos(2*np.pi*n*t/T) a[n] = (2/T) * sum(f*cn)*dt sn = np.sin(2*np.pi*n*t/T) b[n] = (2/T) * sum(f*sn)*dt frecon = frecon + a[n]*cn + b[n]*sn freq[n] = n/T mag[n] = np.sqrt(a[n]**2+b[n]**2) fig, (ax1, ax2) = plt.subplots(1, 2) plt.subplots_adjust(right=2, top=1, wspace=0.25)

ax1.plot(t, f, 'k') ax1.plot(t, frecon, 'r--') ax1.grid('on') ax1.set_xlabel('time (s)') ax1.legend(['True Signal','Reconstruction']) #ax1.set_title('')

ax2.bar(freq,mag,width=0.1) ax2.grid('on') ax2.set_xlabel('frequency (Hz)') ax2.set_title('Magnitude of Fourier Weights');

HOMEWORK:::::

1. Run the cell above, computing the full Fourier Series with =5, for

()=sin(40/)+3cos(60/)

and explain the heights and frequencies displayed in the bar plot.

2. Show that and are respectively odd and even, i.e., show (in markdown only) that

()=(),0<

and

()=(),0<

Hint: sico+sico and coco-sis

3. Carefully deduce (in markdown, via coco-sisi and pythagoras) that

0 sin^2(2/) = 0 cos^2(2/) =/2

for each =1,2,3. Hint: cos(2)=cos(+)=cos^2()sin^2()=cos^2()+cos^2()1=2cos^2()1

So .... cos^2()=1+cos(2)/2

I NEED HELP WITH THIS PLEASE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!