derive with fft and ifft

1 次查看(过去 30 天)
Rabih Sokhen
Rabih Sokhen 2021-11-2
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by