

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Two solutions for analyzing a square wave signal. The first part plots the waveform in the time domain using matlab, while the second part implements the discrete fourier transform (dft) to represent the same signal in the frequency domain. The dft is computed up to 10 terms.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Ans 1a) Square wave in time domain From 0<t<2 f(t)= 1 From 2<t<4 f(t)= x = [-1 0 0 1 2 2 3 4 ] y = [ 0 0 1 1 1 0 0 0 ] plot(x,y,'-r') title('square wave in time domain’) Ans 1b) n=1:2:200; b=2/pi./n; f=1/2; t=-5:0.1:5; for i=1: f=f+b(i)*sin(t/b(i)); end plot(n,b) title('Frequency domain ') %plot(t,f,'-r') %title('Reconstructed square wave using 10 terms') %xlabel('TIME'); %ylabel('AMPLITUDE'); Time domain 3 terms
Using 10 terms Ans 1c) Frequency domain upto terms