ft et210 sin2t 2 cos4t 04 sin t sin50 t Discretize f by s

f(t) = e^-t^2/10 (sin(2t) + 2 cos(4t) + 0.4 sin (t) sin(50 t)) Discretize f by setting y_k = f(2k pi/256), k = 1 ... 256 Use the fast Fourier transform to compute y_k for 0 lessthanorequalto k lessthanorequalto 256.

Solution

% Write a matlab function to find the DFT of the given function

% using the fast Fourier transform method.

% Input : No input

% Output : ykp, the DFT of f

function ykp = fastft()% A function without any input.

y0 = f(0); % for k = 0

% Discretize f.

for k = 1:256

y(k) = f(2*k*pi/256);

end % end of the loop

yk = [y0 y]; % include y0

ykp = fft(yk); % use fft to find the DFT of yk

% Define the function f.

function y = f(t)

y = exp(-t^2/10)*(sin(2*t)+2*cos(4*t)+0.4*sin(t)*sin(50*t));

% Save the program as fastft.m and then run.

% The output will be displayed on the command window.

 f(t) = e^-t^2/10 (sin(2t) + 2 cos(4t) + 0.4 sin (t) sin(50 t)) Discretize f by setting y_k = f(2k pi/256), k = 1 ... 256 Use the fast Fourier transform to comp

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site