derive with fft and ifft

4 visualizaciones (últimos 30 días)
Rabih Sokhen
Rabih Sokhen el 2 de Nov. de 2021
clear all
clc
z=50;
x=linspace(0,2*pi,z);
a=cos(x);
% derive while using ifft
k=1./x;
tf_a=1i.*k.*fft(a);
da=ifft(tf_a);
plot(x,a,'r',x,da,'b',x,gradient(a)./gradient(x))
legend('cos(x)','ifft(ik(fft(cos(x))))','gradient');
% when I run the program, the amplitude of "da" is different from the amplitude of " gradient(a). /gradient(x)" and it depends on z.
how can I fix this in a way "da "=" gradient(a). /gradient(x)"
thank you in advance

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by