derive with fft and ifft

3 ビュー (過去 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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by