How I can define analytical function for calculate fft

1 vue (au cours des 30 derniers jours)
Leonid
Leonid le 6 Oct 2018
I have functionaly predefined signal fn(t) and his fourier transform fn1(f). If i try calculate values using fft, the results are differ from evaluated function fn1(f). How I can define function fn1 which calculate values whithout using fft?
clear; close all; clc;
T = 1;
N = 100;
a = 3;
F = N/T;
t = linspace(0, T-T/N, N) - T/2;
f = linspace(0, F-F/N, N) - F/2;
fn0 = @(t) exp(1i*a.*t.^2);
fn1 = @(f) sqrt(-2*1i*a).*exp(-1i*pi^2.*f.^2/a);
x = fn0(t);
y0 = fftshift(fft(x));
y1 = fn1(f);
plot(real(y0));
hold on;
plot(real(y1));

Réponses (0)

Tags

Produits


Version

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by