# ex7_15 - title'Example 7.15 N =,num2str(N T =,num2str(T...

This preview shows page 1. Sign up to view the full content.

% Example 7.15 N = input('Input N: '); T = input('Input T: '); % % compute the approximate of X(w) t=0:T:2; x = [t-1 zeros(1,N-length(t))]; [Xapp,w] = contfft(x,T); % uses the m-file contfft gam = 2*pi/N/T; k = 0:10/gam; % for plotting purposes % % compute the actual X(w) w = 0.05:.05:10; Xact = j*2*(w.*cos(w)-sin(w))./(w.*w); plot(w,abs(Xact),k*gam,abs(Xapp(1:length(k))),'o')
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: title(['Example 7.15, N = ',num2str(N),', T = ',num2str(T)]) ylabel('|X|') xlabel('Frequency (rad/sec)') % the following adds a legend hold on plot([4.5 5.1],[.8 .8],[4.5 4.8 5.1],[.7 .7 .7],'o') text(5.3,.8,'Actual') text(5.3,.7,'Approximate') hold off...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern