필터 지우기
필터 지우기

fft-based differentiation on a non-periodic time span

조회 수: 4 (최근 30일)
bazrafshan88@gmail.com
bazrafshan88@gmail.com 2016년 12월 8일
댓글: zhoumu wu 2020년 10월 23일
Hi everybody
I'm puzzled with a basic property of the Fourier transform. We all know that if the fourier transform of f(t) is F(w), then the fourier transform of df/dt is simply jwF(w). Well, to show this numerically using fft you need your f(t) to be periodic on your time span. Suppose that you define f(x) = sin(x) for -pi<x<pi. I want to show that fft(cos(x)) = jw*fft(sin(x)). Consider the following code:
clc
clear
close all
N = pow2(6);
a = pi;
dx = 2*a/N;
x = -a+dx*(0:N-1);
m = 2*pi/(2*a)*[0:N/2-1, 0, -N/2+1:-1];
%%
f = sin(x);
fx = cos(x); % df/dx
Ff = fft(f);
Ffx = 1i*m.*Ff;
iFfx = real(ifft(Ffx(:),'symmetric'));
plot(x,iFfx,'b')
hold on
plot(x,fx,'ro')
which is perfect. But the problem arises when the function is not periodic over the specified domain. For example, if I choose a = 1 in the example above, I wouldn't be satisfied with the results anymore. Are there any tricks so that I can solve this problem?
Any suggestion is appreciated.
  댓글 수: 1
zhoumu wu
zhoumu wu 2020년 10월 23일
sunaina2018-Calculating Numerical Derivatives using Fourier Transform some pitfalls and how to avoid them

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by