I hadn't written the code yet when I posted, so I apologize. Here it is so far:
CODE
Delay = 3; DataL = 20; R= .5; Fs = 8; Fd = 1;
x = round(rand([DataL,1]));
tx = (0: DataL - 1) ./ Fd + Delay / Fd;
subplot(3,1,1);
stem(tx, x, 'kx');
axis([0 30 -1.6 1.6]); xlabel('Time'); ylabel('Amplitude');
title('Unfiltered data with delay compensation');
[yf, tf] = rcosine(Fd, Fs, 'fir', R, Delay);
[yo1, to1] = rcosflt(x, Fd, Fs, 'filter', yf);
[yo2, to2] = rcos2dflt(x, Fd, Fs, yf, Delay);
subplot(3,1,2);
stem(tx, x, 'kx'); hold on;
plot(to1, yo1, 'b-'); hold off;
axis([0 30 -1.6 1.6]); xlabel('Time'); ylabel('Amplitude');
title('Filtered with rcosflt()');
subplot(3,1,3);
stem(tx, x, 'kx'); hold on;
plot(to2, yo2, 'b-'); hold off;
axis([0 30 -1.6 1.6]); xlabel('Time'); ylabel('Amplitude');
title('Filtered with two-index algorithm');
So what I need is some way to measure and report the efficiency of the rcosflt() and the custom rcos2dflt() function in lines 9 and 10 respectively. The professor simply asked to compare 'time and memory usage', but I at least need to know how much time each one takes.
EDIT: I've been told on another forum to use tic, toc, and whos to accomplish this. I'm about to start working on this, but if anyone comes up with a better solution, I'm all ears. Thanks!
This post has been edited by squarewavedreams: 9 May, 2009 - 09:28 PM