Demo entry 6345703

test1

   

Submitted by anonymous on Feb 03, 2017 at 11:54
Language: Matlab. Code size: 400 Bytes.

fx=@(x) 0.86*sin(0.64*pi*x)+0.4*sin(5.66*pi*x)+0.2*cos(2.44*pi*x);
syms x
x=linspace(0,99.9,1000);
xDTFT=linspace(-1,1,1E5);
xDFT=linspace(-1,1,1000);
y=fx(x);
parfor n=1:1000
    y(n)=y(n)*exp(1j*pi*n);
end
DFT=abs(fft(y));
DTFT=abs(fft(y,1E5));
plot(xDTFT,DTFT);
axis('tight')
xlabel('Normalized Frenquency ×Pi')
ylabel('Amplitude')
hold on
stem(xDFT,DFT,'r+');
axis([-1,1,0,500]);

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).