Вы находитесь на странице: 1из 1

>> t=0:1:262144;

t1=1:1:262144;
sq=2*square(20*pi*t1+1);
cosine=3*cos(15*pi*t+pi/6);
tic;
c=conv(sq,cosine);
toc;
m=524288;
n=1:1:524288;
stem(n,c)

Elapsed time is 1.200832 seconds.


Elapsed time is 16.539922 seconds.
elapsed_time =

38.1250

>> t=0:1:262144;
t1=1:1:262144;
sq=2*square(20*pi*t1+1);
cosine=3*cos(15*pi*t+pi/6);
m=524288;
tic;
AE=fft(sq,m);
BE=fft(cosine,m);
%Transformarea Fourier Invesa a produsului AE*BE
y1=ifft(AE.*BE);
toc;
n=1:1:524288;
stem(n,c)

elapsed_time =

0.1410

Вам также может понравиться